feat(amazon): 实现商标筛查功能并优化用户体验

- 添加商标筛查面板和相关API接口- 实现Excel文件解析和数据过滤功能
- 添加文件上传进度跟踪和错误处理-优化空状态显示和操作引导- 实现tab状态持久化存储
- 添加订阅会员弹窗和付费入口
-优化文件选择和删除功能
- 改进UI样式和响应式布局
This commit is contained in:
2025-11-06 11:07:05 +08:00
parent 4e2ce48934
commit cfb70d5830
26 changed files with 1395 additions and 383 deletions

View File

@@ -1,9 +1,9 @@
export type HttpMethod = 'GET' | 'POST' | 'DELETE';
export const CONFIG = {
CLIENT_BASE: 'http://localhost:8081',
// RUOYI_BASE: 'http://8.138.23.49:8085',
RUOYI_BASE: 'http://192.168.1.89:8085',
SSE_URL: 'http://192.168.1.89:8085/monitor/account/events'
RUOYI_BASE: 'http://8.138.23.49:8085',
//RUOYI_BASE: 'http://192.168.1.89:8085',
SSE_URL: 'http://8.138.23.49:8085/monitor/account/events'
} as const;
function resolveBase(path: string): string {
@@ -31,8 +31,18 @@ async function getToken(): Promise<string> {
}
}
async function getUsername(): Promise<string> {
try {
const tokenModule = await import('../utils/token');
return tokenModule.getUsernameFromToken() || '';
} catch {
return '';
}
}
async function request<T>(path: string, options: RequestInit & { signal?: AbortSignal }): Promise<T> {
const token = await getToken();
const username = await getUsername();
let res: Response;
try {
@@ -43,6 +53,7 @@ async function request<T>(path: string, options: RequestInit & { signal?: AbortS
headers: {
'Content-Type': 'application/json;charset=UTF-8',
...(token ? { 'Authorization': `Bearer ${token}` } : {}),
...(username ? { 'username': username } : {}),
...options.headers
}
});
@@ -90,6 +101,7 @@ export const http = {
async upload<T>(path: string, form: FormData, signal?: AbortSignal) {
const token = await getToken();
const username = await getUsername();
let res: Response;
try {
@@ -98,7 +110,10 @@ export const http = {
body: form,
credentials: 'omit',
cache: 'no-store',
headers: token ? { 'Authorization': `Bearer ${token}` } : {},
headers: {
...(token ? { 'Authorization': `Bearer ${token}` } : {}),
...(username ? { 'username': username } : {})
},
signal
});
} catch (e) {