fix: 更新 examinerLoginInfo 为 examinerInfo,优化代码一致性

This commit is contained in:
wangzhongjie 2025-04-02 14:24:53 +08:00
commit c2e9449a57
3 changed files with 31 additions and 9 deletions

View File

@ -51,6 +51,28 @@ export interface TimeSynchronizationRspBody {
paraKdid?: string
kdid?: string
}
export interface examinerLoginRsp {
bz1?: string;
fieldid?: string
kchp?: string
ksdd?: string
kscx?: string
kskm?: string
kslx?: string
kssycs?: string
ksxl?: string
ksy1?: string
kszt?: string
lsh?: string
sfzmhm?: string
xb?: string
xh?: string
xldm?: string
xm?: string
yycs?: string
ksy1sfzmhm?: string
}
interface UploadExamCarCheckResultRsp {
head: Head

View File

@ -6,7 +6,7 @@ import imageBtn from './compontents/imageBtn';
import { UserLoginType } from '../model/ExaminerLogin';
import { BusinessError } from '@ohos.base';
import { examinerLogin } from '../api/login';
import { ApiResponseType, CarInfoType, ExaminerInfoType, ExaminerLoginInfo } from '../model/index';
import { CarInfoType, ExaminerLoginInfo } from '../model/index';
import { CryptoJS } from '@ohos/crypto-js';
@ -108,8 +108,8 @@ struct Index {
this.limit = true
try {
// TODO
examinerLogin(param).then((res: ApiResponseType) => {
AppStorage.setOrCreate<ExaminerInfoType>('examinerInfo', res?.examinerLoginRsp?.body)
examinerLogin(param).then((res: ESObject) => {
// AppStorage.setOrCreate('examinerInfo', res?.examinerLoginRsp?.body)
console.log('res?.examinerLoginRsp?.head?.resultCode', res?.examinerLoginRsp?.head?.resultCode,
JSON.stringify(res))
this.errorDialog.close()
@ -132,7 +132,7 @@ struct Index {
console.log('res11', JSON.stringify(res))
const examinerLoginInfo: ExaminerLoginInfo = res.examinerLoginRsp.body
examinerLoginInfo.username = this.inputTextArr[0]
AppStorage.setOrCreate<ExaminerLoginInfo>('examinerLoginInfo', examinerLoginInfo)
AppStorage.setOrCreate<ExaminerLoginInfo>('examinerInfo', examinerLoginInfo)
}).catch((err: BusinessError) => {
console.log('jiangsong12', JSON.stringify(err))
this.errorDialog.close()

View File

@ -220,7 +220,7 @@ struct UserInfo {
this.currentUser = EmptyCandidateObject
this.filePhoto = new FilePhoto(this.context);
this.singlePlay = AppStorage.get<boolean>('singlePlay')
this.examinerLoginInfo = AppStorage.get<ExaminerLoginInfo>('examinerLoginInfo')
this.examinerLoginInfo = AppStorage.get<ExaminerLoginInfo>('examinerInfo')
this.carInfo = AppStorage.get<CarInfoType>('carInfo')
//语音功能on
// new WebRTCVoice(this.context);
@ -340,7 +340,7 @@ struct UserInfo {
}, 200)
this.examinerLoginInfo.ksyh = res.ksy1sfzmhm
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('lsh', res.lsh)
// const { examSubject } = this.carInfo;
if (this.singlePlay) {
@ -455,7 +455,7 @@ struct UserInfo {
this.lsh = this.currentUser.lsh
this.examinerLoginInfo.ksyh = this.currentUser.ksy1sfzmhm
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('lsh', this.lsh)
}
@ -747,7 +747,7 @@ struct UserInfo {
this.currentUser.ksy2 = this.examinerLoginInfo.kgxm
AppStorage.setOrCreate('lsh', this.currentUser.lsh)
this.examinerLoginInfo.ksyh = this.currentUser.ksy1sfzmhm
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo)
}, 200)
} else {
this.currentUser = EmptyCandidateObject
@ -1054,7 +1054,7 @@ struct UserInfo {
const temp = await writeObjectOut(param);
AppStorage.setOrCreate('lsh', this.currentUser.lsh)
this.examinerLoginInfo.ksyh = this.currentUser.ksy1sfzmhm
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
AppStorage.setOrCreate('examinerInfo', this.examinerLoginInfo)
return temp
}