|
@@ -91,9 +91,16 @@ export default {
|
|
|
//信息完善,直接进入页面
|
|
|
uni.setStorageSync('user_account', res.data.data.user_account);
|
|
|
uni.setStorageSync('token', res.data.data.token);
|
|
|
- uni.switchTab({
|
|
|
- url:'/pages/index/index'
|
|
|
- })
|
|
|
+ that.$api.getInfo().then(resdata => {
|
|
|
+ if(resdata.data.code == 200){
|
|
|
+ uni.switchTab({
|
|
|
+ url:'/pages/index/index'
|
|
|
+ })
|
|
|
+ that.$store.state.userInfo = resdata.data.data;
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
}else{
|
|
|
//未完善信息,存为临时信息
|
|
|
uni.setStorageSync('user_account_temp', res.data.data.user_account);
|
|
@@ -109,6 +116,13 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ fakeLogin(){
|
|
|
+ uni.setStorageSync('user_account', '123');
|
|
|
+ uni.setStorageSync('token', '123');
|
|
|
+ uni.switchTab({
|
|
|
+ url:'/pages/index/index'
|
|
|
+ })
|
|
|
+ },
|
|
|
login(){
|
|
|
let that = this
|
|
|
if(!this.form.account){
|
|
@@ -119,6 +133,9 @@ export default {
|
|
|
this.$u.toast('请输入密码');
|
|
|
return
|
|
|
}
|
|
|
+ //虚拟登录
|
|
|
+ that.fakeLogin()
|
|
|
+ return
|
|
|
that.isUse = true
|
|
|
that.$api.accountLogin(this.form).then(
|
|
|
res => {
|