|
@@ -17,15 +17,18 @@
|
|
|
<el-form-item label="商户号:">
|
|
|
{{merchantsCode}}
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="商户名称:">
|
|
|
+ {{merchantsName}}
|
|
|
+ </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>
|
|
|
<el-form-item label="ip白名单:" >
|
|
|
- <div v-for="(item, idx) in ipList" :key="idx">
|
|
|
- <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" v-model="item.ip"></el-input>
|
|
|
- <i v-if="idx === 0" class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
|
|
|
- <i v-else class="el-icon-remove-outline" style="color:#F56C6C;" @click="del(idx)"></i>
|
|
|
+ <div v-for="item in ipList" :key="item">
|
|
|
+ <el-input style="width: 300px;margin-bottom: 10px;margin-right: 10px;" :value="item"></el-input>
|
|
|
+ <i v-if="item === '172.22.0.1'" class="el-icon-circle-plus-outline" style="color:#409EFF;" @click="add"></i>
|
|
|
+ <i v-else class="el-icon-remove-outline" style="color:#F56C6C;" @click="del(item)"></i>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -45,9 +48,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// getIpList获取Ip列表 delIpList-删除 addIp-添加
|
|
|
+// getIpList获取Ip列表 delIpList-删除 addIp-添加 getUserInfo-用户信息
|
|
|
import {
|
|
|
- getIpList,
|
|
|
+ // getIpList,
|
|
|
delIpList,
|
|
|
addIp,
|
|
|
getUserInfo,
|
|
@@ -83,27 +86,29 @@ export default {
|
|
|
repeatIp: false,
|
|
|
// 商户号
|
|
|
merchantsCode: '',
|
|
|
+ // 商户名称
|
|
|
+ merchantsName: '',
|
|
|
// 密钥
|
|
|
securityKey: ''
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.getIpList();
|
|
|
+ // this.getIpList();
|
|
|
this.getUserInfo()
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取Ip列表
|
|
|
- async getIpList() {
|
|
|
- const res = await getIpList()
|
|
|
- console.log('获取ip列表', res);
|
|
|
- this.ipList = res.datas
|
|
|
+ // async getIpList() {
|
|
|
+ // const res = await getIpList()
|
|
|
+ // console.log('获取ip列表', res);
|
|
|
+ // this.ipList = res.datas
|
|
|
|
|
|
- },
|
|
|
+ // },
|
|
|
// 删除
|
|
|
- del(idx) {
|
|
|
- console.log('idx', idx);
|
|
|
+ del(ip) {
|
|
|
+ console.log('ip', ip);
|
|
|
// 提示
|
|
|
this.$confirm("确认删除该ip?", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -112,7 +117,7 @@ export default {
|
|
|
})
|
|
|
.then(async () => {
|
|
|
// 调用删除接口
|
|
|
- const res = await delIpList({ip_key: idx})
|
|
|
+ const res = await delIpList({ip: ip})
|
|
|
console.log('删除ip', res);
|
|
|
if (res.code == 200) {
|
|
|
// 提示
|
|
@@ -121,7 +126,7 @@ export default {
|
|
|
type: 'success'
|
|
|
});
|
|
|
// 获取列表
|
|
|
- this.getIpList()
|
|
|
+ this.getUserInfo()
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -147,6 +152,7 @@ export default {
|
|
|
this.ipList.forEach(item => {
|
|
|
this.repeatIp = item.ip == this.ipFormData.name
|
|
|
})
|
|
|
+ this.repeatIp = this.ipList.find((item => item == this.ipFormData.name))
|
|
|
}
|
|
|
if (this.repeatIp) {
|
|
|
this.$message.error('该ip已存在')
|
|
@@ -160,7 +166,7 @@ export default {
|
|
|
message: '添加成功',
|
|
|
type: 'success'
|
|
|
});
|
|
|
- this.getIpList()
|
|
|
+ this.getUserInfo()
|
|
|
this.dialogFormVisible = false
|
|
|
this.ipFormData.name = ''
|
|
|
}
|
|
@@ -171,7 +177,9 @@ export default {
|
|
|
async getUserInfo() {
|
|
|
const res = await getUserInfo()
|
|
|
console.log('个人中心', res);
|
|
|
- this.merchantsCode = res.datas.admin_id
|
|
|
+ this.merchantsCode = res.datas.mchid
|
|
|
+ this.merchantsName = res.datas.name
|
|
|
+ this.ipList = res.datas.ips
|
|
|
},
|
|
|
// 设置密钥
|
|
|
async updateKey() {
|