From 21ef158ce4b04c43efa7d9031a18975bfe6b1f56 Mon Sep 17 00:00:00 2001 From: chenpanliang <3245129380@qq.com> Date: Thu, 28 Aug 2025 20:21:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(https):=20=E5=88=87=E6=8D=A2=E5=9F=BA?= =?UTF-8?q?=E7=A1=80URL=E5=B9=B6=E6=B8=85=E7=90=86=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E5=99=A8=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除生产环境URL注释并启用本地开发URL 清理请求拦截器中不必要的注释和空行 --- my-vue-app/src/utils/https.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/my-vue-app/src/utils/https.js b/my-vue-app/src/utils/https.js index 089b8ae..29dbac9 100644 --- a/my-vue-app/src/utils/https.js +++ b/my-vue-app/src/utils/https.js @@ -5,8 +5,8 @@ import { useUserStore } from '@/stores/user' // 创建axios实例 const service = axios.create({ - baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL - // baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL + // baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL + baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL timeout: 100000, // 请求超时时间 headers: { 'Content-Type': 'application/json;charset=UTF-8' @@ -16,9 +16,6 @@ const service = axios.create({ // 请求拦截器 service.interceptors.request.use( config => { - // 在发送请求之前做些什么 - // console.log('发送请求:', config) - // 添加token到请求头 const userStore = useUserStore() const token = userStore.token @@ -32,13 +29,10 @@ service.interceptors.request.use( _t: Date.now() } } - // https://mldash.nycjy.cn/login // 显示加载状态 if (config.showLoading !== false) { - // 可以在这里添加全局loading console.log('显示加载中...') - } - + } return config }, error => { @@ -48,7 +42,6 @@ service.interceptors.request.use( return Promise.reject(error) } ) - // 响应拦截器 service.interceptors.response.use( response => {