|
@@ -36,7 +36,6 @@ export const getRandomKey = () => {
|
|
|
* 设置用户信息
|
|
|
*/
|
|
|
export const setUserInfo = (userInfo: any) => {
|
|
|
-
|
|
|
Cookies.set('userInfo', userInfo, { expires: 7 })
|
|
|
}
|
|
|
/**
|
|
@@ -127,28 +126,27 @@ export const dateFormat = (
|
|
|
return dayjs(value).format(format)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
export function vaildTeachingUrl() {
|
|
|
let url = window.location.href
|
|
|
let returnUrl = ''
|
|
|
if (/online/.test(url)) {
|
|
|
//线上
|
|
|
- returnUrl = '//dev.colexiu.com'
|
|
|
+ returnUrl = 'https://dev.colexiu.com'
|
|
|
} else if (/dev/.test(url)) {
|
|
|
// dev 环境
|
|
|
- returnUrl = '//dev.colexiu.com'
|
|
|
+ returnUrl = 'https://dev.colexiu.com'
|
|
|
} else if (/test/.test(url)) {
|
|
|
// dev 环境
|
|
|
- returnUrl = '//dev.colexiu.com'
|
|
|
+ returnUrl = 'https://dev.colexiu.com'
|
|
|
} else {
|
|
|
// 默认dev环境
|
|
|
- returnUrl = '//dev.colexiu.com'
|
|
|
+ returnUrl = 'https://dev.colexiu.com'
|
|
|
}
|
|
|
return returnUrl
|
|
|
}
|
|
|
// 获取当前连接
|
|
|
-export const getBaseUrl = () => {
|
|
|
+export const getBaseUrl = (platform?: string) => {
|
|
|
const url = window.location.origin
|
|
|
- const pathname = window.location.pathname
|
|
|
+ const pathname = platform || window.location.pathname
|
|
|
return `${url}${pathname}`
|
|
|
}
|