瀏覽代碼

完善第三方登录路径问题

shaogen1995 1 月之前
父節點
當前提交
f081f7ac15

+ 1 - 1
后台大场景编辑/public/index.html

@@ -11,7 +11,7 @@
     <script>
       // 甲方服务器域名
       // const backUrl = 'http://192.168.20.55:3000'
-      const backUrl = 'https://sit-beirenbigscene.4dage.com/'
+      const backUrl = 'https://sit-beirenbigscene.4dage.com/backstage'
     </script>
 
     <title>北人亦创国际会展中心-场景编辑后台</title>

+ 2 - 1
后台大场景编辑/src/pages/Login/index.tsx

@@ -5,6 +5,7 @@ import { API_login, isTokenFlagAPI } from '@/store/action/A1List'
 import { MessageFu } from '@/utils/message'
 import { setTokenInfo } from '@/utils/storage'
 import history from '@/utils/history'
+import { isLocal } from '@/utils/http'
 function Login() {
   const loginFu = useCallback(() => {
     window.location.href = `https://dev.itfinspread.com:8003/#/sso?redirectUrl=${backUrl}`
@@ -21,7 +22,7 @@ function Login() {
           MessageFu.success('登录成功')
           // 用户信息存到本地
           setTokenInfo(res.data)
-          window.location.href = '/#/list'
+          window.location.href = `${isLocal ? '' : '/backstage'}/#/list`
         } else {
           MessageFu.warning('token为空')
           setCode('')

+ 5 - 2
后台大场景编辑/src/utils/http.ts

@@ -4,11 +4,14 @@ import { getTokenInfo, removeTokenInfo } from './storage'
 import store from '@/store'
 import { MessageFu } from './message'
 import { domShowFu } from './domShow'
+
+export const isLocal = process.env.NODE_ENV === 'development'
+
 // 请求基地址
 export const baseURL =
   // 线下的图片地址需要加上/api/
-  // process.env.NODE_ENV === 'development' ? 'http://192.168.20.61:8102/api/' : ''
-  process.env.NODE_ENV === 'development' ? 'https://sit-beirenbigscene.4dage.com' : ''
+  // isLocal ? 'http://192.168.20.61:8102/api/' : ''
+  isLocal ? 'https://sit-beirenbigscene.4dage.com' : ''
 
 // 处理  类型“AxiosResponse<any, any>”上不存在属性“code”
 declare module 'axios' {