package cn.hyx.invoicing.system;

import org.agle4j.framework.annotation.Action;
import org.agle4j.framework.annotation.Controller;
import org.agle4j.framework.bean.Param;
import org.agle4j.framework.bean.View;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 处理系统请求
 * 
 * @author hanyx
 * @since
 */
@Controller
public class SystemController {

	private static final Logger LOGGER = LogManager.getLogger(SystemController.class) ;
	
	/**
	 * 进入首页界面
	 */
	@Action("get:/")
	public View index() {
		return new View("index.jsp") ;
	}
	
	/**
	 * 进入登录界面
	 */
	@Action("get:/login")
	public View login() {
		return new View("login.jsp") ;
	}
	
	/**
	 * 提交登录表单
	 */
	@Action("post:/login")
	public View loginSubmit(Param param) {
		String username = param.getString("username") ;
		String password = param.getString("password") ;
//		try {
//			SecurityHelper.login(username, password);
//		} catch (AuthcException e) {
//			LOGGER.error("login failuer", e);
//			return new View("/login") ;
//		}
		return new View("/customer") ;
	}
	
	/**
	 * 提交注销请求
	 */
	public View logout() {
//		SecurityHelper.logout();
		return new View("/") ;
	}
	
	
}

@@ -210,16 +210,128 @@
 .View;%0D%0A
+import org.agle4j.plugin.security.SecurityHelper;%0D%0Aimport org.agle4j.plugin.security.exception.AuthcException;%0D%0A
 import o
@@ -1015,18 +1015,16 @@
 rd%22) ;%0D%0A
-//
 %09%09try %7B%0D
@@ -1024,18 +1024,16 @@
 %09try %7B%0D%0A
-//
 %09%09%09Secur
@@ -1070,18 +1070,16 @@
 word);%0D%0A
-//
 %09%09%7D catc
@@ -1102,18 +1102,16 @@
 n e) %7B%0D%0A
-//
 %09%09%09LOGGE
@@ -1140,18 +1140,16 @@
 %22, e);%0D%0A
-//
 %09%09%09retur
@@ -1172,18 +1172,16 @@
 in%22) ;%0D%0A
-//
 %09%09%7D%0D%0A%09%09r
@@ -1271,10 +1271,8 @@
  %7B%0D%0A
-//
 %09%09Se

modify system controller