liushengqiang 1 рік тому
батько
коміт
9907cabe73
3 змінених файлів з 4 додано та 6 видалено
  1. 0 4
      src/pc/App.tsx
  2. 3 1
      src/pc/home/index.tsx
  3. 1 1
      src/utils/queryString.ts

+ 0 - 4
src/pc/App.tsx

@@ -40,20 +40,16 @@ export default defineComponent({
 		};
 		const setUser = async () => {
 			const res = await getUserInfo();
-			console.log("🚀 ~ res:", res);
 			// 重新登录
 			if (res.code === 5000) {
 				const browserInfo = browser();
-				const data = res.data;
 				showToast(res.message);
 				if (browserInfo.isApp) {
 					postMessage({ api: "login" });
 				} else {
-					// storeData.status = "error";
 					window.location.href = `${
 						/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
 					}/classroom`;
-					throw new Error(data.message);
 				}
 				return;
 			}

+ 3 - 1
src/pc/home/index.tsx

@@ -52,6 +52,7 @@ import instrumentsNames from "/src/constant/instrmentsNames.json";
 import { ALL_NOTES, NOTE_DOT } from "./noteData";
 import { Close } from "@vicons/ionicons5";
 import { UseDraggable } from "@vueuse/components";
+import { getQuery } from "/src/utils/queryString";
 
 const allPitches = [
 	"C,,,,",
@@ -1104,7 +1105,8 @@ export default defineComponent({
 			}));
 		});
 		const getDetailData = async () => {
-			const res = await api_musicSheetCreationDetail(route.query.id);
+			const query: any = getQuery();
+			const res = await api_musicSheetCreationDetail(query.id);
 			if (res?.code == 200) {
 				data.musicId = res.data.id || "";
 				data.musicName = res.data.name || "";

+ 1 - 1
src/utils/queryString.ts

@@ -7,7 +7,7 @@ export const getQuery = () => {
             ...qs.parse(location.hash.split('?')[1]),
         }
     } catch (error) {
-        
+        console.log("解析query错误:", error)
     }
     return {
         ...search,