config.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. @Name:layuiAdmin iframe版全局配置
  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 //记录静态资源所在路径
  11. ,views: layui.cache.base + 'tpl/' //动态模板所在目录
  12. ,entry: 'index' //默认视图文件名
  13. ,engine: '.html' //视图文件后缀名
  14. ,pageTabs: true //是否开启页面选项卡功能。iframe版推荐开启
  15. ,name: 'layuiAdmin'
  16. ,tableName: 'layuiAdmin' //本地存储表名
  17. ,MOD_NAME: 'admin' //模块事件名
  18. ,debug: true //是否开启调试模式。如开启,接口异常时会抛出异常 URL 等信息
  19. //自定义请求字段
  20. ,request: {
  21. tokenName: false //自动携带 token 的字段名(如:access_token)。可设置 false 不携带。
  22. }
  23. //自定义响应字段
  24. ,response: {
  25. statusName: 'code' //数据状态的字段名称
  26. ,statusCode: {
  27. ok: 0 //数据状态一切正常的状态码
  28. ,logout: 1001 //登录状态失效的状态码
  29. }
  30. ,msgName: 'msg' //状态信息的字段名称
  31. ,dataName: 'data' //数据详情的字段名称
  32. }
  33. //扩展的第三方模块
  34. ,extend: [
  35. 'echarts', //echarts 核心包
  36. 'echartsTheme' //echarts 主题
  37. ]
  38. //主题配置
  39. ,theme: {
  40. //内置主题配色方案
  41. color: [{
  42. main: '#20222A' //主题色
  43. ,selected: '#009688' //选中色
  44. ,alias: 'default' //默认别名
  45. },{
  46. main: '#03152A'
  47. ,selected: '#3B91FF'
  48. ,alias: 'dark-blue' //藏蓝
  49. },{
  50. main: '#2E241B'
  51. ,selected: '#A48566'
  52. ,alias: 'coffee' //咖啡
  53. },{
  54. main: '#50314F'
  55. ,selected: '#7A4D7B'
  56. ,alias: 'purple-red' //紫红
  57. },{
  58. main: '#344058'
  59. ,logo: '#1E9FFF'
  60. ,selected: '#1E9FFF'
  61. ,alias: 'ocean' //海洋
  62. },{
  63. main: '#3A3D49'
  64. ,logo: '#2F9688'
  65. ,selected: '#5FB878'
  66. ,alias: 'green' //墨绿
  67. },{
  68. main: '#20222A'
  69. ,logo: '#F78400'
  70. ,selected: '#F78400'
  71. ,alias: 'red' //橙色
  72. },{
  73. main: '#28333E'
  74. ,logo: '#AA3130'
  75. ,selected: '#AA3130'
  76. ,alias: 'fashion-red' //时尚红
  77. },{
  78. main: '#24262F'
  79. ,logo: '#3A3D49'
  80. ,selected: '#009688'
  81. ,alias: 'classic-black' //经典黑
  82. },{
  83. logo: '#226A62'
  84. ,header: '#2F9688'
  85. ,alias: 'green-header' //墨绿头
  86. },{
  87. main: '#344058'
  88. ,logo: '#0085E8'
  89. ,selected: '#1E9FFF'
  90. ,header: '#1E9FFF'
  91. ,alias: 'ocean-header' //海洋头
  92. },{
  93. header: '#393D49'
  94. ,alias: 'classic-black-header' //经典黑头
  95. },{
  96. main: '#50314F'
  97. ,logo: '#50314F'
  98. ,selected: '#7A4D7B'
  99. ,header: '#50314F'
  100. ,alias: 'purple-red-header' //紫红头
  101. },{
  102. main: '#28333E'
  103. ,logo: '#28333E'
  104. ,selected: '#AA3130'
  105. ,header: '#AA3130'
  106. ,alias: 'fashion-red-header' //时尚红头
  107. },{
  108. main: '#28333E'
  109. ,logo: '#009688'
  110. ,selected: '#009688'
  111. ,header: '#009688'
  112. ,alias: 'green-header' //墨绿头
  113. }]
  114. //初始的颜色索引,对应上面的配色方案数组索引
  115. //如果本地已经有主题色记录,则以本地记录为优先,除非请求本地数据(localStorage)
  116. ,initColorIndex: 0
  117. }
  118. });
  119. });