前端各页面对接数据
This commit is contained in:
@@ -329,6 +329,16 @@ const handleLogin = async () => {
|
||||
console.error('获取用户信息失败(忽略,不阻塞登录):', e)
|
||||
}
|
||||
|
||||
// 显式保存用户ID到本地存储,确保页面刷新或重启后 SupabaseService 能恢复身份
|
||||
const currentSession = supa.getSession()
|
||||
if (currentSession.user != null) {
|
||||
const uid = currentSession.user?.getString('id')
|
||||
if (uid != null) {
|
||||
uni.setStorageSync('user_id', uid)
|
||||
console.log('用户ID已保存到本地存储:', uid)
|
||||
}
|
||||
}
|
||||
|
||||
uni.showToast({ title: '登录成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/mall/consumer/index' })
|
||||
|
||||
Reference in New Issue
Block a user