后台:json上传
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// 百家学宫列表
|
||||
import { readJsonFile, parseNumberList } from '../util'
|
||||
import { readFileAndParse, parseNumberList } from '../util'
|
||||
import { FILENAME } from '../../consts'
|
||||
|
||||
export interface DicSchool {
|
||||
@@ -12,15 +12,15 @@ export interface DicSchool {
|
||||
readonly upAttribute: Array<number>;
|
||||
}
|
||||
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_SCHOOL);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicSchool = new Map<number, DicSchool>();
|
||||
export function loadSchool() {
|
||||
|
||||
arr.forEach(o => {
|
||||
o.upAttribute = parseNumberList(o.upAttribute)
|
||||
dicSchool.set(o.id, o);
|
||||
});
|
||||
let arr = readFileAndParse(FILENAME.DIC_SCHOOL);
|
||||
|
||||
arr = undefined;
|
||||
arr.forEach(o => {
|
||||
o.upAttribute = parseNumberList(o.upAttribute)
|
||||
dicSchool.set(o.id, o);
|
||||
});
|
||||
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user