This commit is contained in:
2020-07-28 21:51:28 +08:00
parent d6735bd7fa
commit 8604f7aff7
19 changed files with 824 additions and 778 deletions

View File

@@ -108,4 +108,32 @@ function DBUser.hadPermission(key)
return rolePermission[key] or false
end
function DBUser.isWhiteUser(userName, callback)
if isNilOrEmpty(userName) then
Utl.doCallback(callback, false)
return false
end
if DBUser.whiteNames == nil then
local url = Utl.urlAddTimes(joinStr(CLVerManager.self.baseUrl, "/whitList.json"))
WWWEx.get(
url,
CLAssetType.text,
function(content)
DBUser.whiteNames = json.decode(content)
Utl.doCallback(callback, DBUser.whiteNames[userName])
end,
function()
Utl.doCallback(callback, false)
end,
nil,
true,
1
)
return false
else
Utl.doCallback(callback, DBUser.whiteNames[userName])
return DBUser.whiteNames[userName]
end
end
return DBUser