uu
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user