Browse Source

小程序登陆

h5_css
yanyan 3 years ago
parent
commit
224f6abf7f
  1. 2
      manifest.json
  2. 2
      pages/index/index.vue
  3. 8
      subpkg/login/login.vue

2
manifest.json

@ -50,7 +50,7 @@
/* */
"mp-weixin" : {
/* */
"appid" : "wxf733c344d8e69a99",
"appid" : "wx93ec514a5c456507",
"setting" : {
"urlCheck" : false
},

2
pages/index/index.vue

@ -44,7 +44,7 @@
},
onLoad() {
this.getSwiperList();
// this.checkLogin()
this.checkLogin()
},
onShow() {
this.page= "home"

8
subpkg/login/login.vue

@ -51,10 +51,14 @@
}
const { data: loginResult } = await uni.$http.post('/small/wechat/login', query)
if (loginResult.meta.status !== 200) return uni.$showMsg('登录失败!')
if (loginResult.token === "") return uni.$showMsg('登录失败!')
// token vuex
this.updateToken(loginResult.data)
this.updateToken(loginResult.token)
uni.switchTab({
url: '/pages/index/index'
})
//this.navigateBack()
},
navigateBack() {

Loading…
Cancel
Save