From 8b57729c8abfd5d4b49dc19f9e3f229a5e1b3086 Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Wed, 3 Dec 2025 15:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=AF=B7=E6=B1=82=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/customerService/product/index.ts | 8 ++++++++ src/utils/request.ts | 7 ++++--- src/views/customerService/account/index.vue | 2 +- .../product/component/editRole.vue | 10 +++++----- .../product/component/exportDialog.vue | 17 ++++++++++++++--- src/views/customerService/product/index.vue | 2 +- .../script/component/editRole.vue | 10 ++++++++-- 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/api/customerService/product/index.ts b/src/api/customerService/product/index.ts index 7fd10dc..77a55d6 100644 --- a/src/api/customerService/product/index.ts +++ b/src/api/customerService/product/index.ts @@ -35,3 +35,11 @@ export function updateProduct(data: object) { data: data, }); } + +export function exportProduct(data: object) { + return newService({ + url: '/customerService/product/export', + method: 'get', + params: data, + }); +} diff --git a/src/utils/request.ts b/src/utils/request.ts index b41a6f2..3f7e8b1 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -18,8 +18,8 @@ const service: AxiosInstance = axios.create({ // 配置新建第二个 axios 实例(新功能服务) const newService: AxiosInstance = axios.create({ - // baseURL: 'http://192.168.3.95:8000/', // 新后端地址 - baseURL: 'http://192.168.3.49:8000/', // 后端地址 + baseURL: 'http://192.168.3.95:8000/', // 新后端地址 + // baseURL: 'http://192.168.3.49:8000/', // 后端地址 timeout: 50000, // 50秒超时 headers: { 'Content-Type': 'application/json' }, // 默认JSON格式 paramsSerializer: { @@ -50,7 +50,8 @@ const responseInterceptor = (response: any) => { // 对响应数据做点什么 const res = response.data; const code = response.data.code; - if (code === 401) { + const message = response.data.message; + if (code === 401 || message === 'token is invalid') { // 401未授权:token过期,跳转登录页 ElMessageBox.alert('登录状态已过期,请重新登录', '提示', { confirmButtonText: '确定' }) .then(() => { diff --git a/src/views/customerService/account/index.vue b/src/views/customerService/account/index.vue index 9bc21de..d0dc643 100644 --- a/src/views/customerService/account/index.vue +++ b/src/views/customerService/account/index.vue @@ -142,7 +142,7 @@ const tableData = reactive({ }); // 模板引用 -const editRoleRef = ref>(); +const editRoleRef = ref>(); /** * 获取客服账号列表 diff --git a/src/views/customerService/product/component/editRole.vue b/src/views/customerService/product/component/editRole.vue index 1d970f2..1b31686 100644 --- a/src/views/customerService/product/component/editRole.vue +++ b/src/views/customerService/product/component/editRole.vue @@ -12,7 +12,7 @@ - + @@ -81,11 +81,11 @@ const state = reactive({ // 表单验证规则 const rules: FormRules = { - name: [ - { required: true, message: '产品名称不能为空', trigger: 'blur' }, - { min: 2, max: 50, message: '产品名称长度在 2 到 50 个字符', trigger: 'blur' }, + name: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }, { max: 64, message: '产品名称长度最多 64 个字符', trigger: 'blur' }, 1], + description: [ + { required: true, message: '产品详情不能为空', trigger: 'blur' }, + { max: 8126, message: '产品详情长度最多8126 个字符', trigger: 'blur' }, ], - description: [{ required: true, message: '产品详情不能为空', trigger: 'blur' }], }; // 模板引用 diff --git a/src/views/customerService/product/component/exportDialog.vue b/src/views/customerService/product/component/exportDialog.vue index f036b41..0f9a398 100644 --- a/src/views/customerService/product/component/exportDialog.vue +++ b/src/views/customerService/product/component/exportDialog.vue @@ -12,9 +12,11 @@