仰望星辰工作室

better-staridc-MNBT

Z zfhsh first commit 2 个月前
1/**
2 * 用户中心(account SPA)跳转工具
3 *
4 * account 入口为 {routeBase}account,内部为 hash 路由(#/profile、#/hosting、#/balance ...)。
5 * 未登录时 account 路由守卫会自动转跳其登录页,登录后回跳。
6 * 用途:home 前台只做展示,账户/资产管理/下单等操作统一跳转 account 承载。
7 *
8 * @param {string} [path] account 内部路径(不带 #),空则跳用户中心首页(/dashboard)
9 * @returns {string} 完整页面 URL
10 */
11export function accountUrl(path = '') {
12 const boot = window.__TD_BOOT__ || {}
13 const base = (boot.routeBase || '/index.php?_r=') + 'account'
14 return path ? base + '#/' + String(path).replace(/^\//, '') : base
15}