Explorar o código

微信配置增加secret

seimin %!s(int64=3) %!d(string=hai) anos
pai
achega
a7dd2b60d9

+ 6 - 0
src/app/views/wechat-config/wechat-config.component.html

@@ -9,6 +9,12 @@
9
         </nz-form-control>
9
         </nz-form-control>
10
       </nz-form-item>
10
       </nz-form-item>
11
       <nz-form-item class="formItem">
11
       <nz-form-item class="formItem">
12
+        <nz-form-label [nzSpan]="24" nzFor="secret" nzRequired class="label">微信Secret</nz-form-label>
13
+        <nz-form-control [nzSpan]="24" nzErrorTip="请输入微信Secret!">
14
+          <input nz-input formControlName="secret" id="secret" placeholder="请输入微信Secret">
15
+        </nz-form-control>
16
+      </nz-form-item>
17
+      <nz-form-item class="formItem">
12
         <nz-form-label [nzSpan]="24" nzFor="agentid" nzRequired class="label">微信应用的agentid</nz-form-label>
18
         <nz-form-label [nzSpan]="24" nzFor="agentid" nzRequired class="label">微信应用的agentid</nz-form-label>
13
         <nz-form-control [nzSpan]="24" nzErrorTip="请输入微信应用的agentid!">
19
         <nz-form-control [nzSpan]="24" nzErrorTip="请输入微信应用的agentid!">
14
           <input nz-input formControlName="agentid" id="agentid" placeholder="请输入微信应用的agentid" disabled>
20
           <input nz-input formControlName="agentid" id="agentid" placeholder="请输入微信应用的agentid" disabled>

+ 4 - 0
src/app/views/wechat-config/wechat-config.component.ts

@@ -46,6 +46,7 @@ export class WechatConfigComponent implements OnInit {
46
     });
46
     });
47
     this.hospitals = this.tool.getHospitalList();
47
     this.hospitals = this.tool.getHospitalList();
48
     this.validateForm = this.fb.group({
48
     this.validateForm = this.fb.group({
49
+      secret: [null, [Validators.required]],
49
       appid: [null, [Validators.required]],
50
       appid: [null, [Validators.required]],
50
       agentid: [null, [Validators.required]],
51
       agentid: [null, [Validators.required]],
51
       autoCreateUser: ["1", [Validators.required]],
52
       autoCreateUser: ["1", [Validators.required]],
@@ -68,6 +69,7 @@ export class WechatConfigComponent implements OnInit {
68
     }
69
     }
69
     const postData = {
70
     const postData = {
70
       id: this.id,
71
       id: this.id,
72
+      appSecret: this.validateForm.controls.secret.value,
71
       createUser:
73
       createUser:
72
         this.validateForm.controls.autoCreateUser.value === "1" ? 1 : 0,
74
         this.validateForm.controls.autoCreateUser.value === "1" ? 1 : 0,
73
       defaultRole: this.validateForm.controls.defaultRole.value,
75
       defaultRole: this.validateForm.controls.defaultRole.value,
@@ -112,6 +114,7 @@ export class WechatConfigComponent implements OnInit {
112
                   this.loading1 = false;
114
                   this.loading1 = false;
113
                   this.deptList = result2.list;
115
                   this.deptList = result2.list;
114
                   this.id = config.id;
116
                   this.id = config.id;
117
+                  this.validateForm.controls.secret.setValue(config.appSecret);
115
                   this.validateForm.controls.appid.setValue(config.appId);
118
                   this.validateForm.controls.appid.setValue(config.appId);
116
                   this.validateForm.controls.agentid.setValue(config.agentId);
119
                   this.validateForm.controls.agentid.setValue(config.agentId);
117
                   this.validateForm.controls.autoCreateUser.setValue(
120
                   this.validateForm.controls.autoCreateUser.setValue(
@@ -166,6 +169,7 @@ export class WechatConfigComponent implements OnInit {
166
     setTimeout(() => {
169
     setTimeout(() => {
167
       this.promptModalShow = true;
170
       this.promptModalShow = true;
168
     }, 100);
171
     }, 100);
172
+    this.loading1 = true;
169
     this.getWechatConfig();
173
     this.getWechatConfig();
170
   }
174
   }
171
   //修改默认院区
175
   //修改默认院区