🎈 perf(热更新): 添加白名单热更新地址

This commit is contained in:
luying
2022-11-23 11:38:22 +08:00
parent 6981b4c3e3
commit f1c6a658da
11 changed files with 33 additions and 209 deletions

View File

@@ -11,13 +11,13 @@ const privateKey = fs.readFileSync(path.resolve(__dirname, `../resource/privateK
const publicKey = fs.readFileSync(path.resolve(__dirname, `../resource/publicKey`)); // 发推送加密的秘钥和privateKey不是一对
export async function checkWhiteList(env: string, ip: string, uid: number, serverId: number) {
export async function checkWhiteList(env: string, ip: string, uid: number) {
if(ip) {
let result = await WhiteListModel.checkIp(env, ip);
if(!!result) return true;
}
if(uid && serverId) {
let result = await WhiteListModel.checkUid(env, serverId, uid);
if(uid) {
let result = await WhiteListModel.checkUid(env, uid);
if(!!result) return true;
}
return false