c1_lua/lua/app/module/account/account_manager.lua
2023-05-31 17:53:41 +08:00

28 lines
876 B
Lua

local AccountManager = class("AccountManager", BaseModule)
function AccountManager:showBindUI()
if DataManager.PlayerData:isBinded() then
return
end
UIManager:showUI("app/ui/game_setting/setting_binding_ui")
end
function AccountManager:showDeleteUI()
return UIManager:showUI("app/ui/game_setting/account_delete_ui")
end
function AccountManager:deleteAccount()
self:sendMessage(ProtoMsgType.FromMsgEnum.DeleteReq, {}, {}, self.onDeleteAccount, BIReport.ITEM_GET_TYPE.NONE)
end
function AccountManager:onDeleteAccount(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then -- 删除账号成功
local info = LocalData:getLastLoginInfo()
BIReport:postAccountDelete(info.type)
ModuleManager.LoginManager:goToLoginScene()
else
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DELETE_ACCOUNT_FAILED))
end
end
return AccountManager