|
@@ -53,14 +53,14 @@ class UserState {
|
|
|
@computed get menuBtnText() {
|
|
|
return this.userInfo.name || this.userInfo.account
|
|
|
}
|
|
|
- @action login(values: iFromValues) {
|
|
|
- apiLogin(values).then(({ code = -1, data }) => {
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- saveUserInfo(data)
|
|
|
- this.userInfo = data
|
|
|
- history.push('/')
|
|
|
- }
|
|
|
- })
|
|
|
+ @action async login(values: iFromValues) {
|
|
|
+ const { code = -1, data } = await apiLogin(values)
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ await this.getProjectInfo()
|
|
|
+ saveUserInfo(data)
|
|
|
+ this.userInfo = data
|
|
|
+ history.push('/')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@action updateUserInfo(values: any) {
|