后台:json上传

This commit is contained in:
luying
2021-05-12 18:56:47 +08:00
parent 2fc5017af8
commit 148a11edab
102 changed files with 1675 additions and 1117 deletions
+11 -9
View File
@@ -1,5 +1,5 @@
// 主公经验
import {readJsonFile} from '../util'
import {readFileAndParse} from '../util'
import { FILENAME } from '../../consts'
export interface DicCharExp {
@@ -9,13 +9,15 @@ export interface DicCharExp {
readonly exp: number;
}
const str = readJsonFile(FILENAME.DIC_CHAR_EXP);
let arr = JSON.parse(str);
export const dicCharExp = new Map<number, number>();
export function loadCharExp() {
let exp = 0;
arr.forEach(o => {
exp += o.exp;
dicCharExp.set(o.level, exp);
});
let arr = readFileAndParse(FILENAME.DIC_CHAR_EXP);
let exp = 0;
arr.forEach(o => {
exp += o.exp;
dicCharExp.set(o.level, exp);
});
arr = undefined;
}