feat(admin,api,player): 代理层级管理、额度上下分与玩家钱包详情
新增代理管理器与二级代理体系,完善信用额度/上下分上下文与冻结策略;代理端玩家与子代理管理增强;玩家端新增钱包详情页与交易筛选优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { ensureStaffSession } from '../utils/session-hydrate';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
@@ -13,13 +14,12 @@ const router = createRouter({
|
||||
{ path: '', component: () => import('../views/HomeEntry.vue') },
|
||||
{
|
||||
path: 'users',
|
||||
component: () => import('../views/Users.vue'),
|
||||
component: () => import('../views/AgentManager.vue'),
|
||||
meta: { adminOnly: true },
|
||||
},
|
||||
{
|
||||
path: 'agents',
|
||||
component: () => import('../views/Agents.vue'),
|
||||
meta: { adminOnly: true },
|
||||
redirect: '/users',
|
||||
},
|
||||
{
|
||||
path: 'matches',
|
||||
@@ -83,8 +83,7 @@ const router = createRouter({
|
||||
},
|
||||
{
|
||||
path: 'sub-agents',
|
||||
component: () => import('../views/agent/SubAgents.vue'),
|
||||
meta: { agentOnly: true },
|
||||
redirect: '/my-players',
|
||||
},
|
||||
{
|
||||
path: 'my-bets',
|
||||
@@ -96,9 +95,14 @@ const router = createRouter({
|
||||
],
|
||||
});
|
||||
|
||||
router.beforeEach((to) => {
|
||||
router.beforeEach(async (to) => {
|
||||
const auth = useAuthStore();
|
||||
const hasToken = !!auth.token.value;
|
||||
|
||||
if (hasToken) {
|
||||
await ensureStaffSession();
|
||||
}
|
||||
|
||||
const hasUser = !!auth.user.value?.userType;
|
||||
|
||||
if (to.meta.public) {
|
||||
@@ -119,6 +123,10 @@ router.beforeEach((to) => {
|
||||
return '/';
|
||||
}
|
||||
|
||||
if (to.meta.tier1AgentOnly && !auth.isTier1Agent.value) {
|
||||
return '/';
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user