소스 검색

修改获取参数方式

lex 11 달 전
부모
커밋
ce782ce03c
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      src/main.ts

+ 4 - 3
src/main.ts

@@ -14,9 +14,10 @@ import useErrorLog from './hooks/useErrorLog';
 async function setupApp() {
   // 处理token
   const authLoadNum = sessionStorage.getItem('authLoadNum');
-
-  if (location.search && authLoadNum !== '1') {
-    const parse = location.search.substring(1, location.search.length);
+  const search = location.href.split('??');
+  if (search[1] && authLoadNum !== '1') {
+    const parse = search[1];
+    console.log(parse, 'parse');
     const result = parseQuery(parse);
     if (result.Authorization) {
       const ex = 7 * 24 * 60 * 60 * 1000;