修复 JSON.parse 错误,修复删除环境变量名称过长

This commit is contained in:
whyour
2023-08-27 12:41:06 +08:00
parent 648b9c4520
commit e2bd15683e
9 changed files with 129 additions and 102 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import {
fileExist,
getNetIp,
getPlatform,
safeJSONParse,
} from '../config/util';
import config from '../config';
import * as fs from 'fs';
@@ -327,7 +328,7 @@ export default class UserService {
private getAuthInfo() {
const content = fs.readFileSync(config.authConfigFile, 'utf8');
return JSON.parse(content || '{}');
return safeJSONParse(content);
}
private updateAuthInfo(authInfo: any, info: any) {