feat:增加动态获取协议(http/https)

This commit is contained in:
wyx
2023-02-03 17:19:14 +08:00
parent 7c194b2308
commit 160670c540
11 changed files with 43 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
export const BASE = 'https://u-pre.boe.com'
export const BASE = window.location.protocol + '//u-pre.boe.com'
export const GET_USER_LIST = `/userbasic/user/list post`
export const GET_USER_INFO = `/userbasic/user/info post`

View File

@@ -98,7 +98,7 @@ export async function request(_url, params) {
}).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {
if (response.code === 1000) {
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(import.meta.env.VITE_BASE_LOGIN_URL, '_top')
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({path: '/login'}) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL, '_top')
}
if (response.code === 2001) {
router.push({path: '/FaceTeachSignUp', query: {courseId: router.currentRoute.value.query.courseId,type:3}})