任务面板支持查看最新日志

This commit is contained in:
hanhh
2021-06-24 18:55:26 +08:00
parent 4d4d31431d
commit e03c64dceb
4 changed files with 28 additions and 9 deletions
+6 -5
View File
@@ -5,6 +5,7 @@ import * as fs from 'fs';
import config from '../config';
import jwt from 'jsonwebtoken';
import { createPassword } from '../config/util';
import crypto from 'crypto';
const route = Router();
export default (app: Router) => {
@@ -41,11 +42,11 @@ export default (app: Router) => {
username == authInfo.username &&
password == authInfo.password
) {
let token = jwt.sign(
{ username, password },
config.secret as any,
{ expiresIn: 60 * 60 * 24 * 7, algorithm: 'HS384' },
);
const data = createPassword(50, 100);
let token = jwt.sign({ data }, config.secret as any, {
expiresIn: 60 * 60 * 24 * 3,
algorithm: 'HS384',
});
fs.writeFileSync(
config.authConfigFile,
JSON.stringify({