后台: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
+14 -13
View File
@@ -1,5 +1,5 @@
// 关卡表
import {decodeArrayListStr, readWarJsonFileList} from '../util'
import {decodeArrayListStr, readWarJsonFileAndParse} from '../util'
export interface DicWarJson {
@@ -49,18 +49,19 @@ export interface DicWarJson {
}
export const dicWarJson = new Map<number, Array<DicWarJson>>();
readWarJsonFileList().forEach(str => {
let arr = JSON.parse(str);
let warjson = new Array<DicWarJson>();
let warid = 0;
arr.forEach(o => {
o.attribute = parseAttribute(o.attribute);
warid = o.warId;
warjson.push(o);
});
dicWarJson.set(warid, warjson);
})
export function loadWarJson() {
readWarJsonFileAndParse().forEach(arr => {
let warjson = new Array<DicWarJson>();
let warid = 0;
arr.forEach(o => {
o.attribute = parseAttribute(o.attribute);
warid = o.warId;
warjson.push(o);
});
dicWarJson.set(warid, warjson);
})
}
export function parseAttribute(str: string) {
let result = new Array<{ id: number, val: number }>();