- 添加 expiresAt 和 refreshUserSig 参数支持自动续签 - 修改 PushSDK 初始化方式,自动完成设备注册和厂商初始化 - 调整过期续签策略,从提前 15 分钟改为提前 5 分钟触发 - 重构 RN SDK 文档结构,简化安装和使用方式 - 更新统一登录流程,支持 profile 信息传递 - 添加 IM 数据库自动隔离功能 - 修复 Android 群消息聚合问题 - 补充自动化测试验证和错误处理机制
96 行
2.6 KiB
TypeScript
96 行
2.6 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
import { useAuthStore } from '@/stores/auth'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
routes: [
|
|
{
|
|
path: '/login',
|
|
component: () => import('@/views/auth/LoginView.vue'),
|
|
},
|
|
{
|
|
path: '/register',
|
|
component: () => import('@/views/auth/RegisterView.vue'),
|
|
},
|
|
{
|
|
path: '/forgot-password',
|
|
component: () => import('@/views/auth/ForgotPasswordView.vue'),
|
|
},
|
|
{
|
|
path: '/',
|
|
component: () => import('@/views/layout/MainLayout.vue'),
|
|
meta: { requiresAuth: true },
|
|
children: [
|
|
{
|
|
path: '',
|
|
redirect: '/dashboard',
|
|
},
|
|
{
|
|
path: 'dashboard',
|
|
component: () => import('@/views/dashboard/DashboardView.vue'),
|
|
},
|
|
{
|
|
path: 'apps',
|
|
component: () => import('@/views/apps/AppListView.vue'),
|
|
},
|
|
{
|
|
path: 'security',
|
|
component: () => import('@/views/security/SecurityCenterView.vue'),
|
|
},
|
|
{
|
|
path: 'docs',
|
|
component: () => import('@/views/docs/DocsCenterView.vue'),
|
|
},
|
|
{
|
|
path: 'packages',
|
|
component: () => import('@/views/billing/BillingView.vue'),
|
|
},
|
|
{
|
|
path: 'operation-logs',
|
|
component: () => import('@/views/logs/OperationLogView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:id',
|
|
component: () => import('@/views/apps/AppDetailView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:appId/im-config',
|
|
component: () => import('@/views/im/ImConfigView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:appId/push-config',
|
|
component: () => import('@/views/push/PushConfigView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:appId/im-webhooks',
|
|
component: () => import('@/views/im/ImWebhookView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:appId/im',
|
|
component: () => import('@/views/im/ImManagementView.vue'),
|
|
},
|
|
{
|
|
path: 'apps/:appId/update',
|
|
component: () => import('@/views/update/VersionManagementView.vue'),
|
|
},
|
|
{
|
|
path: 'accounts',
|
|
component: () => import('@/views/accounts/SubAccountView.vue'),
|
|
},
|
|
],
|
|
},
|
|
],
|
|
})
|
|
|
|
router.beforeEach((to) => {
|
|
const auth = useAuthStore()
|
|
if (to.meta.requiresAuth && !auth.token) {
|
|
return '/login'
|
|
}
|
|
if ((to.path === '/login' || to.path === '/register') && auth.token) {
|
|
return '/dashboard'
|
|
}
|
|
})
|
|
|
|
export default router
|