From de0f10425b61f392349e192a19a7163f16eb7315 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 25 Nov 2022 09:55:38 +0400 Subject: [PATCH] Main redirect if group 1 exists --- src/controller/Main.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/Main.hx b/src/controller/Main.hx index 4eeaaa3..fb42da9 100755 --- a/src/controller/Main.hx +++ b/src/controller/Main.hx @@ -29,8 +29,10 @@ class Main extends Controller { if ( app.user!=null && group == null) { throw Redirect("/user/choose"); }else if (app.user == null && (group==null || group.regOption!=db.Amap.RegOption.Open) ) { - //throw Redirect("/user/login"); - throw Redirect("/group/1"); + + if (db.Amap.manager.get(1, false) != null) throw Redirect("/group/1"); + else throw Redirect("/user/login"); + } view.amap = group;