1.同步调整到OAuth2方式登录 2.微信小程序一键登录;

This commit is contained in:
sfmind
2022-06-02 17:59:57 +08:00
parent e1c08c4661
commit 13b5ad127a
11 changed files with 177 additions and 62 deletions

View File

@ -33,7 +33,7 @@ export default {
onReady() {},
methods: {
getPhoneNumber(e) {
let code = e.detail.code
let phoneCode = e.detail.code
if (!e.detail.code) {
uni.showModal({
title: '授权失败',
@ -50,10 +50,10 @@ export default {
}
})
} else {
uni.getUserInfo({
uni.login({
provider: 'weixin',
success: res => {
this.$store.dispatch('Login', { type: 2, data: { code: code, userData: res } }).then(res => {
this.$store.dispatch('Login', { type: 2, data: { phoneCode: phoneCode, loginCode: res.code } }).then(res => {
uni.$u.toast('登录成功')
setTimeout(() => {
uni.switchTab({