SanHQin 3 月之前
父節點
當前提交
d290ae98a9

文件差異過大導致無法顯示
+ 0 - 0
dist/css/app.4fb416ff.css


+ 1 - 1
dist/index.html

@@ -36,7 +36,7 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.1e67db9e.js"></script><script defer="defer" src="/js/app.422176f8.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.9fb67e7e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but pblAdminTable doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html><script>function stopSafari() {
+      }</style><script defer="defer" src="/js/chunk-vendors.1e67db9e.js"></script><script defer="defer" src="/js/app.084f1566.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.4fb416ff.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but pblAdminTable doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.084f1566.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.084f1566.js.map


文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.422176f8.js


文件差異過大導致無法顯示
+ 0 - 0
dist/js/app.422176f8.js.map


+ 47 - 52
src/views/login/loginPage.vue

@@ -323,29 +323,32 @@ export default {
 		},
 		// 输入账号获取组织
 		getOrgData() {
-			let params = [
-				{
-					functionName: API_CONFIG.ajax_liYuanOrg.functionName,
-					uname: this.account,
-				},
-			];
-			this.$ajax
-				.post(API_CONFIG.baseUrl, params)
-				.then((res) => {
-					console.log("res", res);
-					this.org = "";
-					this.OrgOptions = "";
+			return new Promise((resolve) => {
+				let params = [
+					{
+						functionName: API_CONFIG.ajax_liYuanOrg.functionName,
+						uname: this.account,
+					},
+				];
+				this.$ajax
+					.post(API_CONFIG.baseUrl, params)
+					.then((res) => {
+						console.log("res", res);
+						this.org = "";
+						this.OrgOptions = "";
 
-					this.OrgOptions = res.data[0];
-					if (this.OrgOptions.length == 1) {
-						this.org = this.OrgOptions[0].Uorg;
-						this.$forceUpdate();
-					}
-				})
-				.catch((err) => {
-					console.log(err);
-					this.$message.error("获取组织失败");
-				});
+						this.OrgOptions = res.data[0];
+						if (this.OrgOptions.length == 1) {
+							this.org = this.OrgOptions[0].Uorg;
+							this.$forceUpdate();
+						}
+						resolve();
+					})
+					.catch((err) => {
+						console.log(err);
+						this.$message.error("获取组织失败");
+					});
+			});
 		},
 		//获取组织或学校的数据
 		getOrdOidData() {
@@ -407,36 +410,28 @@ export default {
 				.then(async (res) => {
 					console.log("res", res);
 					let _data = res.data[0][0];
-					axios.defaults.withCredentials = false;
-					this.$ajax
-						.get("https://pbl.cocorobo.cn/api/pbl/selectUser/selectUser", {
-							userid: _data.userid,
-						})
-						.then(async (res2) => {
-							console.log("👈", res2);
-							let _uorg = res2.data[0][0].org;
-							if (this.allowOrgList.find((i) => i.id == this.org2)) {
-								let _list = this.allowOrgList.find(
-									(i) => i.id == this.org2
-								).list;
-								if (!_list.includes(_uorg)) {
-									this.wechatLogin();
-									console.log("不允许登录");
-									return this.$message.error("该组织/学校不允许登录");
-								}
-							}
-							if (_data.active === 1) {
-								window.localStorage["identity"] = JSON.stringify(
-									_data.identity
-								);
-								this.$message.success("登录成功");
-								await this.login();
-								this.$router.push({ path: this.redirect || "/" });
-							} else {
-								this.$message.error("登录失败");
-							}
-							this.loading = false;
-						});
+					// let userData = await this.ajax.get("https://pbl.cocorobo.cn/api/pbl/selectUser/selectUser", { userid: _data.userid });
+					// let _uorg = userData.data[0][0].org;
+					this.account = _data.username;
+					await this.getOrgData();
+
+					if (this.allowOrgList.find((i) => i.id == this.org2)) {
+						let _list = this.allowOrgList.find((i) => i.id == this.org2).list;
+						let _nowOrgId = this.OrgOptions.find((i) => i.Uorg == this.org).id;
+						if (!_list.includes(_nowOrgId)) {
+							this.wechatLogin();
+							return this.$message.error("该组织/学校不允许登录");
+						}
+					}
+					if (_data.active === 1) {
+						window.localStorage["identity"] = JSON.stringify(_data.identity);
+						this.$message.success("登录成功");
+						await this.login();
+						this.$router.push({ path: this.redirect || "/" });
+					} else {
+						this.$message.error("登录失败");
+					}
+					this.loading = false;
 				})
 				.catch((err) => {
 					console.log(err.response);

部分文件因文件數量過多而無法顯示