|
|
@@ -261,14 +261,14 @@ const search = ref(false);
|
|
|
|
|
|
// multi language
|
|
|
const i18n = reactive(useI18n());
|
|
|
-let uid = ref('')
|
|
|
+let uid:any = ref('')
|
|
|
let face = ref('')
|
|
|
let nickName = ref('')
|
|
|
let email = ref("")
|
|
|
watch(route, (to, from) => {
|
|
|
// 检查本地存储中是否存在用户信息
|
|
|
if (localStorage.getItem('USER') !== null) {
|
|
|
- uid = JSON.parse(localStorage.getItem('USER')).uid
|
|
|
+ uid = JSON.parse(localStorage.getItem('USER') ?? 'null').uid
|
|
|
init(uid)
|
|
|
} else {
|
|
|
router.push(({ path: '/login' }))
|
|
|
@@ -341,7 +341,7 @@ const messages = ref([
|
|
|
]);
|
|
|
|
|
|
onMounted(() => {
|
|
|
- uid = JSON.parse(localStorage.getItem('USER')).uid
|
|
|
+ uid = JSON.parse(localStorage.getItem('USER') ?? 'null').uid
|
|
|
init(uid)
|
|
|
setActiveDropdown();
|
|
|
});
|