修复权限缓存问题
This commit is contained in:
@@ -99,7 +99,9 @@ import { ref, computed } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getLoginPassword } from '../../api/api.js'
|
||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||
import { usePermStore } from '@/stores/usePermStore'
|
||||
|
||||
const permStore = usePermStore()
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('')
|
||||
const password = ref('')
|
||||
@@ -201,6 +203,7 @@ const handleLogin = () => {
|
||||
password: password.value,
|
||||
cid: push_cid
|
||||
}
|
||||
permStore.clearPerm()
|
||||
getLoginPassword(params)
|
||||
.then(res => {
|
||||
// console.log('33333',res)
|
||||
@@ -214,7 +217,11 @@ const handleLogin = () => {
|
||||
// // const currentVillageId = res.data.currentVillageId || 0;
|
||||
// // uni.setStorageSync('currentVillageId', currentVillageId);
|
||||
// }
|
||||
uni.setStorageSync('userPermission', res.data.user.permissions)
|
||||
uni.setStorage({
|
||||
key: 'userPermission',
|
||||
data: res.data.user.permissions
|
||||
})
|
||||
permStore.setPerm(res.data.user.permissions)
|
||||
uni.hideLoading()
|
||||
if (rememberPwd.value) {
|
||||
uni.setStorageSync('rememberPhone', phoneNumber.value)
|
||||
|
||||
Reference in New Issue
Block a user