refactor: 统一权限标识前缀为module_格式

feat(tenant): 新增租户管理模块相关文件

style: 优化代码导入和类型提示

fix: 修复前端权限标识校验逻辑

docs: 更新注释中的权限标识示例

test: 更新测试用例中的权限标识

chore: 清理无用导入和类型定义
This commit is contained in:
zhangtao
2025-11-11 01:06:40 +08:00
parent 379df71baa
commit 5d0d0cd26a
54 changed files with 2109 additions and 445 deletions
+7 -7
View File
@@ -124,7 +124,7 @@
</el-tooltip>
</div>
<div>
<el-button v-hasPerm="['monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheNames"/>
<el-button v-hasPerm="['module_monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheNames"/>
</div>
</div>
</template>
@@ -134,7 +134,7 @@
</template>
<el-table-column prop="cache_name" label="缓存名称" show-overflow-tooltip>
<template #default="{ row }">
<el-button v-hasPerm="['monitor:cache:view']" type="primary" link @click="getCacheKeyList(row)">{{ row.cache_name }}</el-button>
<el-button v-hasPerm="['module_monitor:cache:view']" type="primary" link @click="getCacheKeyList(row)">{{ row.cache_name }}</el-button>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
@@ -142,7 +142,7 @@
<template #default="{ row }">
<el-popconfirm class="box-item" :title="`确认删除缓存 ${row.cache_name} 吗?`" placement="top" @confirm="handleClearCacheName(row)">
<template #reference>
<el-button v-hasPerm="['monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
<el-button v-hasPerm="['module_monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
</template>
</el-popconfirm>
</template>
@@ -168,7 +168,7 @@
</el-tooltip>
</div>
<div>
<el-button v-hasPerm="['monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheKeys"/>
<el-button v-hasPerm="['module_monitor:cache:refresh']" type="primary" link icon="RefreshRight" @click="refreshCacheKeys"/>
</div>
</div>
</template>
@@ -178,14 +178,14 @@
</template>
<el-table-column prop="cacheKey" label="缓存键名" show-overflow-tooltip>
<template #default="{ row }">
<el-button v-hasPerm="['monitor:cache:detail']" type="primary" link @click="handleCacheValue(row.cacheKey)">{{ row.cacheKey}}</el-button>
<el-button v-hasPerm="['module_monitor:cache:detail']" type="primary" link @click="handleCacheValue(row.cacheKey)">{{ row.cacheKey}}</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="60" align="center">
<template #default="{ row }">
<el-popconfirm class="box-item" :title="`确认删除键 ${row.cacheKey} 吗?`" placement="top" @confirm="handleClearCacheKey(row.cacheKey)">
<template #reference>
<el-button v-hasPerm="['monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
<el-button v-hasPerm="['module_monitor:cache:delete']" type="danger" size="small" link icon="delete"/>
</template>
</el-popconfirm>
</template>
@@ -211,7 +211,7 @@
</el-tooltip>
</div>
<div>
<el-button v-hasPerm="['monitor:cache:delete_all']" type="danger" link icon="delete" @click="handleClearCacheAll">清理全部</el-button>
<el-button v-hasPerm="['module_monitor:cache:delete_all']" type="danger" link icon="delete" @click="handleClearCacheAll">清理全部</el-button>
</div>
</div>
</template>
@@ -15,8 +15,8 @@
</el-form-item>
<!-- 查询、重置、展开/收起按钮 -->
<el-form-item class="search-buttons">
<el-button v-hasPerm="['monitor:online:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['monitor:online:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
<el-button v-hasPerm="['module_monitor:online:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['module_monitor:online:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
@@ -39,7 +39,7 @@
<div class="data-table__toolbar--left">
<el-row :gutter="10">
<el-col :span="1.5">
<el-button v-hasPerm="['monitor:online:force_logout']" type="danger" icon="delete" @click="handleClear">强退所有</el-button>
<el-button v-hasPerm="['module_monitor:online:force_logout']" type="danger" icon="delete" @click="handleClear">强退所有</el-button>
</el-col>
</el-row>
</div>
@@ -47,7 +47,7 @@
<el-row :gutter="10">
<el-col :span="1.5">
<el-tooltip content="刷新">
<el-button v-hasPerm="['monitor:online:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
<el-button v-hasPerm="['module_monitor:online:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
</el-tooltip>
</el-col>
<el-col :span="1.5">
@@ -89,7 +89,7 @@
<el-table-column v-if="tableColumns.find(col => col.prop === 'login_time')?.show" key="login_time" label="登录时间" prop="login_time" min-width="180" />
<el-table-column v-if="tableColumns.find(col => col.prop === 'operation')?.show" key="operation" fixed="right" label="操作" min-width="100">
<template #default="scope">
<el-button v-hasPerm="['monitor:online:force_logout']" type="danger" size="small" link icon="delete" @click="handleSubmit(scope.row.session_id)">强退
<el-button v-hasPerm="['module_monitor:online:force_logout']" type="danger" size="small" link icon="delete" @click="handleSubmit(scope.row.session_id)">强退
</el-button>
</template>
</el-table-column>
@@ -13,8 +13,8 @@
/>
</el-form-item>
<el-form-item class="search-buttons">
<el-button v-hasPerm="['monitor:resource:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['monitor:resource:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
<el-button v-hasPerm="['module_monitor:resource:query']" type="primary" icon="search" native-type="submit">查询</el-button>
<el-button v-hasPerm="['module_monitor:resource:query']" icon="refresh" @click="handleResetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
@@ -52,34 +52,34 @@
<div class="data-table__toolbar--left">
<el-row :gutter="10">
<el-col :span="1.5">
<el-button v-hasPerm="['monitor:resource:upload']" type="success" icon="plus" @click="handleUpload">上传文件</el-button>
<el-button v-hasPerm="['module_monitor:resource:upload']" type="success" icon="plus" @click="handleUpload">上传文件</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPerm="['monitor:resource:create_dir']" type="primary" icon="folder-add" @click="handleCreateDir">新建文件夹</el-button>
<el-button v-hasPerm="['module_monitor:resource:create_dir']" type="primary" icon="folder-add" @click="handleCreateDir">新建文件夹</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPerm="['monitor:resource:delete']" type="danger" icon="delete" :disabled="selectedItems.length === 0" @click="handleBatchDelete">批量删除</el-button>
<el-button v-hasPerm="['module_monitor:resource:delete']" type="danger" icon="delete" :disabled="selectedItems.length === 0" @click="handleBatchDelete">批量删除</el-button>
</el-col>
</el-row>
</div>
<div class="data-table__toolbar--right">
<el-row :gutter="10">
<el-col :span="1.5">
<el-checkbox v-model="showHiddenFiles" v-hasPerm="['monitor:resource:show_hidden']" @change="handleShowHiddenChange">
<el-checkbox v-model="showHiddenFiles" v-hasPerm="['module_monitor:resource:show_hidden']" @change="handleShowHiddenChange">
显示隐藏文件
</el-checkbox>
</el-col>
<el-col :span="1.5">
<el-button-group>
<el-button
v-hasPerm="['monitor:resource:view_list']"
v-hasPerm="['module_monitor:resource:view_list']"
:type="viewMode === 'list' ? 'primary' : ''"
@click="viewMode = 'list'"
>
<el-icon><List /></el-icon>
</el-button>
<el-button
v-hasPerm="['monitor:resource:view_grid']"
v-hasPerm="['module_monitor:resource:view_grid']"
:type="viewMode === 'grid' ? 'primary' : ''"
@click="viewMode = 'grid'"
>
@@ -89,7 +89,7 @@
</el-col>
<el-col :span="1.5">
<el-tooltip content="刷新">
<el-button v-hasPerm="['monitor:resource:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
<el-button v-hasPerm="['module_monitor:resource:refresh']" type="primary" icon="refresh" circle @click="handleRefresh"/>
</el-tooltip>
</el-col>
</el-row>
@@ -122,7 +122,7 @@
<Document v-else />
</el-icon>
<span
v-hasPerm="['monitor:resource:preview']"
v-hasPerm="['module_monitor:resource:preview']"
:class="{ 'file-name-clickable': true }"
@click="handleFileNameClick(row)"
>
@@ -141,7 +141,7 @@
<template #default="{ row }">
<el-button
v-if="!row.is_dir"
v-hasPerm="['monitor:resource:download']"
v-hasPerm="['module_monitor:resource:download']"
type="success"
size="small"
link
@@ -150,10 +150,10 @@
>
下载
</el-button>
<el-button v-hasPerm="['monitor:resource:rename']" type="primary" size="small" link icon="edit" @click="handleRename(row)">
<el-button v-hasPerm="['module_monitor:resource:rename']" type="primary" size="small" link icon="edit" @click="handleRename(row)">
重命名
</el-button>
<el-button v-hasPerm="['monitor:resource:delete']" type="danger" size="small" link icon="delete" @click="handleDelete(row)">
<el-button v-hasPerm="['module_monitor:resource:delete']" type="danger" size="small" link icon="delete" @click="handleDelete(row)">
删除
</el-button>
</template>
@@ -221,7 +221,7 @@
</el-upload>
<template #footer>
<el-button @click="uploadDialogVisible = false">取消</el-button>
<el-button v-hasPerm="['monitor:resource:upload']" type="primary" :loading="uploading" @click="handleUploadConfirm">
<el-button v-hasPerm="['module_monitor:resource:upload']" type="primary" :loading="uploading" @click="handleUploadConfirm">
确定上传
</el-button>
</template>
@@ -244,7 +244,7 @@
</el-form>
<template #footer>
<el-button @click="createDirDialogVisible = false">取消</el-button>
<el-button v-hasPerm="['monitor:resource:create_dir']" type="primary" @click="handleCreateDirConfirm">确定</el-button>
<el-button v-hasPerm="['module_monitor:resource:create_dir']" type="primary" @click="handleCreateDirConfirm">确定</el-button>
</template>
</el-dialog>
@@ -265,7 +265,7 @@
</el-form>
<template #footer>
<el-button @click="renameDialogVisible = false">取消</el-button>
<el-button v-hasPerm="['monitor:resource:rename']" type="primary" @click="handleRenameConfirm">确定</el-button>
<el-button v-hasPerm="['module_monitor:resource:rename']" type="primary" @click="handleRenameConfirm">确定</el-button>
</template>
</el-dialog>
</div>