From 2d7470c133a224e7c7b2115269ccf95971a18e01 Mon Sep 17 00:00:00 2001 From: yangchunlong <292345300@qq.com> Date: Sat, 29 Mar 2025 16:12:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20token=E6=97=A0=E6=84=9F?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/index.ts | 8 ++++---- src/api/modules/productList.ts | 4 ++++ src/views/QAManagement/list/index.vue | 2 +- src/views/articleManagement/list/index.vue | 2 +- src/views/articleManagement/recycle/index.vue | 2 +- src/views/articleManagement/remark/index.vue | 2 +- src/views/bannerManagement/class/index.vue | 2 +- src/views/bannerManagement/list/index.vue | 2 +- src/views/downloadManagement/class/index.vue | 2 +- src/views/downloadManagement/list/index.vue | 2 +- src/views/downloadManagement/recycle/index.vue | 2 +- src/views/login/index.vue | 2 +- src/views/productManagement/link/index.vue | 6 +++--- src/views/productManagement/list/index.vue | 9 +++++---- src/views/productManagement/recycle/index.vue | 2 +- src/views/videoManagement/class/index.vue | 2 +- src/views/videoManagement/list/index.vue | 2 +- src/views/videoManagement/recycle/index.vue | 2 +- src/views/webManagement/configuration/index.vue | 2 +- 20 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.env.development b/.env.development index e6e119e..fdccc50 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'dev' VITE_APP_API_BASEURL =https://dev.ow.f2b211.com/admapi/v1 #前端回显图片之类的地址 -VITE_APP_API_BASE_UPLOAD_URL =https://dev.ow.f2b211.com/ +VITE_APP_API_BASE_UPLOAD_URL =https://dev.ow.f2b211.com # 本地环境 VITE_USER_NODE_ENV = development diff --git a/src/api/index.ts b/src/api/index.ts index 2a9fcea..41e3979 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -6,7 +6,7 @@ import { showFullScreenLoading, tryHideFullScreenLoading } from "@/config/servic import { ElMessage } from "element-plus"; import { ResultData } from "@/api/interface"; import { ResultEnum } from "@/enums/httpEnum"; -import { checkStatus } from "./helper/checkStatus"; +// import { checkStatus } from "./helper/checkStatus"; import { useUserStore } from "@/stores/modules/user"; import router from "@/routers"; //获取导出表格name @@ -54,7 +54,7 @@ class RequestHttp { // 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { noLoading: true } 来控制 config.noLoading || showFullScreenLoading(); if (config.headers && typeof config.headers.set === "function") { - config.headers.set("Authorization", "Bearer" + " " + userStore.token); + config.headers.set("Authorization", userStore.token); } return config; }, @@ -74,7 +74,7 @@ class RequestHttp { //获取导出表格名称 getDispositionName(response); // 获取响应头中的 Authorization 信息 - const authorization = response.headers["Authorization"]; + const authorization = response.headers["authorization"]; if (authorization) { // 可以在这里更新用户的 token 信息 const userStore = useUserStore(); @@ -103,7 +103,7 @@ class RequestHttp { // 根据服务器响应的错误状态码,做不同的处理 if (response) { console.log("error-走到了这里", response.status); - checkStatus(response.status, response.data); + // checkStatus(response.status, response.data); } // 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面 if (!window.navigator.onLine) router.replace("/500"); diff --git a/src/api/modules/productList.ts b/src/api/modules/productList.ts index 958b542..db139df 100644 --- a/src/api/modules/productList.ts +++ b/src/api/modules/productList.ts @@ -36,3 +36,7 @@ export const getProductListSortApi = (params: any) => { const { id, sort } = params; return http.post(`${PRODUCT}/sort/${id}`, { sort }); }; +// getProductCategoryListApi +export const getProductCategoryListApi = () => { + return http.get(`/product/categorys`); +}; diff --git a/src/views/QAManagement/list/index.vue b/src/views/QAManagement/list/index.vue index f0488b3..cf1cc18 100644 --- a/src/views/QAManagement/list/index.vue +++ b/src/views/QAManagement/list/index.vue @@ -15,7 +15,7 @@