Search in sources :

Example 1 with ServerConfig

use of cn.cerc.jbean.core.ServerConfig in project summer-mis by cn-cerc.

the class AbstractJspPage method setForm.

@Override
public final void setForm(IForm form) {
    this.form = form;
    if (form != null) {
        this.put("jspPage", this);
        // 为兼容而设计
        ServerConfig config = ServerConfig.getInstance();
        this.add("summer_js", config.getProperty("summer.js", "js/summer.js"));
        this.add("myapp_js", config.getProperty("myapp.js", "js/myapp.js"));
    }
}
Also used : ServerConfig(cn.cerc.jbean.core.ServerConfig)

Example 2 with ServerConfig

use of cn.cerc.jbean.core.ServerConfig in project summer-mis by cn-cerc.

the class AbstractJspPage method initJsFile.

protected void initJsFile() {
    ServerConfig config = ServerConfig.getInstance();
    this.addScriptFile(config.getProperty("jquery.js", "js/jquery.js"));
    this.addScriptFile(config.getProperty("summer.js", "js/summer.js"));
    this.addScriptFile(config.getProperty("myapp.js", "js/myapp.js"));
}
Also used : ServerConfig(cn.cerc.jbean.core.ServerConfig)

Example 3 with ServerConfig

use of cn.cerc.jbean.core.ServerConfig in project summer-mis by cn-cerc.

the class AbstractJspPage method initCssFile.

protected void initCssFile() {
    ServerConfig config = ServerConfig.getInstance();
    this.addCssFile(config.getProperty("summer.css", "css/summer.css"));
    if (!getForm().getClient().isPhone()) {
        this.addCssFile(config.getProperty("summer-pc.css", "css/summer-pc.css"));
    }
}
Also used : ServerConfig(cn.cerc.jbean.core.ServerConfig)

Example 4 with ServerConfig

use of cn.cerc.jbean.core.ServerConfig in project summer-mis by cn-cerc.

the class SvrUserLogin method autoLogin.

@Webfunc
public boolean autoLogin() throws SecurityCheckException {
    Record headIn = getDataIn().getHead();
    String token1 = headIn.getString("token");
    // 加入ABCD是为了仅允许内部调用
    ServerConfig config = ServerConfig.getInstance();
    String token2 = config.getProperty(OssSession.oss_accessKeySecret, "") + "ABCD";
    // 如果不是内部调用,则返回false
    if (!token2.equals(token1)) {
        return false;
    }
    String clientId = headIn.getString("openid");
    SqlQuery ds = new SqlQuery(this);
    ds.add("SELECT A.Code_,A.Password_ FROM %s A", SystemTable.get(SystemTable.getDeviceVerify));
    ds.add("inner JOIN %s B", SystemTable.get(SystemTable.getUserInfo));
    ds.add("ON A.UserCode_=B.Code_");
    ds.add("WHERE A.MachineCode_='%s' AND A.AutoLogin_=1", clientId);
    ds.open();
    if (ds.eof()) {
        return false;
    }
    headIn.setField("Account_", ds.getString("Code_"));
    headIn.setField("Password_", ds.getString("Password_"));
    headIn.setField("MachineID_", clientId);
    headIn.setField("ClientName_", "Web浏览器");
    headIn.setField("ClientIP_", "127.0.0.1");
    headIn.setField("wx", true);
    return this.Check();
}
Also used : ServerConfig(cn.cerc.jbean.core.ServerConfig) SqlQuery(cn.cerc.jdb.mysql.SqlQuery) Record(cn.cerc.jdb.core.Record) Webfunc(cn.cerc.jbean.core.Webfunc)

Aggregations

ServerConfig (cn.cerc.jbean.core.ServerConfig)4 Webfunc (cn.cerc.jbean.core.Webfunc)1 Record (cn.cerc.jdb.core.Record)1 SqlQuery (cn.cerc.jdb.mysql.SqlQuery)1