后台: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
+13 -12
View File
@@ -1,5 +1,5 @@
// 亲密度等级表
import { readJsonFile } from '../util'
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicRoleFriendLv {
@@ -17,17 +17,18 @@ export interface DicRoleFriendLv {
}
const str = readJsonFile(FILENAME.DIC_ROLE_FRIEND_LEVEL);
let arr = JSON.parse(str);
export const dicRoleFriendLv = new Map<number, DicRoleFriendLv>();
let sum = 0;
export function loadRoleFriendLv() {
arr.forEach(o => {
sum += o.value;
o.sum = sum;
dicRoleFriendLv.set(o.lv, o);
});
let arr = readFileAndParse(FILENAME.DIC_ROLE_FRIEND_LEVEL);
arr = undefined;
let sum = 0;
arr.forEach(o => {
sum += o.value;
o.sum = sum;
dicRoleFriendLv.set(o.lv, o);
});
arr = undefined;
}