登录:初始登录onEntryData添加try catch

This commit is contained in:
luying
2022-06-13 16:56:58 +08:00
parent 106fb3ce39
commit 748588635a
@@ -105,6 +105,7 @@ export async function pushData(hasInit: boolean, role: RoleType, session: Fronte
} }
export async function getModuleData(type: string, data: { role: RoleType, session: FrontendOrBackendSession }, guildData: { hasGuild: boolean, guild?: GuildType, userGuild?: UserGuildType, guildResult?: any } = { hasGuild: false }) { export async function getModuleData(type: string, data: { role: RoleType, session: FrontendOrBackendSession }, guildData: { hasGuild: boolean, guild?: GuildType, userGuild?: UserGuildType, guildResult?: any } = { hasGuild: false }) {
try {
let { role, session } = data; let { role, session } = data;
const { roleId, serverId, roleName, guildCode } = role; const { roleId, serverId, roleName, guildCode } = role;
let { hasGuild, guild, userGuild, guildResult } = guildData; let { hasGuild, guild, userGuild, guildResult } = guildData;
@@ -208,6 +209,10 @@ export async function getModuleData(type: string, data: { role: RoleType, sessio
default: default:
return null; return null;
} }
} catch (e) {
console.error(e.stack);
return false
}
} }
function pushEntryData<T>(type: string, roleId: string, sid: string, param: T) { function pushEntryData<T>(type: string, roleId: string, sid: string, param: T) {