cookie
This commit is contained in:
parent
691af9e35c
commit
ebeea4da75
@ -1,5 +1,5 @@
|
||||
import { TabBarComp } from '../pages/Tabbar/TabBarComp';
|
||||
import { BasicConstant, themeManager,hdHttp, HdResponse, authStore } from '@itcast/basic';
|
||||
import { BasicConstant, themeManager,hdHttp, HdResponse, authStore, preferenceStore } from '@itcast/basic';
|
||||
import { emitter } from '@kit.BasicServicesKit';
|
||||
import { common } from '@kit.AbilityKit';
|
||||
import { promptAction } from '@kit.ArkUI';
|
||||
@ -7,6 +7,7 @@ import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { patientDbManager, PatientEntity } from '@itcast/basic';
|
||||
import { NimRepository } from '../entryability/NimRepository'
|
||||
import { AppConfig } from '../constants/AppConfig'
|
||||
import { HashMap } from '@kit.ArkTS';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -26,6 +27,20 @@ struct Home {
|
||||
}
|
||||
}
|
||||
|
||||
getHcp_tokenData() {
|
||||
const hashMap: HashMap<string, string> = new HashMap();
|
||||
hdHttp.httpReq<string>(BasicConstant.checkUser,hashMap).then(async (res: HdResponse<string>) => {
|
||||
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>
|
||||
if(json.code == '200') {
|
||||
preferenceStore.setItemString(BasicConstant.EXPERT_HCP_TOKEN,String(json.data['hcp_token']))
|
||||
} else {
|
||||
console.error('hcp_token:'+json.message)
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
console.info(`hcp_token: ${err}`);
|
||||
})
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
emitter.on({ eventId: 10000 }, (e) => {
|
||||
if (e.data && e.data.activeIndex) {
|
||||
@ -57,6 +72,7 @@ struct Home {
|
||||
this.onChangeIndex()
|
||||
// emitter.emit({eventId:BasicConstant.notification_home_tab_change},{data:{'changeIndex':this.activeIndex}})
|
||||
// this.loadPatients();
|
||||
this.getHcp_tokenData()
|
||||
}
|
||||
|
||||
onPageHide(): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user