支持用户授权注册登录mock

This commit is contained in:
kk
2026-07-09 18:49:56 +08:00
parent 5bb31516a0
commit a7e0366fb7
4 changed files with 101 additions and 6 deletions
+10 -5
View File
@@ -183,9 +183,16 @@ export default {
const ret = res.data || {};
if (ret.code === 0 && ret.data) {
// 合并微信授权信息(头像、昵称)到 user_info
const authInfo = uni.getStorageSync('auth_info') || {};
const userInfo = {
...authInfo,
...ret.data.user_info,
};
// 保存 token 和用户信息
uni.setStorageSync('token', ret.data.token);
uni.setStorageSync('user_info', ret.data.user_info);
uni.setStorageSync('user_info', userInfo);
// 清除临时数据
uni.removeStorageSync('temp_token');
@@ -349,10 +356,8 @@ page {
/* 底部协议 */
.agreement {
position: absolute;
bottom: 80rpx;
left: 0;
right: 0;
margin-top: 80rpx;
padding-bottom: env(safe-area-inset-bottom);
display: flex;
align-items: center;
justify-content: center;