mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复重置用户名失败
This commit is contained in:
parent
c3072e7712
commit
05db2b1df8
|
@ -21,6 +21,8 @@ import dayjs from 'dayjs';
|
|||
import IP2Region from 'ip2region';
|
||||
import requestIp from 'request-ip';
|
||||
import uniq from 'lodash/uniq';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import isNil from 'lodash/isNil';
|
||||
import { shareStore } from '../shared/store';
|
||||
|
||||
@Service()
|
||||
|
@ -365,11 +367,16 @@ export default class UserService {
|
|||
public async resetAuthInfo(info: Partial<AuthInfo>) {
|
||||
const { retries, twoFactorActivated, password, username } = info;
|
||||
const authInfo = await this.getAuthInfo();
|
||||
await this.updateAuthInfo(authInfo, {
|
||||
retries,
|
||||
twoFactorActivated,
|
||||
password,
|
||||
username
|
||||
});
|
||||
const payload = pickBy(
|
||||
{
|
||||
retries,
|
||||
twoFactorActivated,
|
||||
password,
|
||||
username,
|
||||
},
|
||||
(x) => !isNil(x),
|
||||
);
|
||||
|
||||
await this.updateAuthInfo(authInfo, payload);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user