feat(app): FE 骨架协调提交——core 网络层/路由注册/页面桩
- DevEco 6.1 模板工程(API 6.1.1(24),bundle com.xiangsilian.app)+ INTERNET 权限 - core/:ApiClient(统一信封解包+401 自动刷新重试)/AuthStore(双令牌持久化+ dev-token 通道+baseUrl 可配)/ContextHolder/ApiTypes —— 全部通过 ArkTS 严格编译 - 七页面注册 main_pages(桩态);Index 按登录态分流;页面间约定 router 路径跳转 零 import(并行冲突隔离) - app/README:CLI 构建门禁命令与代码约定
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 应用入口:按登录态分流到登录页或主页。
|
||||
* 页面间一律 router 路径跳转(页面已全部注册 main_pages),跨任务零 import。
|
||||
*/
|
||||
|
||||
import { router } from '@kit.ArkUI'
|
||||
import { AuthStore } from '../core/AuthStore'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Index {
|
||||
aboutToAppear(): void {
|
||||
const target = AuthStore.isLoggedIn() ? 'pages/HomePage' : 'pages/LoginPage'
|
||||
router.replaceUrl({ url: target })
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
LoadingProgress().width(48).height(48)
|
||||
Text('美搭')
|
||||
.fontSize(20)
|
||||
.fontWeight(FontWeight.Bold)
|
||||
.margin({ top: 12 })
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.justifyContent(FlexAlign.Center)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user