diff --git a/src/utils/loginUtil/config.ts b/src/utils/loginUtil/config.ts index 98eafcca417d63a7732847f3cc5b01772313ae08..4491ffa87fb36d3ed8764800b06d0e9fc3cc02b5 100644 --- a/src/utils/loginUtil/config.ts +++ b/src/utils/loginUtil/config.ts @@ -1,6 +1,6 @@ import { LOGIN_URL } from '../variables'; -export const INDEX_ROUTE = '/cgtf/home'; //登录成功后的重定向路由 +export const INDEX_ROUTE = '/cd-comprehensive/home/urbanSituation'; //登录成功后的重定向路由 export const CLIENT_ID = 'xindumange'; export const CLIENT_SECRET = 'xindu@2024'; export const LOGIN_SERVE = LOGIN_URL; // 测试环境:http://171.217.92.33:21603 diff --git a/src/utils/request.tsx b/src/utils/request.tsx index aca6d9f777621178e4148a3b2e5294ab2020b52a..de531d0c70681c133495806128a0556e59893b88 100644 --- a/src/utils/request.tsx +++ b/src/utils/request.tsx @@ -3,6 +3,7 @@ import type { RequestConfig } from '@umijs/max'; import { getCookie } from './cookie'; import { getOauthTokenInfo } from './loginUtil'; import { clearSession } from './loginUtil/session'; +import { getSession } from './session'; export const codeMessage: Record = { 200: '服务器成功返回请求的数据。', @@ -29,7 +30,7 @@ export const requestInterceptors: RequestConfig['requestInterceptors'] = [ // 直接写一个 function,作为拦截器 (url, options) => { const headers = { - Authorization: 'bearer ' + getCookie('token'), + Authorization: 'bearer ' + getSession('token'), ...options.headers, }; diff --git a/src/utils/variables.ts b/src/utils/variables.ts index 819b1d18031e117ae18b86762c53c7d8dc44ad1e..f42bf60c035cadc883b2880a0f2fa6e95bcdb82c 100644 --- a/src/utils/variables.ts +++ b/src/utils/variables.ts @@ -7,4 +7,4 @@ console.log(process.env.NODE_ENV); export const IMG_URL = IS_PROD ? 'FILE_IMG_URL' : 'https://xct.cdhncy.cn/file'; //登录统一地址 -export const LOGIN_URL = IS_PROD ? 'LOGIN_URL' : 'http://171.217.92.33:21602'; +export const LOGIN_URL = IS_PROD ? 'LOGIN_URL' : 'http://171.217.92.33:21603';