refactor(xumu): 统一接口添加 /api 前缀

- 在多个组件中,将请求路径从 "/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前缀,统一了接口请求路径的格式,提高了代码的一致性和可维护性。
This commit is contained in:
aixianling
2024-12-20 16:54:24 +08:00
parent 37a6cb3457
commit a748a8b337
4 changed files with 8 additions and 8 deletions

View File

@@ -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()