后台: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
+10 -8
View File
@@ -1,4 +1,4 @@
import { readJsonFile } from '../util'
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicGkPvp {
@@ -8,12 +8,14 @@ export interface DicGkPvp {
readonly warType: number;
}
const str = readJsonFile(FILENAME.DIC_GK_PVP);
let arr = JSON.parse(str);
export const dicGkPvp = new Map<number, DicGkPvp>();
export const dicGkPvps = new Array<number>();
arr.forEach(o => {
dicGkPvp.set(o.war_id, o);
dicGkPvps.push(o.war_id);
});
export function loadGkPvp() {
let arr = readFileAndParse(FILENAME.DIC_GK_PVP);
arr.forEach(o => {
dicGkPvp.set(o.war_id, o);
dicGkPvps.push(o.war_id);
});
arr = undefined;
}