|
@@ -13,7 +13,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table> -->
|
|
|
- <el-form label-width="120px">
|
|
|
+ <el-form label-width="120px" :model="formKey" :rules="ruleKey">
|
|
|
<el-form-item label="商户号:">
|
|
|
{{merchantsCode}}
|
|
|
</el-form-item>
|
|
@@ -23,9 +23,16 @@
|
|
|
<el-form-item label="余额预警:">
|
|
|
{{alarm_amount}}
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="密钥设置:">
|
|
|
- <el-input v-model="securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
|
|
|
- <el-button type="primary" size="small" @click="updateKey">确定</el-button>
|
|
|
+ <el-form-item label="密钥设置:" prop="securityKey">
|
|
|
+ <el-input v-model="formKey.securityKey" autocomplete="off" style="width: 300px;margin-right:10px"></el-input>
|
|
|
+ <el-button type="primary" size="small" @click="updateKey">设置</el-button>
|
|
|
+ <el-alert
|
|
|
+ title="请输入15位以内的数字,字母或者两者结合的字符作为传递信息时的密钥"
|
|
|
+ type="info"
|
|
|
+ show-icon
|
|
|
+ style="width:500px;height:25px;margin-top:5px"
|
|
|
+ :closable="false">
|
|
|
+ </el-alert>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="ip白名单:" >
|
|
|
<div v-if="cIpList">
|
|
@@ -96,7 +103,17 @@ export default {
|
|
|
// 余额预警
|
|
|
alarm_amount: '',
|
|
|
// 密钥
|
|
|
- securityKey: ''
|
|
|
+ // securityKey: '',
|
|
|
+ // 密钥校验,只能是数字和字母
|
|
|
+ formKey: {
|
|
|
+ securityKey: ''
|
|
|
+ },
|
|
|
+ ruleKey: {
|
|
|
+ securityKey: [
|
|
|
+ { required: true, message: '请输入密钥', trigger: 'blur' },
|
|
|
+ { pattern: /^[A-Za-z0-9]{1,15}$/, message:'请输入合法密钥', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -196,7 +213,7 @@ export default {
|
|
|
},
|
|
|
// 设置密钥
|
|
|
async updateKey() {
|
|
|
- const res = await updateKey(this.securityKey)
|
|
|
+ const res = await updateKey(this.formKey.securityKey)
|
|
|
console.log('密钥', res);
|
|
|
if (res && res.code == 200) {
|
|
|
this.$message.success('设置密钥成功')
|