init
This commit is contained in:
parent
3fec0df724
commit
662620e3ea
@ -1,4 +1,7 @@
|
||||
// pages/login/index.js
|
||||
import {
|
||||
api
|
||||
} from '../../utils/api.js'
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -29,6 +32,21 @@ Page({
|
||||
return
|
||||
}
|
||||
console.log(e);
|
||||
const data = {code:e.detail.code}
|
||||
|
||||
api("/auth/getPhone", 'GET', data).then(res => {
|
||||
wx.hideLoading()
|
||||
if (res.code === 200) {
|
||||
wx.setStorageSync('user', res.data)
|
||||
wx.setStorageSync('token', res.data.token)
|
||||
wx.navigateBack()
|
||||
} else {
|
||||
wx.showToast({
|
||||
icon: 'error',
|
||||
title: res.msg
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
change(e){
|
||||
const tmp = this.data.checked === false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user