登录
This commit is contained in:
parent
92b91dd65e
commit
ad584a9860
@ -7,7 +7,9 @@ import { deviceInfo } from '@kit.BasicServicesKit';
|
|||||||
@Preview
|
@Preview
|
||||||
@Component
|
@Component
|
||||||
export struct LoginComp {
|
export struct LoginComp {
|
||||||
@Link loginstatus: boolean;
|
@Link YX_accid:string
|
||||||
|
@Link YX_token:string
|
||||||
|
|
||||||
@State
|
@State
|
||||||
mobile: string = ''
|
mobile: string = ''
|
||||||
@State
|
@State
|
||||||
@ -93,6 +95,8 @@ export struct LoginComp {
|
|||||||
console.info(`Response login succeeded: ${res}`);
|
console.info(`Response login succeeded: ${res}`);
|
||||||
let json:LoginInfo = JSON.parse(res+'') as LoginInfo;
|
let json:LoginInfo = JSON.parse(res+'') as LoginInfo;
|
||||||
if(json.code=='1'||json.code=='200') {
|
if(json.code=='1'||json.code=='200') {
|
||||||
|
this.YX_token=json.YX_token
|
||||||
|
this.YX_accid=json.YX_accid
|
||||||
preferenceStore.setItemString(BasicConstant.YX_accid,json.YX_accid)
|
preferenceStore.setItemString(BasicConstant.YX_accid,json.YX_accid)
|
||||||
preferenceStore.setItemString(BasicConstant.YX_token,json.YX_token)
|
preferenceStore.setItemString(BasicConstant.YX_token,json.YX_token)
|
||||||
this.arrToStringSpecialy(json.special)
|
this.arrToStringSpecialy(json.special)
|
||||||
@ -122,8 +126,6 @@ export struct LoginComp {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
this.loginstatus=true
|
|
||||||
authStore.setUser(objs.data)
|
authStore.setUser(objs.data)
|
||||||
// emitter.emit({ eventId: 100401 })
|
// emitter.emit({ eventId: 100401 })
|
||||||
logger.info('Response state'+state);
|
logger.info('Response state'+state);
|
||||||
|
|||||||
@ -32,7 +32,11 @@ struct Home {
|
|||||||
this.activeIndex = e.data.activeIndex
|
this.activeIndex = e.data.activeIndex
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.login(AppConfig.userId, AppConfig.userToken)//暂时隐蔽云信登录
|
if(AppConfig.userId!='')
|
||||||
|
{
|
||||||
|
this.login(AppConfig.userId, AppConfig.userToken)//暂时隐蔽云信登录
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeIndex() {
|
onChangeIndex() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user