fix: 完善菜单和应用验证
All checks were successful
continuous-integration/drone/push Build is passing

- 侧边栏菜单增加「应用管理」和「企微应用」
- 租户订阅页面应用选择增加前端验证
- 后端增加 app_code 存在性验证
This commit is contained in:
111
2026-01-24 10:10:56 +08:00
parent 6a93e05ec3
commit 0a799ee276
3 changed files with 21 additions and 2 deletions

View File

@@ -13,7 +13,9 @@ const menuItems = computed(() => {
const items = [
{ path: '/dashboard', title: '仪表盘', icon: 'Odometer' },
{ path: '/tenants', title: '租户管理', icon: 'OfficeBuilding' },
{ path: '/app-config', title: '应用配置', icon: 'Setting' },
{ path: '/apps', title: '应用管理', icon: 'Grid' },
{ path: '/tenant-wechat-apps', title: '企微应用', icon: 'ChatDotRound' },
{ path: '/app-config', title: '租户订阅', icon: 'Setting' },
{ path: '/stats', title: '统计分析', icon: 'TrendCharts' },
{ path: '/logs', title: '日志查看', icon: 'Document' }
]

View File

@@ -41,9 +41,20 @@ const currentAppRequireJssdk = computed(() => {
return appRequireJssdk.value[form.app_code] || false
})
// 验证 app_code 必须是有效的应用
const validateAppCode = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择应用'))
} else if (!appList.value.find(a => a.app_code === value)) {
callback(new Error('请从列表中选择有效的应用'))
} else {
callback()
}
}
const rules = {
tenant_id: [{ required: true, message: '请输入租户ID', trigger: 'blur' }],
app_code: [{ required: true, message: '请选择应用', trigger: 'change' }]
app_code: [{ required: true, validator: validateAppCode, trigger: 'change' }]
}
// 查看 Token 对话框