✨ feat(core): 实现管理端后台界面及核心功能模块
* 初始化后台管理布局与路由框架 * 新增文件管理、仪表盘、系统设置及日志视图 * 实现文件上传预签名、提取流程及发送记录管理 * 构建常用组件库如模态框、表格、分页及进度条 * 引入多语言支持(中英文)及主题切换功能 * 封装后台业务逻辑 Hooks 和数据持久化存储功能
This commit is contained in:
1 parent
925c6450ac
commit
8badb80600
114 files changed
+18812
No files matched your search
@@ -0,0 +1,25 @@
|
||||
const CODE_PATTERN = /^[A-Za-z0-9]+$/
|
||||
|
||||
export const isValidRetrievalCode = (value: string): boolean => {
|
||||
const code = value.trim()
|
||||
return (code.length === 5 || code.length === 8) && CODE_PATTERN.test(code)
|
||||
}
|
||||
|
||||
export const parseRetrievalCode = (value: string): string => {
|
||||
const raw = value.trim()
|
||||
if (isValidRetrievalCode(raw)) return raw
|
||||
try {
|
||||
const url = new URL(raw)
|
||||
const queryCode = url.searchParams.get('code') || ''
|
||||
if (queryCode) return isValidRetrievalCode(queryCode) ? queryCode : ''
|
||||
if (url.hash) {
|
||||
const hash = url.hash.startsWith('#') ? url.hash.slice(1) : url.hash
|
||||
const query = hash.includes('?') ? hash.slice(hash.indexOf('?') + 1) : hash
|
||||
const hashCode = new URLSearchParams(query).get('code') || ''
|
||||
return isValidRetrievalCode(hashCode) ? hashCode : ''
|
||||
}
|
||||
return ''
|
||||
} catch {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user