浏览代码

refactor:手动登录

zhanghui 2 年之前
父节点
当前提交
9dad8be210
共有 5 个文件被更改,包括 37 次插入37 次删除
  1. 24 24
      App.vue
  2. 2 2
      common/js/env.js
  3. 2 2
      main.js
  4. 7 7
      pages.json
  5. 2 2
      pages/login/login.vue

+ 24 - 24
App.vue

@@ -6,30 +6,30 @@
 	export default {
 		onLaunch: function() {
             let that = this;
-            wx.login({
-                success(re) {
-                    that.$api.wxAuthLogin({code:re.code}).then(res=>{
-                        uni.setStorageSync('userInfo',res.data.data.userInfo)
-                        uni.setStorageSync('accessToken',res.data.data.access_token)
-                        uni.setStorageSync('phoneIsBind',res.data.data.phoneIsBind)
-
-                        if (res.data.data.phoneIsBind){
-                            uni.switchTab({
-                                url: '/pages/index/index',
-                            })
-                            // uni.navigateTo({
-                            //     url: '/loginPages/bindAccount/index',
-                            // })
-                        }else {
-                            uni.navigateTo({
-                                url: '/pages/login/login',
-                            })
-                        }
-
-                    })
-
-                },
-            })
+            // wx.login({
+            //     success(re) {
+            //         that.$api.wxAuthLogin({code:re.code}).then(res=>{
+            //             uni.setStorageSync('userInfo',res.data.data.userInfo)
+            //             uni.setStorageSync('accessToken',res.data.data.access_token)
+            //             uni.setStorageSync('phoneIsBind',res.data.data.phoneIsBind)
+            //
+            //             if (res.data.data.phoneIsBind){
+            //                 uni.switchTab({
+            //                     url: '/pages/index/index',
+            //                 })
+            //                 // uni.navigateTo({
+            //                 //     url: '/loginPages/bindAccount/index',
+            //                 // })
+            //             }else {
+            //                 uni.navigateTo({
+            //                     url: '/pages/login/login',
+            //                 })
+            //             }
+            //
+            //         })
+            //
+            //     },
+            // })
 			console.log('App Launch')
 		},
 		onShow: function() {

+ 2 - 2
common/js/env.js

@@ -1,8 +1,8 @@
 "use strict";
 
-// let baseUrl = `https://jje.admin.xinyuekj.com.cn`
+let baseUrl = `https://jje.admin.xinyuekj.com.cn`
 // let baseUrl = `http://127.0.0.1:9000`
-let baseUrl = `http://192.168.1.150:8080`
+// let baseUrl = `http://192.168.1.150:8080`
 
 // 变量可自行添加修改
 export default { //存放变量的容器

+ 2 - 2
main.js

@@ -9,8 +9,8 @@ import api from './common/js/api'
 console.log(`process`, process.envenv)
 
 import uView from "uview-ui";
-// const baseUrl = 'https://jje.admin.xinyuekj.com.cn';
-const baseUrl = 'http://192.168.1.150:8080';
+const baseUrl = 'https://jje.admin.xinyuekj.com.cn';
+// const baseUrl = 'http://192.168.1.150:8080';
 Vue.use(uView);
 Vue.config.productionTip = false
 Vue.prototype.$baseUrl = baseUrl;

+ 7 - 7
pages.json

@@ -3,7 +3,13 @@
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [
-
+		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -38,12 +44,6 @@
 				"navigationStyle": "custom",
 				"enablePullDownRefresh": false
 			}
-		},{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
 		}
 	],
 	"subPackages": [

+ 2 - 2
pages/login/login.vue

@@ -14,7 +14,7 @@
               微信授权手机号登录
             </button> -->
 
-			<button class="login-btn" @click="authWechatCodeLogin()">
+			<button class="login-btn" @click="wechatCodeLogin()">
 				<u-icon name="weixin-fill" color="green" size="26"></u-icon>
 				授权微信登录
 			</button>
@@ -106,7 +106,7 @@
 			};
 		},
 		onLoad() {
-			this.wechatCodeLogin();
+			// this.wechatCodeLogin();
 		},
 		methods: {
 			// 去协议页面