更新注册等相关逻辑
This commit is contained in:
@@ -20,7 +20,7 @@ export { BasicConstant } from './src/main/ets/constants/BasicConstant'
|
||||
|
||||
export { preferenceStore } from './src/main/ets/utils/PreferenceStore'
|
||||
|
||||
export { LoginInfo,Data } from './src/main/ets/models/LoginInfoModel'
|
||||
export { LoginInfo,Data,SpecialDisease } from './src/main/ets/models/LoginInfoModel'
|
||||
|
||||
export { DataWebModel,DataWebModels } from './src/main/ets/models/DataWebModel'
|
||||
|
||||
|
||||
@@ -34,5 +34,12 @@ export class BasicConstant {
|
||||
static readonly expertVideoTypeList = BasicConstant.urlExpertAPI + "expertVideoTypeList";
|
||||
static readonly videoByKeyWordsNew = BasicConstant.urlExpertApp + "videoByKeyWordsNew";
|
||||
static readonly tagList = BasicConstant.urlExpertApp + "tagList";
|
||||
static readonly meetingListBySearch = BasicConstant.urlExpertAPI + "meetingListBySearch";
|
||||
|
||||
static readonly province=['全国','北京市','天津市','河北省','山西省'
|
||||
,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省'
|
||||
,'安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省',
|
||||
'广西壮族自治区','海南省','重庆市','四川省','贵州省','云南省','西藏自治区',
|
||||
'陕西省','甘肃省','宁夏回族自治区','新疆维吾尔自治区','台湾省','香港特别行政区','澳门特别行政区']
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { List } from '@kit.ArkTS';
|
||||
export interface LoginInfo{
|
||||
special: List<SpecialDisease> ;
|
||||
special: SpecialDisease[] ;
|
||||
YX_accid:string ;
|
||||
code:string;
|
||||
data:Data;
|
||||
@@ -9,7 +9,7 @@ export interface LoginInfo{
|
||||
message:string;
|
||||
}
|
||||
|
||||
interface SpecialDisease{
|
||||
export interface SpecialDisease{
|
||||
diseaseName:string;
|
||||
diseaseUuid:string;
|
||||
}
|
||||
@@ -52,4 +52,5 @@ export interface Data{
|
||||
state:number;
|
||||
realName:string;
|
||||
specialy:Array<object>;
|
||||
|
||||
}
|
||||
@@ -28,8 +28,8 @@ export interface ExpertData{
|
||||
certificateImg:string;
|
||||
birthDate:string;
|
||||
isStar:number;
|
||||
countyId:number;
|
||||
cityId:number;
|
||||
countyId:string;
|
||||
cityId:string;
|
||||
email:string;
|
||||
photo:string;
|
||||
qrcode:string;
|
||||
@@ -43,7 +43,7 @@ export interface ExpertData{
|
||||
nation:number;
|
||||
wechat_qrcode:string;
|
||||
sex:number;
|
||||
provId:number;
|
||||
provId:string;
|
||||
uuid:string;
|
||||
intro:string;
|
||||
certificate:string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { preferences } from '@kit.ArkData'
|
||||
import { ExpertData } from '../models/RequestDefaultModel'
|
||||
import { logger } from '../utils/logger'
|
||||
|
||||
export const AUTH_STORE_KEY = 'perfactAuth'
|
||||
|
||||
@@ -14,30 +15,27 @@ class PerfactAuth {
|
||||
}
|
||||
|
||||
async setUser(phone:string,user: ExpertData) {
|
||||
AppStorage.setOrCreate(phone, user)
|
||||
|
||||
await this.getStore().put(phone, JSON.stringify(user))
|
||||
await this.getStore().flush()
|
||||
}
|
||||
|
||||
async updateUser(phone:string,user: ExpertData) {
|
||||
AppStorage.setOrCreate(phone, user)
|
||||
|
||||
await this.getStore().put(phone, JSON.stringify(user))
|
||||
await this.getStore().flush()
|
||||
}
|
||||
|
||||
async delUser(phone:string) {
|
||||
AppStorage.setOrCreate(phone, {})
|
||||
await this.getStore().put(phone, '{}')
|
||||
await this.getStore().flush()
|
||||
}
|
||||
|
||||
initUser(phone:string) {
|
||||
const json = this.getStore().getSync(AUTH_STORE_KEY, '{}') as string
|
||||
AppStorage.setOrCreate(AUTH_STORE_KEY, JSON.parse(json))
|
||||
}
|
||||
|
||||
|
||||
getUser(phone:string) {
|
||||
return AppStorage.get<ExpertData>(phone) || {} as ExpertData
|
||||
// logger.info('个人资料initUser'+this.getStore().getSync(phone,'{}'));
|
||||
return JSON.parse(this.getStore().getSync(phone,'{}')+'') as ExpertData
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class PreferenceStore {
|
||||
this.getStore().flush()
|
||||
}
|
||||
getItemString(keyword: string) {
|
||||
return this.getStore().getSync(keyword,'')
|
||||
return this.getStore().getSync(keyword,'') as string
|
||||
}
|
||||
getItemBooleanT(keyword: string):boolean {
|
||||
return this.getStore().getSync(keyword,true) as boolean
|
||||
|
||||
@@ -3,7 +3,7 @@ import { router } from '@kit.ArkUI'
|
||||
import { Data } from '../models/LoginInfoModel'
|
||||
import { ExpertData } from '../models/RequestDefaultModel'
|
||||
import { BusinessError } from '@kit.BasicServicesKit'
|
||||
|
||||
import { logger } from '../utils/logger'
|
||||
export interface HdUser {
|
||||
id: string
|
||||
username: string
|
||||
@@ -63,6 +63,7 @@ class AuthStore {
|
||||
}
|
||||
|
||||
getUser() {
|
||||
logger.info('个人资料initUser'+ (AppStorage.get<Data>('user') || {} as Data)+'');
|
||||
return AppStorage.get<Data>('user') || {} as Data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user