Commit 10dfbccc authored by haiyoucuv's avatar haiyoucuv

init

parent e2f48a88
...@@ -10,12 +10,12 @@ App<IAppOption>({ ...@@ -10,12 +10,12 @@ App<IAppOption>({
wx.setStorageSync('logs', logs) wx.setStorageSync('logs', logs)
// 登录 // 登录
wx.login({ // wx.login({
success: async (res) => { // success: async (res) => {
console.log(res.code) // console.log(res.code)
// 发送 res.code 到后台换取 openId, sessionKey, unionId // // 发送 res.code 到后台换取 openId, sessionKey, unionId
await dbLogin({code: res.code}); // await dbLogin({code: res.code});
}, // },
}) // })
}, },
}) })
\ No newline at end of file
...@@ -32,7 +32,15 @@ ComponentWithStore({ ...@@ -32,7 +32,15 @@ ComponentWithStore({
methods: { methods: {
async onShow() { async onShow() {
store.doLog(507, 10) store.doLog(507, 10)
// 登录
wx.login({
success: async (res) => {
console.log(res.code)
// 发送 res.code 到后台换取 openId, sessionKey, unionId
await dbLogin({code: res.code});
await this.updateHomeInfo(); await this.updateHomeInfo();
},
});
const {channel, city} = this.options || {}; const {channel, city} = this.options || {};
store.paramsObj = {channel, city}; store.paramsObj = {channel, city};
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment