修复日志查看和用户认证

This commit is contained in:
whyour
2021-03-21 18:21:37 +08:00
parent 386eff8a0b
commit baa16d8ab2
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -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,