后台: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 DicGuildAuth {
|
||||
@@ -11,13 +11,13 @@ export interface DicGuildAuth {
|
||||
|
||||
}
|
||||
|
||||
const str = readJsonFile(FILENAME.DIC_GUILD_AUTH);
|
||||
let arr = JSON.parse(str);
|
||||
|
||||
export const dicGuildAuth = new Map<number, number[]>();
|
||||
export function loadGuildAuth() {
|
||||
let arr = readFileAndParse(FILENAME.DIC_GUILD_AUTH);
|
||||
|
||||
arr.forEach(o => {
|
||||
let authority = parseNumberList(o.authority)
|
||||
dicGuildAuth.set(o.id, authority);
|
||||
});
|
||||
arr = undefined;
|
||||
arr.forEach(o => {
|
||||
let authority = parseNumberList(o.authority)
|
||||
dicGuildAuth.set(o.id, authority);
|
||||
});
|
||||
arr = undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user