mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 07:55:06 +08:00
1.同步调整到OAuth2方式登录 2.微信小程序一键登录;
This commit is contained in:
@ -139,15 +139,30 @@ export default {
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
this.$store.dispatch('Login', { type: this.currentModeIndex, data: this.formData }).then(res => {
|
||||
uni.$u.toast('登录成功')
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/user/user'
|
||||
})
|
||||
}, 300)
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: res => {
|
||||
let data = this.formData
|
||||
data.socialType = 34 //WECHAT_MINI_APP 先指定固定值
|
||||
data.socialCode = res.code
|
||||
data.socialState = Math.random() // 该参数没有实际意义暂时传随机数
|
||||
this.mobileLogin(data)
|
||||
},
|
||||
fail: res => {
|
||||
this.mobileLogin(this.formData)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
mobileLogin(data){
|
||||
this.$store.dispatch('Login', { type: this.currentModeIndex, data: data }).then(res => {
|
||||
uni.$u.toast('登录成功')
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/user/user'
|
||||
})
|
||||
}, 300)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user