mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
支持更换头像
This commit is contained in:
@@ -8,7 +8,7 @@ import path from 'path';
|
||||
export default class SshKeyService {
|
||||
private homedir = os.homedir();
|
||||
private sshPath = path.resolve(this.homedir, '.ssh');
|
||||
private sshConfigFilePath = path.resolve(this.homedir, '.ssh/config');
|
||||
private sshConfigFilePath = path.resolve(this.sshPath, 'config');
|
||||
|
||||
constructor(@Inject('logger') private logger: winston.Logger) {}
|
||||
|
||||
|
||||
@@ -221,6 +221,12 @@ export default class UserService {
|
||||
return { code: 200, message: '更新成功' };
|
||||
}
|
||||
|
||||
public async updateAvatar(avatar: string) {
|
||||
const authInfo = this.getAuthInfo();
|
||||
this.updateAuthInfo(authInfo, { avatar });
|
||||
return { code: 200, data: avatar, message: '更新成功' };
|
||||
}
|
||||
|
||||
public getUserInfo(): Promise<any> {
|
||||
return new Promise((resolve) => {
|
||||
fs.readFile(config.authConfigFile, 'utf8', (err, data) => {
|
||||
|
||||
Reference in New Issue
Block a user