登录流程优化 增加错误码弹窗提醒
This commit is contained in:
@@ -48,6 +48,9 @@ import { prodConfig } from "../../chat18x/config/env/prod";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
import AudioManager from "../../Main/Manager/AudioManager";
|
||||
import { Config18x } from "../../Main/Config/Config18x";
|
||||
import { MainController } from "../../chat18x/core/MainController";
|
||||
import GameRootUI from "../../Main/Common/GameRootUI";
|
||||
import { TipsPanel } from "../../chat18x/ui/panels/TipsPanel";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -115,6 +118,8 @@ export class PreloadUI extends Component {
|
||||
SDKManager.init();
|
||||
|
||||
this.preloadFiles();
|
||||
|
||||
this.mainScene.init();
|
||||
}
|
||||
|
||||
protected onDestroy(): void {}
|
||||
@@ -225,6 +230,8 @@ export class PreloadUI extends Component {
|
||||
this.reqMyInfo();
|
||||
this.reqGlobalData();
|
||||
this.reqAiCharacterData();
|
||||
} else {
|
||||
TipsPanel.show(LanguageUtils.getText("error_code_" + res.code));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,6 +245,8 @@ export class PreloadUI extends Component {
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
walletData.balance = Number(resData.balance);
|
||||
walletData.vipExpire = Number(resData.vipExpire);
|
||||
} else {
|
||||
TipsPanel.show(LanguageUtils.getText("error_code_" + res.code));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,6 +260,8 @@ export class PreloadUI extends Component {
|
||||
// 保存数据
|
||||
const globalData = DataManager.I.getDataById<GlobalData>(DataId.Global);
|
||||
globalData.globals = res.data;
|
||||
} else {
|
||||
TipsPanel.show(LanguageUtils.getText("error_code_" + res.code));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,12 +277,15 @@ export class PreloadUI extends Component {
|
||||
DataId.AiCharacter
|
||||
);
|
||||
aiCharacterData.aiCharacter = res.data;
|
||||
} else {
|
||||
TipsPanel.show(LanguageUtils.getText("error_code_" + res.code));
|
||||
}
|
||||
}
|
||||
|
||||
private enterGame() {
|
||||
this.mainScene.init();
|
||||
private async enterGame() {
|
||||
await MainController.I.init();
|
||||
this.node.destroy();
|
||||
GameRootUI.I.showDefault();
|
||||
//ResManager.I.goMainScene();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user