feat: add chat message
This commit is contained in:
@@ -24,7 +24,9 @@ export class User extends Model {
|
||||
return { token, expireTime: now + expireTime };
|
||||
}
|
||||
static async verifyToken(token: string) {
|
||||
return await checkToken(token, config.tokenSecret);
|
||||
const ct = await checkToken(token, config.tokenSecret);
|
||||
const tokenUser = ct.payload;
|
||||
return tokenUser;
|
||||
}
|
||||
static createUser(username: string, password?: string, description?: string) {
|
||||
const user = User.findOne({ where: { username } });
|
||||
@@ -79,6 +81,7 @@ User.init(
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'cf_user',
|
||||
paranoid: true,
|
||||
},
|
||||
);
|
||||
User.sync({ alter: true, logging: false })
|
||||
|
||||
Reference in New Issue
Block a user