Ver código fonte

Merge branch '2023-9-6'

liushengqiang 1 ano atrás
pai
commit
529e82c243
1 arquivos alterados com 17 adições e 0 exclusões
  1. 17 0
      src/pc/create/index.tsx

+ 17 - 0
src/pc/create/index.tsx

@@ -10,6 +10,7 @@ import ABCJS from "abcjs";
 import { usePageVisibility } from "@vant/use";
 import UploadToResources from "../component/upload-to-resources";
 import { getQuery } from "/src/utils/queryString";
+import { browser } from "/src/utils";
 
 export default defineComponent({
 	name: "Create",
@@ -43,6 +44,22 @@ export default defineComponent({
 				data.list = data.list.concat(res.data.rows);
 				data.finish = res.data.rows.length < forms.rows;
 			}
+			// 重新登录
+			if (res.code === 5000) {
+				const browserInfo = browser();
+				if (browserInfo.isApp) {
+					postMessage({ api: "login" });
+				} else {
+					// 判断是否在应用中
+					window.parent.postMessage(
+					{
+						api: "onLogin",
+					},
+					"*"
+					);
+				}
+				return;
+			}
 			data.loading = false;
 		};
 		const handleReset = () => {