Quellcode durchsuchen

Merge branch '2023-9-6'

liushengqiang vor 1 Jahr
Ursprung
Commit
af91a2a8b3
1 geänderte Dateien mit 29 neuen und 1 gelöschten Zeilen
  1. 29 1
      src/pc/home/index.tsx

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

@@ -1539,6 +1539,13 @@ export default defineComponent({
 				}
 			}
 			data.loading = false;
+			// 重新登录
+			if (res.code === 5000) {
+				window.location.href = `${
+					/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
+				}/classroom`;
+				return;
+			}
 			return res;
 		};
 		const setSaveLoading = (tips: boolean) => {
@@ -1558,7 +1565,7 @@ export default defineComponent({
 			console.log("🚀 ~ pngUrl:", pngUrl);
 			try {
 				if (query.id) {
-					await api_musicSheetCreationUpdate({
+					const res = await api_musicSheetCreationUpdate({
 						name: data.musicName || "未命名乐谱",
 						creator: data.creator || "未命名乐谱",
 						creationConfig: renderMeasures(abcData.abc, {
@@ -1572,6 +1579,13 @@ export default defineComponent({
 						filePath: wavUrl,
 						coverImg: pngUrl,
 					});
+					// 重新登录
+					if (res.code === 5000) {
+						window.location.href = `${
+							/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
+						}/classroom`;
+						return;
+					}
 				} else {
 					const res = await api_musicSheetCreationSave({
 						name: data.musicName || "未命名乐谱",
@@ -1597,6 +1611,13 @@ export default defineComponent({
 						}
 						location.hash = hash[0] + "?" + qs.stringify(qs_data);
 					}
+					// 重新登录
+					if (res.code === 5000) {
+						window.location.href = `${
+							/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
+						}/classroom`;
+						return;
+					}
 				}
 			} catch (error) {
 				console.log(error);
@@ -1957,6 +1978,13 @@ export default defineComponent({
 					message.info("已是最新版本");
 				}
 			}
+			// 重新登录
+			if (res.code === 5000) {
+				window.location.href = `${
+					/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
+				}/classroom`;
+				return;
+			}
 		};
 
 		return () => (