浏览代码

微信配置增加secret

seimin 3 年之前
父节点
当前提交
a7dd2b60d9

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

@@ -9,6 +9,12 @@
9 9
         </nz-form-control>
10 10
       </nz-form-item>
11 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 18
         <nz-form-label [nzSpan]="24" nzFor="agentid" nzRequired class="label">微信应用的agentid</nz-form-label>
13 19
         <nz-form-control [nzSpan]="24" nzErrorTip="请输入微信应用的agentid!">
14 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 47
     this.hospitals = this.tool.getHospitalList();
48 48
     this.validateForm = this.fb.group({
49
+      secret: [null, [Validators.required]],
49 50
       appid: [null, [Validators.required]],
50 51
       agentid: [null, [Validators.required]],
51 52
       autoCreateUser: ["1", [Validators.required]],
@@ -68,6 +69,7 @@ export class WechatConfigComponent implements OnInit {
68 69
     }
69 70
     const postData = {
70 71
       id: this.id,
72
+      appSecret: this.validateForm.controls.secret.value,
71 73
       createUser:
72 74
         this.validateForm.controls.autoCreateUser.value === "1" ? 1 : 0,
73 75
       defaultRole: this.validateForm.controls.defaultRole.value,
@@ -112,6 +114,7 @@ export class WechatConfigComponent implements OnInit {
112 114
                   this.loading1 = false;
113 115
                   this.deptList = result2.list;
114 116
                   this.id = config.id;
117
+                  this.validateForm.controls.secret.setValue(config.appSecret);
115 118
                   this.validateForm.controls.appid.setValue(config.appId);
116 119
                   this.validateForm.controls.agentid.setValue(config.agentId);
117 120
                   this.validateForm.controls.autoCreateUser.setValue(
@@ -166,6 +169,7 @@ export class WechatConfigComponent implements OnInit {
166 169
     setTimeout(() => {
167 170
       this.promptModalShow = true;
168 171
     }, 100);
172
+    this.loading1 = true;
169 173
     this.getWechatConfig();
170 174
   }
171 175
   //修改默认院区