diff --git a/back/api/auth.ts b/back/api/auth.ts index 8a30cb96..004f2721 100644 --- a/back/api/auth.ts +++ b/back/api/auth.ts @@ -17,9 +17,12 @@ export default (app: Router) => { let password = req.body.password; fs.readFile(config.authConfigFile, 'utf8', function (err, data) { if (err) console.log(err); - var con = JSON.parse(data); + const authInfo = JSON.parse(data); if (username && password) { - if (username == con.user && password == con.password) { + if ( + username == authInfo.username && + password == authInfo.password + ) { let token = jwt.sign( { username, password }, config.secret as any, diff --git a/src/pages/log/index.tsx b/src/pages/log/index.tsx index 5b426087..3eb5b428 100644 --- a/src/pages/log/index.tsx +++ b/src/pages/log/index.tsx @@ -38,7 +38,7 @@ const Log = () => { const getLog = (node: any) => { setLoading(true); let url = `${node.parent}/${node.value}`; - if (!node.isDir) { + if (!node.parent) { url = node.value; } request