优化代码
This commit is contained in:
@@ -54,6 +54,38 @@
|
||||
},
|
||||
"splashscreen" : {
|
||||
"useOriginalMsgbox" : true
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -148,7 +148,7 @@ export default {
|
||||
const familyRes = await this.$api.family.info.get()
|
||||
if (familyRes && familyRes.code === 1) {
|
||||
this.familyInfo = familyRes.data
|
||||
this.$store.commit('family/setFamilyInfo', familyRes.data)
|
||||
this.$store.commit('setFamilyInfo', familyRes.data)
|
||||
}
|
||||
|
||||
// 获取邀请码(仅家主)
|
||||
|
||||
@@ -172,10 +172,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
hasFamily() {
|
||||
if (!this.$store || !this.$store.getters) {
|
||||
if (!this.$store || !this.$store.state) {
|
||||
return false
|
||||
}
|
||||
return this.$store.getters.hasFamily || false
|
||||
return this.$store.state.family.familyId ? true :false
|
||||
},
|
||||
userName() {
|
||||
if (!this.$store || !this.$store.state || !this.$store.state.user || !this.$store.state.user.userInfo) {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 166 KiB |
@@ -1,4 +1,5 @@
|
||||
import config from '@/config/index.js'
|
||||
import tool from '@/utils/tool'
|
||||
|
||||
// 全局存储当前路由
|
||||
let currentRoute = ''
|
||||
@@ -17,7 +18,7 @@ export function setCurrentRoute(route) {
|
||||
*/
|
||||
export function isLogin() {
|
||||
try {
|
||||
const token = uni.getStorageSync('token')
|
||||
const token = tool.data.get('token')
|
||||
return !!token
|
||||
} catch (e) {
|
||||
console.error('检查登录状态失败:', e)
|
||||
@@ -134,8 +135,12 @@ export function checkLogin() {
|
||||
*/
|
||||
export function logout() {
|
||||
try {
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userInfo')
|
||||
tool.data.remove('token')
|
||||
tool.data.remove('userInfo')
|
||||
tool.data.remove('familyInfo')
|
||||
tool.data.remove('familyId')
|
||||
tool.data.remove('isOwner')
|
||||
tool.data.remove('beforLoginUrl')
|
||||
|
||||
uni.showToast({
|
||||
title: '已退出登录',
|
||||
|
||||
Reference in New Issue
Block a user