package com.sys.core;


import com.jfinal.aop.Clear;
import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;
import com.jfinal.kit.PropKit;
import com.sys.core.model.DataBean;
import com.sys.core.utils.ConstUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@Clear()
public class IndexController extends Controller {
    Log log = LogFactory.getLog(this.getClass());

    public void index() {
        this.render("/_view/error.html");
    }
    
    @ActionKey("/nologin")
    public void nologin() {

        boolean menuShow = PropKit.getBoolean("menu", true);
        this.setSessionAttr("menuShow", menuShow);
        this.render("/_view/nologin.html");
    }
    @ActionKey("/404")
    public void notFound() {

        this.render("/_view/404.html");
    }
    @ActionKey("/initsession")
    public void initSession() {
        this.setSessionAttr(ConstUtil.SESSION_USER, "fpVLfNqdS/Gh8N7Bs6yiFYDvfe0=");
        DataBean dBean = new DataBean();
        dBean.setCode(0);
        dBean.setMsg("Ok");
        this.renderJson("data", dBean);
    }
    @ActionKey("/error")
    public void error() {
        this.render("/_view/error.html");
    }

    @ActionKey("/jsp")
    public void jspIndex() {
        this.renderJsp("/pages/index.jsp");
    }


}