config.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. @Name:全局配置
  3. @Author:贤心
  4. @Site:http://www.layui.com/admin/
  5. @License:LPPL(layui付费产品协议)
  6. */
  7. layui.define(['laytpl', 'layer', 'element', 'util'], function(exports){
  8. exports('setter', {
  9. container: 'LAY_app' //容器ID
  10. ,base: layui.cache.base //记录layuiAdmin文件夹所在路径
  11. ,views: layui.cache.base + 'views/' //视图所在目录
  12. ,entry: 'detection/charge_add' //默认视图文件名
  13. ,engine: '.html' //视图文件后缀名
  14. ,pageTabs: false //是否开启页面选项卡功能。单页版不推荐开启
  15. ,name: 'layuiAdmin Pro'
  16. ,tableName: 'layuiAdmin' //本地存储表名
  17. ,MOD_NAME: 'admin' //模块事件名
  18. ,debug: true //是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
  19. ,interceptor: false //是否开启未登入拦截
  20. //自定义请求字段
  21. ,request: {
  22. tokenName: 'access_token' //自动携带 token 的字段名。可设置 false 不携带。
  23. }
  24. //自定义响应字段
  25. ,response: {
  26. statusName: 'code' //数据状态的字段名称
  27. ,statusCode: {
  28. ok: 0 //数据状态一切正常的状态码
  29. ,logout: 1001 //登录状态失效的状态码
  30. }
  31. ,msgName: 'msg' //状态信息的字段名称
  32. ,dataName: 'data' //数据详情的字段名称
  33. }
  34. //独立页面路由,可随意添加(无需写参数)
  35. ,indPage: [
  36. '/user/login' //登入页
  37. ,'/user/reg' //注册页
  38. ,'/user/forget' //找回密码
  39. ,'/template/tips/test' //独立页的一个测试 demo
  40. ]
  41. //扩展的第三方模块
  42. ,extend: [
  43. 'echarts', //echarts 核心包
  44. 'echartsTheme' //echarts 主题
  45. ]
  46. //主题配置
  47. ,theme: {
  48. //内置主题配色方案
  49. color: [{
  50. main: '#20222A' //主题色
  51. ,selected: '#009688' //选中色
  52. ,alias: 'default' //默认别名
  53. },{
  54. main: '#03152A'
  55. ,selected: '#3B91FF'
  56. ,alias: 'dark-blue' //藏蓝
  57. },{
  58. main: '#2E241B'
  59. ,selected: '#A48566'
  60. ,alias: 'coffee' //咖啡
  61. },{
  62. main: '#50314F'
  63. ,selected: '#7A4D7B'
  64. ,alias: 'purple-red' //紫红
  65. },{
  66. main: '#344058'
  67. ,logo: '#1E9FFF'
  68. ,selected: '#1E9FFF'
  69. ,alias: 'ocean' //海洋
  70. },{
  71. main: '#3A3D49'
  72. ,logo: '#2F9688'
  73. ,selected: '#5FB878'
  74. ,alias: 'green' //墨绿
  75. },{
  76. main: '#20222A'
  77. ,logo: '#F78400'
  78. ,selected: '#F78400'
  79. ,alias: 'red' //橙色
  80. },{
  81. main: '#28333E'
  82. ,logo: '#AA3130'
  83. ,selected: '#AA3130'
  84. ,alias: 'fashion-red' //时尚红
  85. },{
  86. main: '#24262F'
  87. ,logo: '#3A3D49'
  88. ,selected: '#009688'
  89. ,alias: 'classic-black' //经典黑
  90. },{
  91. logo: '#226A62'
  92. ,header: '#2F9688'
  93. ,alias: 'green-header' //墨绿头
  94. },{
  95. main: '#344058'
  96. ,logo: '#0085E8'
  97. ,selected: '#1E9FFF'
  98. ,header: '#1E9FFF'
  99. ,alias: 'ocean-header' //海洋头
  100. },{
  101. header: '#393D49'
  102. ,alias: 'classic-black-header' //经典黑
  103. },{
  104. main: '#50314F'
  105. ,logo: '#50314F'
  106. ,selected: '#7A4D7B'
  107. ,header: '#50314F'
  108. ,alias: 'purple-red-header' //紫红头
  109. },{
  110. main: '#28333E'
  111. ,logo: '#28333E'
  112. ,selected: '#AA3130'
  113. ,header: '#AA3130'
  114. ,alias: 'fashion-red-header' //时尚红头
  115. },{
  116. main: '#28333E'
  117. ,logo: '#009688'
  118. ,selected: '#009688'
  119. ,header: '#009688'
  120. ,alias: 'green-header' //墨绿头
  121. }]
  122. //初始的颜色索引,对应上面的配色方案数组索引
  123. //如果本地已经有主题色记录,则以本地记录为优先,除非请求本地数据(localStorage)
  124. ,initColorIndex: 0
  125. }
  126. });
  127. });