mirror of
https://github.com/HuLaSpark/HuLa.git
synced 2026-09-24 23:11:59 +08:00
* refactor(common): ♻️ login data init * refactor(common): ♻️ login refactor * fix(common): 🐛 mobile set auto login after login * fix(common): 🐛 ios splash screen auto login * fix(common): 🐛 ios splash screen close * fix(mobile): 🐛 personal information display * refactor(global import): ♻️ refactoring global import to distinguish pc from mobile * fix(common): 🐛 fix mobile layout * fix(common): 🐛 set mobile safe area in app.vue * fix(common): 🐛 delete SafeAreaComponent * build(build): 📦 improve mobile and pc component import files * refactor(common): ♻️ remove mobile client * build(build): 📦 remove components*.d.ts * fix(common): 🐛 android safe area * fix(common): 🐛 android safe area * fix(mobile): 🐛 refine the message text for withdrawal, and add a mobile phone clipboard * fix(system): 🐛 fix storage logic causing logins to fail fix white screen issues on some ios pages due to top safe zone * feat(mobile): ✨ adapt mobile chat room input box * fix(mobile): 🐛 modify Android ports and some mobile styles --------- Co-authored-by: wanwanruwoxin <254693270@qq.com> Co-authored-by: 乾乾 <1046762075@qq.com> Co-authored-by: kazai <kazai_xiaohe@gmail.com>
25 lines
887 B
TypeScript
Vendored
25 lines
887 B
TypeScript
Vendored
const MOBILE_PLATFORMS = new Set(['android', 'ios'])
|
|
|
|
/** 标准化平台标识,确保比较逻辑一致 */
|
|
const normalizePlatform = (platform?: string) => {
|
|
return platform?.trim().toLowerCase()
|
|
}
|
|
|
|
/** 判断是否为需要加载移动端组件的平台 */
|
|
export const isMobilePlatform = (platform?: string) => {
|
|
return MOBILE_PLATFORMS.has(normalizePlatform(platform) ?? '')
|
|
}
|
|
|
|
/** 根据平台返回自动导入插件需要扫描的组件目录 */
|
|
export const getComponentsDirs = (platform?: string) => {
|
|
if (isMobilePlatform(platform)) {
|
|
return ['src/components/**', 'src/mobile/components/**']
|
|
}
|
|
return ['src/components/**']
|
|
}
|
|
|
|
/** 按平台选择对应的组件类型声明文件路径 */
|
|
export const getComponentsDtsPath = (platform?: string) => {
|
|
return isMobilePlatform(platform) ? 'src/typings/components.mobile.d.ts' : 'src/typings/components.pc.d.ts'
|
|
}
|