diff --git a/app/api-collect-code/auth/index.js b/app/api-collect-code/auth/index.js index b8ab883..07177d0 100644 --- a/app/api-collect-code/auth/index.js +++ b/app/api-collect-code/auth/index.js @@ -1,4 +1,4 @@ -import { request } from '@/api/http.js' +import { request } from '@/api-collect-code/http.js' export async function checkPhone(data) { return await request({ @@ -9,7 +9,7 @@ export async function checkPhone(data) { } export async function userSend(data) { return await request( { - url:'/api/v1/m/user/send', + url:'/api/v1/m/user/mobile/send', method: 'POST', data }) diff --git a/app/api-collect-code/goods/index.js b/app/api-collect-code/goods/index.js index 60a5206..ba219d6 100644 --- a/app/api-collect-code/goods/index.js +++ b/app/api-collect-code/goods/index.js @@ -1,4 +1,4 @@ -import { request } from '@/api/http.js' +import { request } from '@/api-collect-code/http.js' export async function offlineQrcodeList(data) { return await request( { @@ -56,7 +56,7 @@ export async function offlineQrcode(data) { export async function createOrder(data) { return await request( { - url:'/api/v1/offlineQrcode/createOrder', + url:'/api/v1/offlineQrcode/createOrder/V2', method: 'POST', data }) diff --git a/app/api-collect-code/http.js b/app/api-collect-code/http.js index e59b001..08e6936 100644 --- a/app/api-collect-code/http.js +++ b/app/api-collect-code/http.js @@ -9,9 +9,9 @@ let http // HTTP 状态码映射 - 使用i18n国际化 export function setupHttp() { if (http) return http - const {token}= codeAuthStore() + const {codeToken}= codeAuthStore() const config = useRuntimeConfig() - const baseURL = config.public.NUXT_PUBLIC_API_COLLECT_CODE + const baseURL = config.public.NUXT_PUBLIC_API_BASE const router = useRouter() const i18n = useNuxtApp().$i18n @@ -43,7 +43,7 @@ export function setupHttp() { // 添加 token options.headers = { ...options.headers, - Authorization: token.value, + Authorization: codeToken.value, 'accept-language': i18n.locale.value } @@ -64,11 +64,11 @@ export function setupHttp() { if (data.status === 1) { message.error(data.msg || i18n.t('http.error.operationFailed')) } - + console.log('拦截响应',data) // 处理登录失效 if (data.status === 401) { message.error(i18n.t('http.error.loginExpired')) - token.value = '' // 清除 token + codeToken.value = '' // 清除 token router.replace('/collectCode/login') } diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index 3164524..86c38dc 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -31,7 +31,7 @@ const subTitle = computed(() => { return route.meta.subTitle ? t(route.meta.subTitle) : '' }) const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name)) -console.log('route.name',route.name) +