完善用户登录
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="login">
|
||||
<view class="u-font-xl bold-600 u-margin-top-56">获取你的昵称、头像</view>
|
||||
<view class="u-font-xl bold-600 u-padding-top-56">获取你的昵称、头像</view>
|
||||
|
||||
<view>
|
||||
<form @submit="doLogin">
|
||||
@ -67,12 +67,6 @@
|
||||
import { mapMutations, mapActions, mapGetters } from 'vuex'
|
||||
import { uploadFile } from "@/utils/tools";
|
||||
import {
|
||||
accountLogin,
|
||||
codeLogin,
|
||||
sendSms,
|
||||
wxpLogin,
|
||||
smsCodeLogin,
|
||||
opLogin,
|
||||
authLogin,
|
||||
updateUser
|
||||
} from '@/api/app'
|
||||
@ -88,9 +82,10 @@
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
isAgree: false
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(['LOGIN', 'LOGOUT']),
|
||||
...mapActions(['getUser']),
|
||||
@ -128,7 +123,7 @@
|
||||
const {
|
||||
userInfo: { avatarUrl, nickName, gender }
|
||||
} = await getUserInfo()
|
||||
console.log(await getUserInfo())
|
||||
|
||||
uni.showLoading({
|
||||
title: '登录中',
|
||||
mask: true
|
||||
@ -138,7 +133,8 @@
|
||||
const {code, data, msg} = await authLogin({
|
||||
code: wxCode,
|
||||
nickname: nickName || '', //支付宝小程序没有直接获取昵称
|
||||
headimgurl: avatarUrl
|
||||
headimgurl: avatarUrl,
|
||||
client
|
||||
})
|
||||
if (code == 1) {
|
||||
if (data.is_new_user) {
|
||||
|
||||
Reference in New Issue
Block a user