修复注册码权限无效bug

This commit is contained in:
eoao
2025-07-22 23:33:46 +08:00
parent bbcff4908d
commit 7267f03482
23 changed files with 115 additions and 112 deletions

View File

@@ -31,7 +31,7 @@
<Icon icon="fluent:settings-48-regular" width="20" height="20" />
<span class="menu-name" style="margin-left: 21px">{{$t('settings')}}</span>
</el-menu-item>
<div class="manage-title" v-perm="['user:query','role:query','setting:query','analysis:query']">
<div class="manage-title" v-perm="['user:query','role:query','setting:query','analysis:query','reg-key:query']">
<div>{{$t('manage')}}</div>
</div>
<el-menu-item @click="router.push({name: 'analysis'})" index="analysis" v-perm="'analysis:query'"

View File

@@ -48,13 +48,13 @@
<div>
<el-tag v-if="settingStore.settings.manyEmail || settingStore.settings.addEmail" >{{$t('disabled')}}</el-tag>
<span v-else-if="accountCount && hasPerm('account:add')" style="margin-right: 5px">{{ $t('totalUserAccount',{msg: accountCount}) }}</span>
<el-tag v-else-if="!accountCount && hasPerm('account:add')" >{{$t('noLimit')}}</el-tag>
<el-tag v-else-if="!hasPerm('account:add')" >{{$t('blocked')}}</el-tag>
<el-tag v-else-if="!accountCount && hasPerm('account:add')" >{{$t('unlimited')}}</el-tag>
<el-tag v-else-if="!hasPerm('account:add')" >{{$t('unauthorized')}}</el-tag>
</div>
</div>
</div>
<div class="logout">
<el-button type="primary" :loading="logoutLoading" @click="clickLogout">{{$t('signOut')}}</el-button>
<el-button type="primary" :loading="logoutLoading" @click="clickLogout">{{$t('logOut')}}</el-button>
</div>
</div>
</template>
@@ -94,20 +94,21 @@ const sendType = computed(() => {
}
if (!hasPerm('email:send')) {
return t('noPerm')
return t('unauthorized')
}
if (userStore.user.role.sendType === 'ban') {
return t('sendBanned')
}
if (!userStore.user.role.sendCount) {
return t('noLimit')
}
if (userStore.user.role.sendCount < 0) {
return t('blocked')
return t('unlimited')
}
if (userStore.user.role.sendType === 'day') {
return t('daily')
}
if (userStore.user.role.sendType === 'count') {
return t('total')
}
@@ -115,15 +116,20 @@ const sendType = computed(() => {
const sendCount = computed(() => {
if (!hasPerm('email:send')) {
return null
}
if (userStore.user.role.sendType === 'ban') {
return null
}
if (!userStore.user.role.sendCount) {
return null
}
if (userStore.user.role.sendCount < 0) {
if (settingStore.settings.send === 1) {
return null
}