bug修复
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore,RequestDefaultModel } from '@itcast/basic'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { BusinessError, emitter } from '@kit.BasicServicesKit';
|
||||
import { HeroPopWindow } from '@itcast/basic/src/main/ets/Views/HeroPopWindow'
|
||||
import HashMap from '@ohos.util.HashMap'
|
||||
import { router } from '@kit.ArkUI'
|
||||
@@ -49,6 +49,16 @@ export struct HeaderView {
|
||||
aboutToAppear(): void {
|
||||
this.uploadUserDataAction();
|
||||
this.uploadBackImgAction();
|
||||
emitter.on({ eventId: BasicConstant.notification_home_tab_change }, (eventData: emitter.EventData) => {
|
||||
if (eventData.data?.changeIndex === 2) {
|
||||
this.uploadUserDataAction();
|
||||
this.uploadBackImgAction();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
emitter.off(BasicConstant.notification_home_tab_change)
|
||||
}
|
||||
|
||||
uploadUserDataAction() {
|
||||
@@ -61,6 +71,7 @@ export struct HeaderView {
|
||||
let json:callBackData = JSON.parse(res+'') as callBackData;
|
||||
if(json.code == 1 && json.expert && typeof json.expert === 'object') {
|
||||
authStore.updateUser(json.expert)
|
||||
this.photoPath = BasicConstant.urlImage+json.expert.photo;
|
||||
console.log('用户信息成功:', authStore.getUser().intro);
|
||||
} else {
|
||||
console.error('用户信息失败:'+json.message)
|
||||
|
||||
Reference in New Issue
Block a user