From 5ce28bd81f47d530dafe80f0c93eaf61c2a7692c Mon Sep 17 00:00:00 2001 From: x_z Date: Wed, 11 May 2022 09:13:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E5=9B=BD?= =?UTF-8?q?=E5=AE=B6UDI=E5=BA=93=E6=8E=A5=E5=8F=A3=E8=BF=9E=E9=80=9A?= =?UTF-8?q?=E6=80=A7=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/warehouse/company.js | 8 ++++++++ src/views/warehouse/company.vue | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/api/warehouse/company.js b/src/api/warehouse/company.js index 2f43a2f..9cfacd1 100644 --- a/src/api/warehouse/company.js +++ b/src/api/warehouse/company.js @@ -61,6 +61,14 @@ export function getSubCompany2(query) { ); } +//测试国家UDI库接口连通性 +export function testConnection(query) { + return axios({ + url: "/warehouse/info/testConnection", + method: "get", + params: query + }) +} diff --git a/src/views/warehouse/company.vue b/src/views/warehouse/company.vue index 113f554..aed3f83 100644 --- a/src/views/warehouse/company.vue +++ b/src/views/warehouse/company.vue @@ -186,10 +186,13 @@ splaceholder="请输入内容" v-model="inputQuery.appSecret" > + 测试连通性 + +
@@ -213,6 +216,7 @@ getCompany, modifyCompany, getRefid, + testConnection } from "../../api/warehouse/company"; import store from "../../store/index"; @@ -330,6 +334,26 @@ this.inputQuery.bussinessStatus = this.inputQuery.bussinessStatus + ""; }); }, + //测试连通性 + testConnection() { + if (this.inputQuery.appId === '' || this.inputQuery.appSecret === '') { + this.$message.error("请输入授权参数"); + } else { + let param = { + appId: this.inputQuery.appId, + appSecret: this.inputQuery.appSecret + }; + testConnection(param).then((res) => { + if (res.code == 20000) { + this.$message.success("连接成功"); + } else { + this.$message.error("无法连接"); + } + }).catch(() => { + this.$message.error("无法连接"); + }) + } + } }, };