mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
任务面板支持查看最新日志
This commit is contained in:
+6
-5
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user