diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue index 55e9bb57a..e8e26ff44 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue @@ -10,7 +10,7 @@ // H5 刷新时获取当前页面路径 const pagePath = "/" + param.path; // 如果 H5 刷新后访问的不是首页/登录页/注册页,直接跳转回首页 - if (!["/pages/login", "/pages/home", "/pages/signup"].includes(pagePath)) { + if (!["/pages/login", "/pages/weixinLogin","/pages/home", "/pages/signup"].includes(pagePath)) { this.$nextTick(() => { this.TAB_TO("/pages/home"); return; diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/weixinLogin.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/weixinLogin.vue index 924100876..de5b9bae9 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/weixinLogin.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/weixinLogin.vue @@ -31,7 +31,7 @@ - 确 认 + 确 认 常规登陆 @@ -86,8 +86,10 @@ export default { } }, - async onLoad({code}) { - this.code = code + async onLoad() { + if(this.getHashSearchParam("code")){ + this.code = this.getHashSearchParam("code") + } await this.init() }, @@ -108,6 +110,17 @@ export default { // this.ready = true this.loginInit() }, + getHashSearchParam(key) { + let search = location.search + let array = [] + if(search){ + search = search.substring(1) + array = search.split("&") + let res = array.find((item)=>item.split("=")[0] == key) + return res.split("=")[1] + } + return '' + }, // 点击新用户注册 signUp() { @@ -117,8 +130,9 @@ export default { loginInit(){ if (this.code) { this.LOADING("加载中...") - this.HTTP_POST("weixinapi/getweixinaccess_token?code="+this.code).then(success=>{ + this.HTTP_POST("weixinapi/getweixinaccess_token?code="+this.code,null).then(success=>{ this.HIDE_LOADING() + return if(!success){ location.href = "http://" + window.location.host; return @@ -129,6 +143,7 @@ export default { token: success.baseinfo.token, date: moment().format('yyyy-MM-dd hh:mm:ss') }; + this.ready = true this.SET_STORAGE("token",success.baseinfo.token) // this.SET_STORAGE("logininfo",logininfo) // this.SET_STORAGE("userinfo",success)