代码拉取完成,页面将自动刷新
component extends="org.corfield.framework" {
this.directory = getDirectoryFromPath( getCurrentTemplatePath() );
// Configure application mappgins. In this case, we'll be using the uploads and chunks
// mapping with the expandPath() function later on when saving files.
this.mappings[ "/uploads" ] = ( this.directory & "uploads/" );
this.mappings[ "/chunks" ] = ( this.directory & "chunks/" );
this.name = "b2c";
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0,1,0,0);
this.dataSource = this.name;
this.ormEnabled = true;
this.ormsettings = {
cfclocation="./model/beans",
dbcreate="update", // update database tables only
dialect="MySQL", // assume MySql, other dialects available http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html
eventhandling="true",
eventhandler="root.model.beans.eventhandler",
logsql="true"
};
this.mappings["/root"] = getDirectoryFromPath(getCurrentTemplatePath());
variables.framework = {
reloadApplicationOnEveryRequest = "true",
trace = "false"
};
public function setupSession() {
// 控制用户session,获取用户登陆信息内容
controller('security.session');
}
public function setupApplication() {
Application.DataMgr = CreateObject("component","DataMgr.DataMgr_MYSQL").init(this.dataSource);
var bf = new framework.ioc("./model/services"); // ColdFusion ORM handles Beans
setBeanFactory(bf);
//设置全局变量
request.rows = 10;
request.baiduAk= '1FRohQ2W2TH9XGvEHmuckB6G';
}
public function setupRequest() {
if(structKeyExists(url, "init")) { // use index.cfm?init to reload ORM
setupApplication();
ormReload();
location(url="index.cfm",addToken=false);
}
// 权限控制判断
controller("security.authorize");
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。