完善用户登录

This commit is contained in:
2025-04-23 11:32:01 +08:00
parent 95b7c69ddb
commit 2ce4777910
80 changed files with 3379 additions and 214 deletions

View File

@ -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) {