Refactor UUID generation, remove unused logger and encryption utilities, and clean up request handling

- Updated `generateUUID` function for improved readability and performance.
- Deleted `logger.ts`, `other.ts`, `request.ts`, `storage.ts`, `tansParams.ts`, and `validate.ts` as they were no longer needed.
- Simplified TypeScript configuration by removing unnecessary paths and aliases.
- Enhanced Vite configuration for better project structure and maintainability.
This commit is contained in:
DEV_DSW
2026-04-17 15:38:08 +08:00
parent b1dea9a5c2
commit 79bea4f107
360 changed files with 14495 additions and 30856 deletions

37
src/constants/channel.ts Normal file
View File

@@ -0,0 +1,37 @@
export interface ChannelItem {
id: string;
channelName: string;
channelUrl: string;
}
export const channelDictionary: Record<string, string> = {
fliggy: 'https://hotel.fliggy.com/ebooking/hotelBaseInfoUv.htm#/ebk/homeV1',
meituan: 'https://me.meituan.com/ebooking/merchant/product#/index',
douyin: 'https://life.douyin.com/p/travel-ari/hotel/price_amount_state?groupid=1816249020842116',
};
export function resolveChannel(value: string): { name?: string; url: string } {
const trimmed = value.trim();
if (!trimmed) {
return { url: '' };
}
if (channelDictionary[trimmed]) {
return { name: trimmed, url: channelDictionary[trimmed] };
}
if (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {
const entry = Object.entries(channelDictionary).find(([, url]) => url === trimmed);
if (entry) {
return { name: entry[0], url: trimmed };
}
try {
const hostname = new URL(trimmed).hostname;
return { name: hostname, url: trimmed };
} catch {
return { name: trimmed, url: trimmed };
}
}
return { name: trimmed, url: trimmed };
}

View File

@@ -0,0 +1,23 @@
export interface TaskCenterItem {
title: string;
desc: string;
id: string;
icon: string;
type?: 'channel';
}
export const taskCenterList: TaskCenterItem[] = [
{
title: '一键打开各渠道',
desc: '人工账号登录,为自动化操作做好准备',
id: 'channel-open',
icon: '渠',
type: 'channel',
},
{
title: '渠道房型',
desc: '销售渠道下的指定房型,管理开关房型',
id: 'room-type-manage',
icon: '房',
},
];