From a748a8b3376c260e75afdc9a2ca0feaee4abf816 Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 20 Dec 2024 16:54:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(xumu):=20=E7=BB=9F=E4=B8=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B7=BB=E5=8A=A0=20/api=20=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个组件中,将请求路径从 "/user/config/page" 修改为 "/api/user/config/page"- 将请求路径从 "/siteUser/querySiteByUserId" 修改为 "/api/siteUser/querySiteByUserId" - 将请求路径从 "/siteUser/del" 修改为 "/api/siteUser/del" -将请求路径从 "/siteUser/add" 修改为 "/api/siteUser/add" - 将请求路径从 "/user/auth/page" 修改为 "/api/user/auth/page" - 将请求路径从 "/user/auth/update" 修改为 "/api/user/auth/update" - 将请求路径从 "/user/update-status" 修改为 "/api/user/update-status" 通过添加 /api前缀,统一了接口请求路径的格式,提高了代码的一致性和可维护性。 --- .../AppAccountConfigManage/AppAccountConfigManage.vue | 8 ++++---- project/xumu/AppAuthManage/authAdd.vue | 2 +- project/xumu/AppAuthManage/authList.vue | 4 ++-- project/xumu/AppSystemAccount/AppSystemAccount.vue | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue b/project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue index a44a2c90..1f195796 100644 --- a/project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue +++ b/project/xumu/AppAccountConfigManage/AppAccountConfigManage.vue @@ -32,7 +32,7 @@ export default { }, methods: { getTableData() { - this.instance.post("/user/config/page", null, { + this.instance.post("/api/user/config/page", null, { params: {...this.page, ...this.search} }).then(res => { if (res?.data) { @@ -43,7 +43,7 @@ export default { }, getTreeData() { const {userId} = this - this.instance.post("/siteUser/querySiteByUserId", null, {params: {userId}}).then(res => { + this.instance.post("/api/siteUser/querySiteByUserId", null, {params: {userId}}).then(res => { if (res?.data) { this.treeData = res.data } @@ -51,7 +51,7 @@ export default { }, handleDelete(node) { this.$confirm("是否要删除该节点?").then(() => { - this.instance.post("/siteUser/del", null, {params: {ids: node.id}}).then(res => { + this.instance.post("/api/siteUser/del", null, {params: {ids: node.id}}).then(res => { if (res?.code == '0' && res?.data != 1) { this.$message.success("删除成功!") this.getTreeData() @@ -64,7 +64,7 @@ export default { createNode(data) { this.$prompt("请输入名称").then(({value}) => { const {userId} = this - this.instance.post("/siteUser/add", null, {params: {name: value, parentId: data.id, userId}}).then(res => { + this.instance.post("/api/siteUser/add", null, {params: {name: value, parentId: data.id, userId}}).then(res => { if (res?.code == '0' && res?.data != 1) { this.$message.success("新增成功!") this.getTreeData() diff --git a/project/xumu/AppAuthManage/authAdd.vue b/project/xumu/AppAuthManage/authAdd.vue index 096c9a28..509ac4e1 100644 --- a/project/xumu/AppAuthManage/authAdd.vue +++ b/project/xumu/AppAuthManage/authAdd.vue @@ -25,7 +25,7 @@ export default { methods: { getDetail() { const {id} = this.$route.query - this.instance.post("/user/auth/page", null, {params: {id}}).then(res => { + this.instance.post("/api/user/auth/page", null, {params: {id}}).then(res => { if (res?.data) { this.detail = res.data|| {} } diff --git a/project/xumu/AppAuthManage/authList.vue b/project/xumu/AppAuthManage/authList.vue index 0cd83843..700e7543 100644 --- a/project/xumu/AppAuthManage/authList.vue +++ b/project/xumu/AppAuthManage/authList.vue @@ -36,7 +36,7 @@ export default { }, methods: { getTableData() { - this.instance.post("/user/auth/page", null, { + this.instance.post("/api/user/auth/page", null, { params: {...this.page, ...this.search} }).then(res => { if (res?.data) { @@ -50,7 +50,7 @@ export default { }, handleConfirm() { this.$refs.form.validate().then(() => { - this.instance.post("/user/auth/update", this.form).then(res => { + this.instance.post("/api/user/auth/update", this.form).then(res => { if (res?.code == '0' && res?.data != 1) { this.dialog = false this.$message.success("提交成功!") diff --git a/project/xumu/AppSystemAccount/AppSystemAccount.vue b/project/xumu/AppSystemAccount/AppSystemAccount.vue index 88abea26..2fe2d4ab 100644 --- a/project/xumu/AppSystemAccount/AppSystemAccount.vue +++ b/project/xumu/AppSystemAccount/AppSystemAccount.vue @@ -208,7 +208,7 @@ export default { changeEnable(row) { const {status, id} = row this.$confirm(`是否要${status == 1 ? '禁用' : '启用'}该账号?`).then(() => { - this.instance.post("/user/update-status", null, {params: {id}}).then(res => { + this.instance.post("/api/user/update-status", null, {params: {id}}).then(res => { if (res?.code == 0) { this.$message.success(`${status == 1 ? '禁用' : '启用'}成功!`) this.getTableData()