Browse Source

no message

USER-20230908AJ\Administrator 1 năm trước cách đây
mục cha
commit
c6179bb180
4 tập tin đã thay đổi với 28 bổ sung19 xóa
  1. 2 3
      .env.js
  2. 5 1
      pages/login/index.vue
  3. 13 12
      service/router.js
  4. 8 3
      service/tools.js

+ 2 - 3
.env.js

@@ -4,12 +4,11 @@ let version = __wxConfig.envVersion;
 if (__wxConfig.envVersion === 'release') {
 
     //生产环境
-    ENV_CONFIG = require('.env.trial.js');
+    ENV_CONFIG = require('.env.prod.js');
     ENV_CONFIG.isCanvas2d = true
 }  else {
-
     //开发环境
-    ENV_CONFIG = require('.env.trial.js');
+    ENV_CONFIG = require('.env.prod.js');
     ENV_CONFIG.isCanvas2d = false
 }
 //#endif

+ 5 - 1
pages/login/index.vue

@@ -144,7 +144,11 @@
 									});
 								}, 1500)
 							} else if (res.code === 1) {
-								tools.setLoginData(res.data, true)
+                if (res.data.status * 1 === 0){
+                  tools.error('信息正在审核...')
+                }else {
+                  tools.setLoginData(res.data, true)
+                }
 							} else {
 								tools.error(res.msg)
 							}

+ 13 - 12
service/router.js

@@ -42,18 +42,19 @@ router.beforeEach(async (to, from, next) => {
 
     if(whiteList.indexOf(to.path)<0 && !userToken){
         console.log('----------------------')
-       await tools.weiXinLogin().then(isLogin=>{
-           console.log('-----------isLogin-----------')
-           if(isLogin===-1){
-               next('/pages/login/register');
-           }else if(isLogin){
-               next();
-           }else {
-               next('/pages/login/index');
-           }
-       }).catch(e=>{
-           next('/pages/login/index');
-       })
+       // await tools.weiXinLogin().then(isLogin=>{
+       //     console.log('-----------isLogin-----------')
+       //     if(isLogin===-1){
+       //         next('/pages/login/register');
+       //     }else if(isLogin){
+       //         next();
+       //     }else {
+       //         next('/pages/login/index');
+       //     }
+       // }).catch(e=>{
+       //     next('/pages/login/index');
+       // })
+        next('/pages/login/index');
 
         // next();
     }else {

+ 8 - 3
service/tools.js

@@ -233,7 +233,7 @@ tools.setLoginData = function(data, type) {
 			if (data.status * 1 === 0) {
 				//审核状态跳转至待审核页面
 				uni.reLaunch({
-					url: '/pages/login/module/await-audit'
+					url: '/pages/login/await-audit'
 				});
 			} else {
 				let excelPath = uni.getStorageSync('excelPath');
@@ -521,8 +521,13 @@ tools.weiXinLogin=async function () {
 						tools.error('当前用户未注册')
 						resolve( -1)
 					} else if (res.code === 1) {
-						tools.setLoginData(res.data, false)
-						resolve( true)
+						if(res.data.status===0){
+							tools.setLoginData(res.data, false)
+							resolve( true)
+						}else {
+							tools.error('信息正在审核...')
+							resolve( false)
+						}
 					} else {
 						resolve( false)
 					}