mirror of
https://github.com/whyour/qinglong.git
synced 2025-08-24 04:20:15 +08:00
修复日志查看和用户认证
This commit is contained in:
parent
386eff8a0b
commit
baa16d8ab2
|
@ -17,9 +17,12 @@ export default (app: Router) => {
|
||||||
let password = req.body.password;
|
let password = req.body.password;
|
||||||
fs.readFile(config.authConfigFile, 'utf8', function (err, data) {
|
fs.readFile(config.authConfigFile, 'utf8', function (err, data) {
|
||||||
if (err) console.log(err);
|
if (err) console.log(err);
|
||||||
var con = JSON.parse(data);
|
const authInfo = JSON.parse(data);
|
||||||
if (username && password) {
|
if (username && password) {
|
||||||
if (username == con.user && password == con.password) {
|
if (
|
||||||
|
username == authInfo.username &&
|
||||||
|
password == authInfo.password
|
||||||
|
) {
|
||||||
let token = jwt.sign(
|
let token = jwt.sign(
|
||||||
{ username, password },
|
{ username, password },
|
||||||
config.secret as any,
|
config.secret as any,
|
||||||
|
|
|
@ -38,7 +38,7 @@ const Log = () => {
|
||||||
const getLog = (node: any) => {
|
const getLog = (node: any) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
let url = `${node.parent}/${node.value}`;
|
let url = `${node.parent}/${node.value}`;
|
||||||
if (!node.isDir) {
|
if (!node.parent) {
|
||||||
url = node.value;
|
url = node.value;
|
||||||
}
|
}
|
||||||
request
|
request
|
||||||
|
|
Loading…
Reference in New Issue
Block a user