using SunlightAggregationTerminal.Class; using SunlightAggregationTerminal.Models; using SunlightAggregationTerminal.View; namespace SunlightAggregationTerminal { public partial class AppShell : Shell { public AppShell() { InitializeComponent(); this.BindingContext = new AppModels(); } private async void Shell_Loaded(object sender, EventArgs e) { //打开登录 if (!App.GlobalData.LogNo) { var logpage = new View.LogPage(); await Navigation.PushModalAsync(new NavigationPage(logpage)); } else {//发送登录请求 if (await AppModels.LogIn()) {//拒绝登陆时打开登录页面 var logpage = new View.LogPage(); await Navigation.PushModalAsync(logpage); } } } } }