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("无法连接"); + }) + } + } }, };