Refactor navigator utility functions and add isPWA check

This commit is contained in:
jxxghp
2024-10-19 10:39:31 +08:00
parent b3f616ddc6
commit 76a487854b
16 changed files with 38 additions and 82 deletions

View File

@@ -92,7 +92,9 @@ const canEditUser = computed(() => {
// 计算是否有用户管理权限
const canManageUser = computed(() => {
return canEditUser
if (props.user.name == currentLoginUser) return false
if (store.state.auth.superUser) return true
return false
})
// 用户重新完成时

View File

@@ -63,7 +63,7 @@ const userForm = ref<User>({
name: props.username ?? '',
password: '',
email: '',
is_active: false,
is_active: true,
is_superuser: false,
avatar: avatar1,
is_otp: false,

View File

@@ -15,9 +15,7 @@ import { useDisplay } from 'vuetify'
const display = useDisplay()
// APP
const appMode = computed(() => {
return localStorage.getItem('MP_APPMODE') != '0' && display.mdAndDown.value
})
const appMode = inject('appMode')
// 输入参数
const inProps = defineProps({
@@ -119,7 +117,7 @@ const currentImgLink = ref('')
// 大小控制
const scrollStyle = computed(() => {
return appMode.value
return appMode
? 'height: calc(100vh - 15.5rem - env(safe-area-inset-bottom) - 3.5rem)'
: 'height: calc(100vh - 14.5rem - env(safe-area-inset-bottom)'
})