修复权限缓存问题
This commit is contained in:
@@ -100,7 +100,9 @@
|
||||
import { ref, computed, onUnmounted } from 'vue'
|
||||
import { getLoginBySms, getSendCode } from '../../api/api.js'
|
||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||
import { usePermStore } from '@/stores/usePermStore'
|
||||
|
||||
const permStore = usePermStore()
|
||||
// ========== 响应式数据 ==========
|
||||
// 手机号
|
||||
const phoneNumber = ref('')
|
||||
@@ -246,12 +248,13 @@ const handleLogin = () => {
|
||||
scene: 'butler_login',
|
||||
cid: push_cid
|
||||
}
|
||||
permStore.clearPerm()
|
||||
getLoginBySms(params)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
uni.setStorageSync('token', res.data.token)
|
||||
uni.setStorageSync('userPermission', res.data.user.permissions)
|
||||
permStore.setPerm(res.data.user.permissions)
|
||||
// 存用户ID
|
||||
if (res.data.user.userId) {
|
||||
uni.setStorageSync('userId', res.data.user.userId)
|
||||
|
||||
Reference in New Issue
Block a user