feat: add me

This commit is contained in:
2024-10-14 16:23:29 +08:00
parent 1eb65859e6
commit 64f89b60dc
5 changed files with 82 additions and 118 deletions

View File

@@ -25,6 +25,7 @@ export class User extends Model {
declare owner: string;
declare orgId: string;
declare email: string;
declare avatar: string;
async createToken(uid?: string) {
const { id, username, type } = this;
const expireTime = 60 * 60 * 24 * 7; // 7 days
@@ -85,6 +86,7 @@ export class User extends Model {
description: this.description,
needChangePassword: this.needChangePassword,
type: this.type,
avatar: this.avatar,
orgs,
};
}
@@ -131,6 +133,10 @@ User.init(
type: DataTypes.STRING,
allowNull: true,
},
avatar: {
type: DataTypes.STRING,
allowNull: true,
},
salt: {
type: DataTypes.STRING,
allowNull: true,