diff --git a/src/api/auth/platform.js b/src/api/auth/platform.js index cc3a184..f96f8f9 100644 --- a/src/api/auth/platform.js +++ b/src/api/auth/platform.js @@ -82,4 +82,10 @@ export function testPlatformConnection(query) { }) } - +export function testUserInfo(data) { + return axios({ + url: "/udims/platform/testUserInfo", + method: "post", + data: data + }); +} diff --git a/src/views/sys/bindPlatform.vue b/src/views/sys/bindPlatform.vue index 3f7f4e3..72749fe 100644 --- a/src/views/sys/bindPlatform.vue +++ b/src/views/sys/bindPlatform.vue @@ -146,11 +146,13 @@ - 账号验证 + + 账号验证 + @@ -162,7 +164,7 @@ { - this.$refs['editLogin'].resetFields(); this.$refs["editLogin"].clearValidate(); }); }, @@ -643,6 +648,7 @@ export default { type: "success", message: "关联成功" }); + this.targetPlatformEdit = true; this.cancelDialog(); } else { this.$message.error(response.message); @@ -668,7 +674,32 @@ export default { this.getTargetActions(); }, testUserInfo() { - + if (isBlank(this.editLogin.platformId)) { + this.$message.error("请选择自助平台"); + return; + } + if (isBlank(this.editLogin.platformUsername)) { + this.$message.error("请输入用户名"); + return; + } + if (isBlank(this.editLogin.platformPassword)) { + this.$message.error("请输入密码"); + return; + } + let data = { + platformId: this.editLogin.platformId, + username: this.editLogin.platformUsername, + password: this.editLogin.platformPassword + }; + testUserInfo(data).then((res) => { + if (res.code === 20000) { + this.targetPlatformEdit = false; + this.$message.success("验证成功"); + } else { + this.$message.error(res.message); + } + }).catch((error) => { + }); }, }, mounted() {