|
@@ -31,7 +31,7 @@ |
|
|
<l-input v-if="ready" v-model="password" placeholder="请输入身份证后八位" password left> |
|
|
<l-input v-if="ready" v-model="password" placeholder="请输入身份证后八位" password left> |
|
|
<l-icon slot="title" type="lock" /> |
|
|
<l-icon slot="title" type="lock" /> |
|
|
</l-input> |
|
|
</l-input> |
|
|
<l-button @click="loginClick(null)" size="lg" color="blue" class="margin-top-sm block" block>确 认</l-button> |
|
|
|
|
|
|
|
|
<l-button v-if="ready" @click="loginClick(null)" size="lg" color="blue" class="margin-top-sm block" block>确 认</l-button> |
|
|
<view class="otherLogin"> |
|
|
<view class="otherLogin"> |
|
|
<navigator url="/pages/login" class="textBtn">常规登陆</text></navigator> |
|
|
<navigator url="/pages/login" class="textBtn">常规登陆</text></navigator> |
|
|
</view> |
|
|
</view> |
|
@@ -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() |
|
|
await this.init() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@@ -108,6 +110,17 @@ export default { |
|
|
// this.ready = true |
|
|
// this.ready = true |
|
|
this.loginInit() |
|
|
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() { |
|
|
signUp() { |
|
@@ -117,8 +130,9 @@ export default { |
|
|
loginInit(){ |
|
|
loginInit(){ |
|
|
if (this.code) { |
|
|
if (this.code) { |
|
|
this.LOADING("加载中...") |
|
|
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() |
|
|
this.HIDE_LOADING() |
|
|
|
|
|
return |
|
|
if(!success){ |
|
|
if(!success){ |
|
|
location.href = "http://" + window.location.host; |
|
|
location.href = "http://" + window.location.host; |
|
|
return |
|
|
return |
|
@@ -129,6 +143,7 @@ export default { |
|
|
token: success.baseinfo.token, |
|
|
token: success.baseinfo.token, |
|
|
date: moment().format('yyyy-MM-dd hh:mm:ss') |
|
|
date: moment().format('yyyy-MM-dd hh:mm:ss') |
|
|
}; |
|
|
}; |
|
|
|
|
|
this.ready = true |
|
|
this.SET_STORAGE("token",success.baseinfo.token) |
|
|
this.SET_STORAGE("token",success.baseinfo.token) |
|
|
// this.SET_STORAGE("logininfo",logininfo) |
|
|
// this.SET_STORAGE("logininfo",logininfo) |
|
|
// this.SET_STORAGE("userinfo",success) |
|
|
// this.SET_STORAGE("userinfo",success) |
|
|