config.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. // eslint-disable-next-line no-unused-vars
  2. window.apidocFeConfig = {
  3. // 标题
  4. TITLE: "钉钉OA",
  5. // 缓存配置
  6. CACHE: {
  7. // 缓存前缀
  8. PREFIX: "APIDOC_",
  9. },
  10. HTTP: {
  11. // 接口请求地址
  12. HOSTS:[
  13. ],
  14. // 接口响应超时时间
  15. TIMEOUT: 30000,
  16. // 跨域请求时是否使用凭证
  17. WITHCREDENTIALS:false,
  18. // 启用转码
  19. ENCODEURICOMPONENT:false,
  20. },
  21. // 授权访问
  22. AUTH:{
  23. // 异常状态码
  24. ERROR_STATUS:401,
  25. // 异常code字段
  26. ERROR_CODE_FIELD:"code"
  27. },
  28. // 菜单配置
  29. MENU: {
  30. SHOWURL: false,
  31. WIDTH: 300,
  32. },
  33. // 请求类型的颜色
  34. METHOD_COLOR: {
  35. GET: "#87d068",
  36. POST: "#2db7f5",
  37. PUT: "#ff9800",
  38. DELETE: "#ff4d4f",
  39. PATCH: "#802feb",
  40. },
  41. // 接口详情页的tab顺序
  42. API_DETAIL_TABS:["table", "json", "ts", "debug"],
  43. // 加载外部js文件
  44. LOAD_SCRIPTS:[
  45. "./utils/md5.js",
  46. ],
  47. // SHOW_VERSION:false,
  48. // 调试时事件,处理参数值的方法
  49. DEBUG_EVENTS:{
  50. md5(param){
  51. console.log('md5事件',param);
  52. return new Promise((resolve, reject) => {
  53. const {config,event}=param
  54. if (event.key) {
  55. let value = ""
  56. let paramKey = "params"
  57. if (config.params[event.key]) {
  58. value = config.params[event.key]
  59. }else if(config.data[event.key]){
  60. value = config.data[event.key]
  61. paramKey="data"
  62. }
  63. if (value) {
  64. const password = md5(value)
  65. param.config[paramKey][event.key] = password
  66. param.message = "->"+password
  67. }
  68. resolve(param)
  69. } else {
  70. reject("未指定字段")
  71. }
  72. })
  73. },
  74. },
  75. MOCK_EXTENDS:{},
  76. CUSTOM_METHODS:{},
  77. // 多语言
  78. LANG: [
  79. {
  80. title: "简体中文",
  81. lang: "zh-cn",
  82. messages: {
  83. "home.title": "首页",
  84. "home.appCount": "应用数",
  85. "home.apiCount": "API数量",
  86. "home.docsCount": "文档数量",
  87. "common.ok": "确认",
  88. "common.cancel": "取消",
  89. "common.clear": "清空",
  90. "common.desc": "说明",
  91. "common.action": "操作",
  92. "common.field": "字段",
  93. "common.method": "请求类型",
  94. "common.require": "必填",
  95. "common.notEmpty": "非空",
  96. "common.defaultValue": "默认值",
  97. "common.value": "值",
  98. "common.docs": "文档",
  99. "common.close": "关闭",
  100. "common.view": "查看",
  101. "common.copy": "复制",
  102. "common.copySuccess": "复制成功",
  103. "common.page.404": "404-未知页面",
  104. "common.notdata": "暂无数据",
  105. "common.group": "分组",
  106. "common.notGroup": "未分组",
  107. "common.currentApp": "当前应用",
  108. "common.please.input": "请输入",
  109. "common.please.select": "请选择",
  110. "common.file.name": "文件名",
  111. "common.appOrVersion": "应用/版本",
  112. "common.allAppOption": "全部应用",
  113. "common.ms": "毫秒",
  114. "common.name":"名称",
  115. "common.controller":"控制器",
  116. "common.api":"接口",
  117. "common.author": "作者",
  118. "common.tag": "标签",
  119. "lang.change.confirm.title": "您确认切换语言为 {langTitle} 吗?",
  120. "lang.change.confirm.content": "确认后将刷新页面,并回到首页",
  121. "host.change.confirm.title": "您确认切换Host为 {hostTitle} 吗?",
  122. "auth.title": "授权访问",
  123. "auth.input.placeholder": "请输入访问密码",
  124. "apiPage.tabs.table": "文档",
  125. "apiPage.tabs.json": "Json",
  126. "apiPage.tabs.ts": "TypeScript",
  127. "apiPage.tabs.debug": "调试",
  128. "apiPage.header.title": "请求头Header",
  129. "apiPage.query.title": "请求参数Query",
  130. "apiPage.body.title": "请求参数Body",
  131. "apiPage.routeParam.title": "路由参数Route",
  132. "apiPage.title.responses": "响应结果",
  133. "apiPage.responses": "响应结果",
  134. "apiPage.responses.success": "成功响应",
  135. "apiPage.responses.error": "错误响应",
  136. "cache.manage":"缓存管理",
  137. "cache.cancelAll":"清除所有缓存",
  138. "cache.cancelSuccess":"清除成功",
  139. "cache.cancelAllConfirm":"您确认清除所有Api缓存吗?",
  140. "cache.createAllApi":"生成所有Api缓存",
  141. "cache.createAllConfirm":"您确认生成所有Api缓存吗?",
  142. "cache.createSuccess":"生成成功",
  143. "apiPage.mdDetail.title": "{name} 字段的说明",
  144. "apiPage.debug.param.reload": "重置参数",
  145. "apiPage.debug.header": "Header",
  146. "apiPage.debug.query": "Query",
  147. "apiPage.debug.body": "Body",
  148. "apiPage.debug.routeParam": "Route",
  149. "apiPage.debug.excute": "执行 Excute",
  150. "apiPage.debug.notExcute": "未发起请求",
  151. "apiPage.debug.reloadParamsAndExcute": "重置所有参数并执行",
  152. "apiPage.debug.selectFile": "Select File",
  153. "apiPage.debug.selectFiles": "Select Files",
  154. "layout.menu.reload": "更新菜单",
  155. "layout.menu.openAll": "展开全部",
  156. "layout.menu.hideAll": "收起全部",
  157. "layout.tabs.leftSide": "左侧",
  158. "layout.tabs.rightSide": "右侧",
  159. "layout.tabs.notTab": "没有标签",
  160. "layout.tabs.closeCurrent": "关闭当前",
  161. "layout.tabs.closeLeft": "关闭左侧",
  162. "layout.tabs.closeRight": "关闭右侧",
  163. "layout.tabs.closeAll": "关闭全部",
  164. "globalParam.title": "全局参数",
  165. "globalParam.header": "Header",
  166. "globalParam.header.message": "发送请求时,所有接口将自动携带以下Header参数。",
  167. "globalParam.query": "Query",
  168. "globalParam.query.message": "发送请求时,所有接口将自动携带以下Query参数。",
  169. "globalParam.body": "Body",
  170. "globalParam.body.message": "发送请求时,所有接口将自动携带以下Body参数。",
  171. "globalParam.cancel.confirm": "确认清空所有参数吗?",
  172. "globalParam.add": "添加参数",
  173. "apiPage.json.formatError": "json 参数格式化错误",
  174. "debug.event.before": "请求前事件",
  175. "debug.event.after": "响应后事件",
  176. "debug.event.setHeader": "设置请求Header参数",
  177. "debug.event.setQuery": "设置请求Query参数",
  178. "debug.event.setBody": "设置请求Body参数",
  179. "debug.event.clearHeader": "清除请求Header参数",
  180. "debug.event.clearQuery": "清除请求Query参数",
  181. "debug.event.clearBody": "清除请求Body参数",
  182. "debug.event.setGlobalHeader": "设置全局Header参数",
  183. "debug.event.setGlobalQuery": "设置全局Query参数",
  184. "debug.event.setGlobalBody": "设置全局Body参数",
  185. "debug.event.clearGlobalHeader": "清除全局Header参数",
  186. "debug.event.clearGlobalQuery": "清除全局Query参数",
  187. "debug.event.clearGlobalBody": "清除全局Body参数",
  188. "debug.event.ajax": "发送请求",
  189. "debug.event.custom": "自定义事件",
  190. "debug.request.header": "请求头",
  191. "debug.responses.header": "响应头",
  192. "generator.title": "接口生成",
  193. "generator.apps.title": "应用/版本",
  194. "generator.group.title": "分组",
  195. "generator.table.field": "字段名",
  196. "generator.table.desc": "注释",
  197. "generator.table.type": "类型",
  198. "generator.table.length": "长度",
  199. "generator.table.default": "默认值",
  200. "generator.table.notNull": "非Null",
  201. "generator.table.autoAdd": "自增",
  202. "generator.table.mainKey": "主键",
  203. "generator.model.name": "模型名",
  204. "generator.table.name": "表名",
  205. "generator.table.comment": "表注释",
  206. "generator.model.name.placeholder": "请输入模型文件名",
  207. "generator.table.name.placeholder": "请输入表名",
  208. "generator.table.row.error": "第{rows}行,字段名、类型必填",
  209. "generator.submitSuccess": "生成成功",
  210. "tools.title": "工具",
  211. "codeTemplate.title":"代码模板",
  212. "codeTemplate.reload":"重新生成",
  213. },
  214. }
  215. ],
  216. };