后台: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
+9 -9
View File
@@ -1,5 +1,5 @@
// 百家学宫列表
import { readJsonFile } from '../util'
import { readFileAndParse } from '../util'
import { FILENAME } from '../../consts'
export interface DicSchoolRate {
@@ -18,14 +18,14 @@ export interface DicSchoolRate {
readonly assiAttrAddValue: number;
}
const str = readJsonFile(FILENAME.DIC_SCHOOL_RATE);
let arr = JSON.parse(str);
export const dicSchoolRate = new Map<string, DicSchoolRate>();
export function loadSchoolRate() {
arr.forEach(o => {
dicSchoolRate.set(`${o.stars}_${o.colorstars}_${o.quality}`, o);
});
let arr = readFileAndParse(FILENAME.DIC_SCHOOL_RATE);
arr = undefined;
arr.forEach(o => {
dicSchoolRate.set(`${o.stars}_${o.colorstars}_${o.quality}`, o);
});
arr = undefined;
}