lex 1 year ago
parent
commit
a4291eb9e8

BIN
dist/assets/FiraCode-Regular-f13d1ece.woff2


BIN
dist/assets/LatoLatin-Regular-ddd4ef7f.woff2


BIN
dist/assets/LatoLatin-Semibold-267eef30.woff2


BIN
dist/assets/icon_27_0-1a34c85d.png


BIN
dist/assets/icon_27_1-f9a5b1c0.png


BIN
dist/assets/icon_27_2-f7c74866.png


BIN
dist/assets/icon_27_3-10612b9d.png


BIN
dist/assets/icon_27_4-acce030b.png


BIN
dist/assets/icon_staff-55f546a9.png


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-4b06553f.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-7267f7b6.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-legacy-abe1f6e1.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/polyfills-legacy-a19b005e.js


+ 0 - 43
dist/index.html

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="ZH-cn">
-
-<head>
-  <meta charset="UTF-8">
-  <link rel="icon" href="./favicon.ico" />
-  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
-  <meta http-equiv="Cache-control" content="no-cache, must-revalidate">
-  <meta http-equiv="Cache" content="no-cache">
-  <meta http-equiv="pragma" CONTENT="no-cache">
-  <meta http-equiv="expires" CONTENT="0">
-  <title>制谱</title>
-  <script>
-    window.addEventListener('error', function (event) {
-      if (event.target.tagName === 'SCRIPT' && event.target.src.indexOf('assets/index') > -1) {
-        var total = sessionStorage.getItem('SCRIPT_ERROR')
-        total = Number(total) || 0
-        total = total + 1
-        sessionStorage.setItem('SCRIPT_ERROR', total)
-        if (total > 3) return;
-        window.location.reload()
-      }
-    }, true)
-  </script>
-  <script src="//at.alicdn.com/t/c/font_4186350_idu6dqxtfd.js"></script>
-  <script src="./flexible.js"></script>
-  <script src="./abc2svg/xml2abc.js"></script>
-  <script src="./abc2svg/jquery-1.11.1.min.js"></script>
-  <script type="module" crossorigin src="./assets/index-4b06553f.js"></script>
-  <link rel="stylesheet" href="./assets/index-7267f7b6.css">
-  <script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
-  <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
-</head>
-
-<body>
-  <div id="app"></div>
-  
-  <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
-  <script nomodule crossorigin id="vite-legacy-polyfill" src="./assets/polyfills-legacy-a19b005e.js"></script>
-  <script nomodule crossorigin id="vite-legacy-entry" data-src="./assets/index-legacy-abe1f6e1.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
-</body>
-
-</html>

+ 62 - 64
src/utils/request.ts

@@ -10,76 +10,74 @@ const apiRouter = whiteUrl();
 const browserInfo = browser();
 
 const request = extend({
-	requestType: "form",
-	timeout: 10000,
+  requestType: "form",
+  timeout: 30000,
 });
 
 request.interceptors.request.use(
-	(url, options) => {
-		const _prefix = storeData.proxy + storeData.platformApi;
-		// 只有后台才去设置
-		if (storeData.platformType === "WEB" && (apiRouter as any)[url]) {
-			url = (apiRouter as any)[url];
-		}
-		const Authorization = getToken();
-		const authHeaders: any = {};
-		if (Authorization) {
-			authHeaders.Authorization = Authorization;
-		}
-		return {
-			url: _prefix + url,
-			options: {
-				...options,
-				params: options.params,
-				data: options.data,
-				headers: {
-					...options.headers,
-					...authHeaders,
-				},
-			},
-		};
-	},
-	{ global: false }
+  (url, options) => {
+    const _prefix = storeData.proxy + storeData.platformApi;
+    // 只有后台才去设置
+    if (storeData.platformType === "WEB" && (apiRouter as any)[url]) {
+      url = (apiRouter as any)[url];
+    }
+    const Authorization = getToken();
+    const authHeaders: any = {};
+    if (Authorization) {
+      authHeaders.Authorization = Authorization;
+    }
+    return {
+      url: _prefix + url,
+      options: {
+        ...options,
+        params: options.params,
+        data: options.data,
+        headers: {
+          ...options.headers,
+          ...authHeaders,
+        },
+      },
+    };
+  },
+  { global: false }
 );
 
 request.interceptors.response.use(
-	async (res, options) => {
-		console.log(options)
-		if (res.status > 299 || res.status < 200) {
-			const msg = res.statusText + ", 状态码" + res.status;
-			showToast(msg);
-			throw new Error(msg);
-		}
-		const data = await res.clone().json();
-		if (data.code === 5000) {
-			// 判断是否在应用中
-			window.parent.postMessage(
-			{
-				api: "onLogin",
-			},
-			"*"
-			);
-			setTimeout(() => {
-				window.location.href = `${
-					/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin
-				}/classroom`;
-			}, 500)
-			return;
-		}
-		if (data.code !== 200 && data.errCode !== 0) {
-			const msg = data.msg || data.message || "处理失败,请重试";
-			if (data.code === 5000){
-				return data
-			}
-			if (!(data.code === 403 || data.code === 401)) {
-				showToast(msg);
-			}
-			throw new Error(msg);
-		}
-		
-		return data;
-	},
-	{ global: false }
+  async (res, options) => {
+    console.log(options);
+    if (res.status > 299 || res.status < 200) {
+      const msg = res.statusText + ", 状态码" + res.status;
+      showToast(msg);
+      throw new Error(msg);
+    }
+    const data = await res.clone().json();
+    if (data.code === 5000) {
+      // 判断是否在应用中
+      window.parent.postMessage(
+        {
+          api: "onLogin",
+        },
+        "*"
+      );
+      setTimeout(() => {
+        window.location.href = `${/(192|localhost)/.test(location.origin) ? "https://test.lexiaoya.cn" : location.origin}/classroom`;
+      }, 500);
+      return;
+    }
+    if (data.code !== 200 && data.errCode !== 0) {
+      const msg = data.msg || data.message || "处理失败,请重试";
+      if (data.code === 5000) {
+        return data;
+      }
+      if (!(data.code === 403 || data.code === 401)) {
+        showToast(msg);
+      }
+      throw new Error(msg);
+    }
+
+    return data;
+  },
+  { global: false }
 );
 
 export default request;

Some files were not shown because too many files changed in this diff