中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
文档提示到,可以将session 减少到 16 个以内 ,还有其他的操作方式吗??
router.replaceUrl({ url: 'pages/IndexPage', }); //切到 indexpage indexPage 是一个首页通过tabs 切换组件 Column() { Tabs({ index: this.activeIndex }) { ForEach(this.HomeTabs, (item: tabsModule, index: number) => { TabContent() { if (this.CswCourseList.length) { if (index === 0) { HomePage() } else if (index === 1) { SolveProblemPage() } else if (index === 2) { FirstCoursePage({ courseList: this.CswCourseList }) } else if (index === 3) { MinePage() } } else { if (index === 0) { HomePage() } else if (index === 1) { SolveProblemPage() } else if (index === 2) { MinePage() } } } .tabBar(this.TabBar(item, index)) // 导航栏设置 }) } .barPosition(BarPosition.End) .scrollable(false) .onTabBarClick((index: number) => { this.activeIndex = index }) } //indexpage的数据加载没有问题,但是但是HomePage 加载就会报错!!!! //homePage aboutToAppear() { emitter.on("SelectHomePage", async () => { this.userInfo = UserInfoManger.getInstance().getUserInfo() //用户信息 promptAction.showToast({ message: "触发广播事件", duration: 3000 }) await this.getData() console.info("VnInfoList 数据", JSON.stringify(this.VnInfoList)); }) } //请求逻辑 async getData() { try { const results = await Promise.all([ getTestDay(this.userInfo.appEName), getBannerList(), getHomeMaterialList(this.userInfo.appEName, 0), getVnInfo(this.userInfo.appID as number, this.userInfo.appEName), getMyMaterialList(this.userInfo.appEName) ]) // 更新状态 this.ClockState = results[0]; this.bannerList = results[1]; this.HomeMaterialList = results[2]; this.VnInfoList = results[3].vnList; this.MyMaterialList = results[4]; } catch (error) { console.error("请求错误", JSON.stringify(error)); promptAction.showToast({ message: error.message || "请求错误", duration: 2000, }); } }
微信扫码分享