Browse Source

更新组件

lex 2 years ago
parent
commit
e3aea60f9a
2 changed files with 9 additions and 9 deletions
  1. 6 8
      src/helpers/utils.ts
  2. 3 1
      src/views/login/components/qr-login/index.tsx

+ 6 - 8
src/helpers/utils.ts

@@ -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}`
 }

+ 3 - 1
src/views/login/components/qr-login/index.tsx

@@ -47,7 +47,9 @@ export default defineComponent({
       } else {
         await this.getCode()
       }
-      this.qrCode = `${getBaseUrl()}/#/scanLogin?code=${this.scanCode}`
+      this.qrCode = `${getBaseUrl('/student')}/#/scanLogin?code=${
+        this.scanCode
+      }`
       state.loginPopupTimer = setInterval(async () => {
         await this.getList()
       }, 5000)