diff --git a/config/index.js b/config/index.js index e21bd69..4e0addc 100644 --- a/config/index.js +++ b/config/index.js @@ -18,7 +18,8 @@ module.exports = { assetsPublicPath: '/', proxyTable: { '/': { - target: 'http://39.103.180.196:9011', // 接口域名 + // target: 'http://39.103.180.196:9011', // 接口域名 + target: 'http://localhost:9011', // 接口域名 changeOrigin: true, //是否跨域 pathRewrite: { '^/': '/' //需要rewrite重写的, diff --git a/src/api/tag.js b/src/api/tag.js new file mode 100644 index 0000000..1e47c7c --- /dev/null +++ b/src/api/tag.js @@ -0,0 +1,85 @@ +/* + * @Description: + * @version: v1 + * @Author: zhangjiabao + * @Date: 2024-01-08 00:20:50 + */ +import request from "@/utils/request"; +export default { + /** + * 查询标签列表 + * @param {*} params + * @returns + */ + getList(data, pageNum, pageSize) { + return request({ + // url: `/luoo-tag/tag/list?pageNum=${pageNum}&pageSize=${pageSize}`, + url: `/luoo-tag/tag/list`, + method: "get", + params:{ + ... data, + pageNum, + pageSize + } + }); + }, + /** + * 查询标签详情 + * @param {*} params + * @returns + */ + getById(id) { + return request({ + url: `/tag/${id}`, + method: "get" + }); + }, + /** + * 新增标签信息 + * @param {*} data + * @returns + */ + create(data) { + return request({ + url: `/luoo-tag/tag`, + method: "post", + data + }); + }, + /** + * 更新标签信息 + * @param {*} id + * @param {*} data + * @returns + */ + update(data) { + return request({ + url: `/luoo-tag/tag/${data.id}`, + method: "put", + data + }); + }, + /** + * 更新标签状态 + * @param {*} id + * @param {*} state + * @returns + */ + updateStatus(id, state) { + return request({ + url: `/luoo-tag/tag/status/${id}?state=${state}`, + method: "put" + }); + }, + /** + * 删除标签 + * @param {*} params + * @returns + */ + delete(id) { + return request({ + url: `/luoo-tag/tag/${id}`, + method: "delete" + }); + } +}; diff --git a/src/utils/request.js b/src/utils/request.js index 7b9c801..72d00ae 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,3 +1,9 @@ +/* + * @Description: + * @version: v1 + * @Author: zhangjiabao + * @Date: 2024-01-02 21:12:35 + */ import axios from 'axios' import { Message, MessageBox } from 'element-ui' import store from '../store' @@ -28,7 +34,9 @@ service.interceptors.response.use( * code为非20000是抛错 可结合自己业务进行修改 */ const res = response.data - if (res.code !== 20000) { + // TODO: 关于code的逻辑需要重写 + return response.data + if (!(res.code == 2000 || res.code == 200)) { Message({ message: res.message, type: 'error', diff --git a/src/views/tag/index.vue b/src/views/tag/index.vue index ce0fcd5..dd84c16 100644 --- a/src/views/tag/index.vue +++ b/src/views/tag/index.vue @@ -9,7 +9,8 @@
- 标签列表 + 标签列表 + 二级标签列表 + + + + + + + @@ -75,7 +87,8 @@ plain icon="el-icon-full-screen" type="primary" - @click="log('查看二级')" + v-if="tagType === 1" + @click="handleChangeChildrenTag" >查看二级 @@ -83,9 +96,10 @@ - - - + + + + - - + + @@ -114,13 +137,20 @@ - + @@ -153,6 +193,7 @@ - + - + + + + + + + + - + @@ -207,10 +263,14 @@