Browse Source

首页登陆问题

undefined
xubinxcode 4 years ago
parent
commit
14200bd57f
1 changed files with 21 additions and 8 deletions
  1. +21
    -8
      addons/unishop/uniapp/uni-shop/pages/public/login.vue

+ 21
- 8
addons/unishop/uniapp/uni-shop/pages/public/login.vue View File

@@ -27,14 +27,14 @@
<!-- #endif -->

<!-- <view class="forget-section"> -->
<!-- <view><label @click="register('resetpwd')">忘记密码</label> -->
<!-- - <label @click="register('register')">立马注册</label></view> -->
<!-- </view> -->
<!-- <view><label @click="register('resetpwd')">忘记密码</label> -->
<!-- - <label @click="register('register')">立马注册</label></view> -->
<!-- </view> -->


</view>
</view>
</view>
</view>
</template>

<script>
@@ -51,7 +51,6 @@
}
},
onLoad() {

},
methods: {
...mapMutations(['login']),
@@ -72,9 +71,16 @@
this.$store.commit('login', data)

this.logining = true;

setTimeout(function() {
uni.navigateBack();
let pages = getCurrentPages(); //当前页
if(pages.length==1&&pages[0].route=='pages/public/login'){
console.log(pages[0].route)
uni.switchTab({
url: '/pages/index/index'
})
}else{
uni.navigateBack();
}
}, 2000)

} else {
@@ -99,7 +105,14 @@
this.$store.commit('login', data);
this.$api.msg('登录成功');
setTimeout(function() {
uni.navigateBack();
let pages = getCurrentPages(); //当前页
if(pages.length==1&&pages[0].route=='pages/public/login'){
uni.navigateTo({
url: `pages/index/index`
});
}else{
uni.navigateBack();
}
}, 2000);
}
}


Loading…
Cancel
Save