feat: 下载page到本地

This commit is contained in:
2024-10-08 17:10:32 +08:00
parent 54e3ccb3ff
commit 8cdd54af04
9 changed files with 361 additions and 8 deletions

View File

@@ -21,15 +21,15 @@ export class User extends Model {
declare needChangePassword: boolean;
declare description: string;
declare data: UserData;
declare type: string; // user | org
declare type: string; // user | org | visitor
declare owner: string;
declare orgId: string;
declare email: string;
async createToken(uid?: string) {
const { id, username } = this;
const { id, username, type } = this;
const expireTime = 60 * 60 * 24 * 7; // 7 days
const now = new Date().getTime();
const token = await createToken({ id, username, uid }, config.tokenSecret);
const token = await createToken({ id, username, uid, type }, config.tokenSecret);
return { token, expireTime: now + expireTime };
}
static async verifyToken(token: string) {