用户模块

This commit is contained in:
仲么了
2023-07-10 20:20:00 +08:00
parent 69063cb241
commit 2104bc0c4c
17 changed files with 4764 additions and 381 deletions

View File

@@ -198,10 +198,14 @@ const prePage = () => {
}
const loginSuccess = (data) => {
uni.setStorageSync('userInfo', data)
uni.setStorageSync('token', data.token_type + ' ' + data.access_token)
uni.setStorageSync('access_token', data.token_type + ' ' + data.access_token)
uni.setStorageSync('refresh_token', data.refresh_token)
let strings = data.access_token.split('.') //截取token获取载体
var userInfo = JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
userInfo.authorities = userInfo.authorities[0]
uni.setStorageSync('userInfo', userInfo)
uni.reLaunch({
url: '/pages/user/login',
url: '/pages/index/index',
})
}