소스 검색

密钥修改

dujingxian 4 년 전
부모
커밋
8cc9ce7ecf
1개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 10 3
      src/pages/subPages/view.vue

+ 10 - 3
src/pages/subPages/view.vue

@@ -24,8 +24,8 @@
             {{alarm_amount}}
         </el-form-item>
         <el-form-item label="密钥设置:" :prop="useKey == '1' ? 'ReSecurityKey' : 'securityKey'">
-            <el-input v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
-            <el-input v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+            <el-input show-password v-if="useKey == '1'" v-model="formKey.ReSecurityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
+            <el-input show-password v-else v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
             <el-button type="primary" size="small" @click="updateKey">{{useKey == '1' ? '重设' : '设置'}}</el-button>
             <el-alert
                 title="请输入数字,字母或者两者结合的字符作为密钥。用于接口对接时生成签名"
@@ -226,11 +226,18 @@ export default {
         },
         // 设置密钥
         async updateKey() {
-            const res = await updateKey(this.formKey.securityKey)
+            let res 
+            if (this.useKey == '1') {
+                res = await updateKey(this.formKey.ReSecurityKey)
+            } else {
+                res = await updateKey(this.formKey.securityKey)
+            }
             console.log('密钥', res);
             if (res && res.code == 200) {
                 this.$message.success('设置密钥成功')
             }
+            this.formKey.ReSecurityKey = ''
+            this.formKey.securityKey = ''
         }
         // 新增
         // addIp() {}