chenkun 4 months ago
parent
commit
2ff6314d39
2 changed files with 13 additions and 3 deletions
  1. +12
    -1
      pages/index/index.vue
  2. +1
    -2
      store/store.js

+ 12
- 1
pages/index/index.vue View File

@ -144,9 +144,20 @@ export default {
...mapGetters(['userShop']), ...mapGetters(['userShop']),
}, },
onShow(){ onShow(){
console.log(this.userShop,"this.userShop")
this.checkLogin()
}, },
methods: { methods: {
checkLogin(){
if(!uni.getStorageSync('token')){
console.log("先登录")
uni.navigateTo({
url:'/pages_order/auth/loginAndRegisterAndForgetPassword'
})
// this.$store.commit('login')
// this.$refs.popup.open();
}
},
goToPage(titleIndex) { goToPage(titleIndex) {
uni.navigateTo({url:'/pages_order/order/offerOrBillLading?titleIndex='+titleIndex}) uni.navigateTo({url:'/pages_order/order/offerOrBillLading?titleIndex='+titleIndex})
}, },


+ 1
- 2
store/store.js View File

@ -40,8 +40,7 @@ const store = new Vuex.Store({
uni.showLoading({ uni.showLoading({
title: '登录中...' title: '登录中...'
}) })
uni.login({
success(res) {
uni.login({success(res) {
if(res.errMsg != "login:ok"){ if(res.errMsg != "login:ok"){
return return
} }


Loading…
Cancel
Save