diff --git a/docs/退单功能使用说明.md b/docs/退单功能使用说明.md index e4b7730..8bdfc3f 100644 --- a/docs/退单功能使用说明.md +++ b/docs/退单功能使用说明.md @@ -177,3 +177,4 @@ src/ --- *最后更新时间: 2024年1月* + diff --git a/src/router/index.js b/src/router/index.js index 025fdb3..aeed167 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,7 +20,20 @@ export const routes = [ path: '/', component: AdminLayout, children: [ - { path: '', redirect: '/users' }, + { + path: '', + redirect: (to) => { + // 根据用户类型重定向到不同的默认页面 + const { getCurrentUserType } = require('@/utils/permission') + const userType = getCurrentUserType() + + if (userType?.toLowerCase() === 'agent') { + return '/links' // 代理商跳转到链接管理 + } else { + return '/users' // 管理员跳转到用户管理 + } + } + }, { path: 'users', name: 'Users', component: UserList, meta: { title: '用户管理' } }, { path: 'settings', name: 'Settings', component: Settings, meta: { title: '系统设置' } }, { path: 'links', name: 'Links', component: LinkGenerate, meta: { title: '链接管理' } }, @@ -44,7 +57,17 @@ router.beforeEach((to, from, next) => { // 检查路由权限 if (to.name && !canAccessRoute(to.name)) { - return next({ name: 'Users' }) // 无权限时跳转到用户管理 + // 根据用户类型跳转到有权限的默认页面 + const { getCurrentUserType } = require('@/utils/permission') + const userType = getCurrentUserType() + + if (userType?.toLowerCase() === 'agent') { + // 代理商跳转到链接管理页面 + return next({ name: 'Links' }) + } else { + // 管理员或其他用户跳转到用户管理 + return next({ name: 'Users' }) + } } next() diff --git a/src/views/Login.vue b/src/views/Login.vue index f64d649..d401f67 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -127,8 +127,19 @@ async function onSubmit() { showSuccessMessage('登录成功') persistRemember() console.debug('login response:', res.data) - const redirect = route.query.redirect || '/' - router.replace(String(redirect)) + + // 如果有 redirect 参数,直接跳转 + if (route.query.redirect) { + router.replace(String(route.query.redirect)) + } else { + // 根据用户类型跳转到合适的默认页面 + const userType = data?.userType?.toLowerCase() + if (userType === 'agent') { + router.replace('/links') // 代理商跳转到链接管理 + } else { + router.replace('/users') // 管理员跳转到用户管理 + } + } } catch (e) { showErrorMessage(e, '登录失败') } finally { diff --git a/src/views/refund/RefundManagement.vue b/src/views/refund/RefundManagement.vue index 2277fab..2a4038f 100644 --- a/src/views/refund/RefundManagement.vue +++ b/src/views/refund/RefundManagement.vue @@ -5,47 +5,74 @@

管理用户的退单申请,支持按链接编号查询和执行退单操作

- +
- - - - - - - - - - - - - - - - - - - - - 查询 - - - - 重置 - - - + + + + +
+ + + + + + +
+
+ + + + + + + + + + + + + + + + +
+ + 查询 + + + 重置 + +
+
+
+
@@ -54,15 +81,30 @@ - + - {{ linkInfo.codeNo }} + + {{ linkInfo.codeNo }} + {{ getStatusText(linkInfo.status) }} @@ -70,10 +112,14 @@ {{ formatDateTime(linkInfo.createdAt) }} {{ formatDateTime(linkInfo.updatedAt) }} - {{ linkInfo.agentId || '-' }} - {{ linkInfo.machineId || '-' }} - {{ linkInfo.totalPoints || '-' }} - {{ linkInfo.currentPoints || '-' }} + + {{ linkInfo.agentId || '-' }} + + + {{ linkInfo.machineId || '-' }} + + {{ linkInfo.totalPoints ?? '-' }} + {{ linkInfo.currentPoints ?? '-' }} {{ formatDateTime(linkInfo.refundAt) }} @@ -87,24 +133,13 @@ @click="handleRefund" :loading="refunding" > - - 执行退单 + 执行退单 - - - 已退单 + + 已退单 - - - 当前状态不允许退单 + + 当前状态不允许退单 @@ -123,7 +158,7 @@ - + - + - +
  1. 系统验证用户权限和链接状态
  2. @@ -149,7 +184,7 @@
  3. 记录退单时间
- +