lsc hace 5 meses
padre
commit
ebcf320c68

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/css/app.dddbeb50.css


+ 1 - 1
dist/index.html

@@ -36,7 +36,7 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.fba309d8.js"></script><script defer="defer" src="/js/app.9228b484.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.1cd592ac.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.fba309d8.js"></script><script defer="defer" src="/js/app.773c87fc.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.dddbeb50.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) {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/js/app.773c87fc.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/js/app.773c87fc.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/js/app.9228b484.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/js/app.9228b484.js.map


+ 41 - 20
src/views/login/loginPage.vue

@@ -323,33 +323,54 @@ export default {
 				}, 0);
 			},0);
 		},
-		async getOpenId(code) {
-			if (this.oloading) return;
-
-			this.oloading = true;
-
-			try {
-				const res = await axios.get(`//weixin.cocorobo.cn/login.php?code=${code}&time=${Date.now()}`); // 将params作为请求参数,并禁用预加载
-				const data = res.data[0];
-				console.log("data", data);
-				// this.loginType = 'bind';
-			} catch (err) {
-				console.error("请求失败,错误信息:", err);
-			} finally {
-				this.oloading = false;
+		async getOpenId(openid) {
+
+			// oiztX1dwR-W2mBJ5HcvaSEB8yKGY
+			axios.defaults.withCredentials = false;
+			let params = {
+				openid: openid
 			}
+			axios.defaults.withCredentials = true;
+			axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(async res => {
+				console.log("res", res);
+				let _data = res.data[0][0];
+				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)
+				if (err && err.response && err.response.status === 401) {
+					this.loginType = 'bind';
+				}
+			})
+
+				// 
+
 		},
 	},
 	mounted() {
 		let _this = this
 		window.addEventListener('message', function (e) { // 监听 message 事件
 				console.log(e);
-				if(e.data && e.data.code){
-				console.log(e);
-				console.log(e.data.code);
-				console.log(_this.loginType);
-				_this.getOpenId(e.data.code)
-			}
+				if(e.data && e.data.method == "getOpenId"){
+					console.log(e);
+					console.log(e.data.code);
+					console.log(_this.loginType);
+					
+					if(e.data.code == 200){
+						_this.getOpenId(e.data.data.openid)
+					}else {
+						_this.$message.error('扫码登录失败请重新扫码')
+						_this.wechatLogin()
+					}
+
+				}
 		});
 		// this.getLoading();
 		this.getOrdOidData();

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio