基本参数设定

在开始进行实际的开发之前我们首先需要确定一些基本的参数设置。Cola Shell项目的配置参数通常都被放在/public/common/common.js中, 在这个文件中我们可以找到这样一段内容。各种默认参数值应该在这里进行配置。

  1. /* 系统默认值 */
  2. var properties = {
  3. mainView: "./frame/main",
  4. loginPath: "./login",
  5. longPollingTimeout: 0,
  6. longPollingInterval: 2000,
  7. "service.messagePull": "./service/message/pull",
  8. "service.login": "./service/account/login",
  9. "service.logout": "./service/account/logout",
  10. "service.menus": "./service/menus",
  11. "service.user.detail": "./service/user/detail",
  12. "message.action": {
  13. path: "http://cola-ui.com",
  14. type: "subWindow",
  15. label: "我的消息",
  16. closeable: true
  17. },
  18. "task.action": {
  19. path: "http://cola-ui.com",
  20. type: "subWindow",
  21. label: "我的任务",
  22. closeable: true
  23. },
  24. "app.logo.path": "./resources/images/logo.png",
  25. "app.name": "Cola-UI Client Framework",
  26. title: "Cola-Frame"
  27. };
  28. });

这里支持的参数目前有以下这些:

  • mainView - 系统主框架界面地址
  • loginPath - 登录界面路径
  • longPollingTimeout - 消息长轮询请求超时时间
  • longPollingInterval - 框架长轮询周期
  • service.messagePull - 消息接口
  • service.login - 登录接口
  • service.logout - 登出接口
  • service.menus - 系统菜单接口
  • service.user.detail - 获得当前用户详细信息接口
  • message.action - 单击右上角消息按钮后的响应配置
  • task.action - 单击右上角任务按钮后的响应配置
  • app.logo.path - 系统Logo图片地址
  • app.name - 系统名称
  • title - 系统Title 浏览器标签标题