vue.config.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. 'use strict'
  2. const path = require('path')
  3. function resolve(dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. const name = process.env.VUE_APP_TITLE || '云联私域管理系统' // 网页标题
  7. const port = process.env.port || process.env.npm_config_port || 80 // 端口
  8. // vue.config.js 配置说明
  9. //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
  10. // 这里只列一部分,具体配置参考文档
  11. module.exports = {
  12. // 部署生产环境和开发环境下的URL。
  13. // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
  14. // 例如 https://www.test.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.test.vip/admin/,则设置 baseUrl 为 /admin/。
  15. publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
  16. // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
  17. outputDir: 'dist',
  18. // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
  19. assetsDir: 'static',
  20. // 是否开启eslint保存检测,有效值:ture | false | 'error'
  21. lintOnSave: process.env.NODE_ENV === 'development',
  22. // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
  23. productionSourceMap: false,
  24. // transpileDependencies: true, // 默认情况下 babel-loader 忽略 node_modules 中的所有文件,启用此选项需配置transpileDependencies
  25. transpileDependencies: [
  26. /@aws-sdk/,
  27. /@aws/,
  28. /@smithy/,
  29. /@huaweicloud/,
  30. /vod-js-sdk-v6/
  31. ],
  32. // webpack-dev-server 相关配置
  33. devServer: {
  34. host: '0.0.0.0',
  35. port: port,
  36. open: true,
  37. disableHostCheck: true,
  38. proxy: {
  39. // saasadminui all API → fs-company(8006)
  40. // system/monitor/admin/tool/fs controllers are now enabled in fs-company via @Profile({"admin","company"})
  41. [process.env.VUE_APP_BASE_API]: {
  42. target: 'http://localhost:8006',
  43. changeOrigin: true,
  44. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' }
  45. },
  46. // ===== 前端路径与后端不一致的路径重写 → fs-company(8006) =====
  47. //
  48. // saasadminui 前端 API 路径与 fs-company 后端控制器路径存在以下不一致:
  49. // 1. /store/store/* → 后端是 /store/* (前端多了一层 store)
  50. // 2. /store/his/* → 后端是 /his/* (前端 store/his 实际是 his)
  51. // 3. /his/fsXxx → 后端是 /store/xxx (his/fs 前缀映射到 store)
  52. // 4. /his_store/* → 后端是 /hisStore/* (下划线 vs 驼峰)
  53. // 5. /admin/medical/* → 路由到 fs-admin(8003)
  54. // 6. /fast_gpt/* → 后端是 /fastGpt/*
  55. // 7. /wx/wxSop* → 后端是 /qwSop/sopUserLogs*
  56. // 8. /wxSop/sopUserLogsWx → 后端是 /qwSop/sopUserLogs
  57. // 9. /sop/companySopRole → 后端是 /companySopRole
  58. //
  59. // === 批量路径重写:/store/store/* → /store/* ===
  60. [process.env.VUE_APP_BASE_API + '/store/store']: {
  61. target: 'http://localhost:8006',
  62. changeOrigin: true,
  63. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/store']: '/store' }
  64. },
  65. // === 批量路径重写:/store/his/* → /his/* ===
  66. [process.env.VUE_APP_BASE_API + '/store/his']: {
  67. target: 'http://localhost:8006',
  68. changeOrigin: true,
  69. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/his']: '/his' }
  70. },
  71. // === 批量路径重写:/store/doctor/* → /his/doctor/* ===
  72. [process.env.VUE_APP_BASE_API + '/store/doctor']: {
  73. target: 'http://localhost:8006',
  74. changeOrigin: true,
  75. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/doctor']: '/his/doctor' }
  76. },
  77. // === 批量路径重写:/store/healthTongue/* → /his/healthTongue/* ===
  78. [process.env.VUE_APP_BASE_API + '/store/healthTongue']: {
  79. target: 'http://localhost:8006',
  80. changeOrigin: true,
  81. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthTongue']: '/his/healthTongue' }
  82. },
  83. // === 批量路径重写:/store/inquiryOrder/* → /his/inquiryOrder/* ===
  84. [process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: {
  85. target: 'http://localhost:8006',
  86. changeOrigin: true,
  87. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: '/his/inquiryOrder' }
  88. },
  89. // === 批量路径重写:/store/prescribeDrug/* → /his/prescribeDrug/* ===
  90. [process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: {
  91. target: 'http://localhost:8006',
  92. changeOrigin: true,
  93. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: '/his/prescribeDrug' }
  94. },
  95. // === 批量路径重写:/store/healthStoreOrder/* → /hisStore/fsStoreOrderScrm/* ===
  96. [process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: {
  97. target: 'http://localhost:8006',
  98. changeOrigin: true,
  99. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: '/hisStore/fsStoreOrderScrm' }
  100. },
  101. // === 批量路径重写:/store/operlogScrm/* → /hisStore/operlogScrm/* ===
  102. [process.env.VUE_APP_BASE_API + '/store/operlogScrm']: {
  103. target: 'http://localhost:8006',
  104. changeOrigin: true,
  105. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/operlogScrm']: '/hisStore/operlogScrm' }
  106. },
  107. // === 批量路径重写:/store/storeOrderOffline/* → /hisStore/fsStoreOrderOfflineScrm/* ===
  108. [process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: {
  109. target: 'http://localhost:8006',
  110. changeOrigin: true,
  111. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' }
  112. },
  113. // === 批量路径重写:/store/storeOrderAudit/* → /hisStore/fsStoreOrderAuditScrm/* ===
  114. [process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: {
  115. target: 'http://localhost:8006',
  116. changeOrigin: true,
  117. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' }
  118. },
  119. // === 批量路径重写:/store/recommend/* → /store/storeRecommend/* ===
  120. [process.env.VUE_APP_BASE_API + '/store/recommend']: {
  121. target: 'http://localhost:8006',
  122. changeOrigin: true,
  123. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/recommend']: '/store/storeRecommend' }
  124. },
  125. // === 批量路径重写:/store/storeActivity/* → /hisStore/fsStoreActivityScrm/* ===
  126. [process.env.VUE_APP_BASE_API + '/store/storeActivity']: {
  127. target: 'http://localhost:8006',
  128. changeOrigin: true,
  129. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeActivity']: '/hisStore/fsStoreActivityScrm' }
  130. },
  131. // === 批量路径重写:/store/collectionSchedule/* → /hisStore/fsCollectionScheduleScrm/* ===
  132. [process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: {
  133. target: 'http://localhost:8006',
  134. changeOrigin: true,
  135. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: '/hisStore/fsCollectionScheduleScrm' }
  136. },
  137. // === his_store/* → hisStore/* (下划线转驼峰) ===
  138. [process.env.VUE_APP_BASE_API + '/his_store']: {
  139. target: 'http://localhost:8006',
  140. changeOrigin: true,
  141. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his_store']: '/hisStore' }
  142. },
  143. // === /admin/medical/* → fs-admin(8003) ===
  144. [process.env.VUE_APP_BASE_API + '/admin/medical']: {
  145. target: 'http://localhost:8003',
  146. changeOrigin: true,
  147. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/admin/medical']: '/admin/medical' }
  148. },
  149. // === /fast_gpt/* → /fastGpt/* ===
  150. [process.env.VUE_APP_BASE_API + '/fast_gpt']: {
  151. target: 'http://localhost:8006',
  152. changeOrigin: true,
  153. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/fast_gpt']: '/fastGpt' }
  154. },
  155. // === /wxSop/sopUserLogsWx → /qwSop/sopUserLogs ===
  156. [process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: {
  157. target: 'http://localhost:8006',
  158. changeOrigin: true,
  159. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: '/qwSop/sopUserLogs' }
  160. },
  161. // === /sop/companySopRole → /companySopRole ===
  162. [process.env.VUE_APP_BASE_API + '/sop/companySopRole']: {
  163. target: 'http://localhost:8006',
  164. changeOrigin: true,
  165. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/sop/companySopRole']: '/companySopRole' }
  166. },
  167. // === /company/company → /company (前端多了个company前缀) ===
  168. [process.env.VUE_APP_BASE_API + '/company/company']: {
  169. target: 'http://localhost:8006',
  170. changeOrigin: true,
  171. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/company']: '/company' }
  172. },
  173. // === /company/companyConfig → /companyConfig ===
  174. [process.env.VUE_APP_BASE_API + '/company/companyConfig']: {
  175. target: 'http://localhost:8006',
  176. changeOrigin: true,
  177. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyConfig']: '/companyConfig' }
  178. },
  179. // === /company/companyOperLog → /companyOperLog ===
  180. [process.env.VUE_APP_BASE_API + '/company/companyOperLog']: {
  181. target: 'http://localhost:8006',
  182. changeOrigin: true,
  183. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyOperLog']: '/companyOperLog' }
  184. },
  185. // === /company/companyTagGroup → /companyTagGroup ===
  186. [process.env.VUE_APP_BASE_API + '/company/companyTagGroup']: {
  187. target: 'http://localhost:8006',
  188. changeOrigin: true,
  189. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyTagGroup']: '/companyTagGroup' }
  190. },
  191. // === /company/companyTag → /companyTag ===
  192. [process.env.VUE_APP_BASE_API + '/company/companyTag']: {
  193. target: 'http://localhost:8006',
  194. changeOrigin: true,
  195. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyTag']: '/companyTag' }
  196. },
  197. // === /company/companyUser → /companyUser ===
  198. [process.env.VUE_APP_BASE_API + '/company/companyUser']: {
  199. target: 'http://localhost:8006',
  200. changeOrigin: true,
  201. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyUser']: '/companyUser' }
  202. },
  203. // === /company/companyVoice* → /companyVoice* ===
  204. [process.env.VUE_APP_BASE_API + '/company/companyVoice']: {
  205. target: 'http://localhost:8006',
  206. changeOrigin: true,
  207. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyVoice']: '/companyVoice' }
  208. },
  209. // === /company/companyMenu → /companyMenu ===
  210. [process.env.VUE_APP_BASE_API + '/company/companyMenu']: {
  211. target: 'http://localhost:8006',
  212. changeOrigin: true,
  213. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyMenu']: '/companyMenu' }
  214. },
  215. // === /company/companyMoneyLogs → /companyMoneyLogs ===
  216. [process.env.VUE_APP_BASE_API + '/company/companyMoneyLogs']: {
  217. target: 'http://localhost:8006',
  218. changeOrigin: true,
  219. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyMoneyLogs']: '/companyMoneyLogs' }
  220. },
  221. // === /company/companySmsPackage → /companySmsPackage ===
  222. [process.env.VUE_APP_BASE_API + '/company/companySmsPackage']: {
  223. target: 'http://localhost:8006',
  224. changeOrigin: true,
  225. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companySmsPackage']: '/companySmsPackage' }
  226. },
  227. // === /company/redPackage → /redPackage ===
  228. [process.env.VUE_APP_BASE_API + '/company/redPackage']: {
  229. target: 'http://localhost:8006',
  230. changeOrigin: true,
  231. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/redPackage']: '/redPackage' }
  232. },
  233. // === /company/schedule → /schedule ===
  234. [process.env.VUE_APP_BASE_API + '/company/schedule']: {
  235. target: 'http://localhost:8006',
  236. changeOrigin: true,
  237. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/schedule']: '/schedule' }
  238. },
  239. // === /company/addwx → /addwx ===
  240. [process.env.VUE_APP_BASE_API + '/company/addwx']: {
  241. target: 'http://localhost:8006',
  242. changeOrigin: true,
  243. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/addwx']: '/addwx' }
  244. },
  245. // === /company/callphone → /callphone ===
  246. [process.env.VUE_APP_BASE_API + '/company/callphone']: {
  247. target: 'http://localhost:8006',
  248. changeOrigin: true,
  249. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/callphone']: '/callphone' }
  250. },
  251. // === /company/sendmsg → /sendmsg ===
  252. [process.env.VUE_APP_BASE_API + '/company/sendmsg']: {
  253. target: 'http://localhost:8006',
  254. changeOrigin: true,
  255. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/sendmsg']: '/sendmsg' }
  256. },
  257. // === /company/easyCall → /easyCall ===
  258. [process.env.VUE_APP_BASE_API + '/company/easyCall']: {
  259. target: 'http://localhost:8006',
  260. changeOrigin: true,
  261. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/easyCall']: '/easyCall' }
  262. },
  263. // === /company/companyWorkflow → /companyWorkflow ===
  264. [process.env.VUE_APP_BASE_API + '/company/companyWorkflow']: {
  265. target: 'http://localhost:8006',
  266. changeOrigin: true,
  267. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/companyWorkflow']: '/companyWorkflow' }
  268. },
  269. // === /company/module-consumption → /moduleConsumption ===
  270. [process.env.VUE_APP_BASE_API + '/company/module-consumption']: {
  271. target: 'http://localhost:8006',
  272. changeOrigin: true,
  273. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/module-consumption']: '/moduleConsumption' }
  274. },
  275. // === /company/wxUser* → /wxUser* ===
  276. [process.env.VUE_APP_BASE_API + '/company/wxUser']: {
  277. target: 'http://localhost:8006',
  278. changeOrigin: true,
  279. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/wxUser']: '/wxUser' }
  280. },
  281. // === /qw/qwInformation → /qw/information ===
  282. [process.env.VUE_APP_BASE_API + '/qw/qwInformation']: {
  283. target: 'http://localhost:8006',
  284. changeOrigin: true,
  285. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwInformation']: '/qw/information' }
  286. },
  287. // === /qw/qwAppContactWayLogs → /qw/appContactWayLogs ===
  288. [process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: {
  289. target: 'http://localhost:8006',
  290. changeOrigin: true,
  291. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: '/qw/appContactWayLogs' }
  292. },
  293. // === /qw/qwPushCount → /qw/pushCount ===
  294. [process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: {
  295. target: 'http://localhost:8006',
  296. changeOrigin: true,
  297. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: '/qw/pushCount' }
  298. },
  299. // === /qw/records → /qw/record ===
  300. [process.env.VUE_APP_BASE_API + '/qw/records']: {
  301. target: 'http://localhost:8006',
  302. changeOrigin: true,
  303. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/records']: '/qw/record' }
  304. },
  305. // === /qw/workLinkUser → /qw/workLink ===
  306. [process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: {
  307. target: 'http://localhost:8006',
  308. changeOrigin: true,
  309. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: '/qw/workLink' }
  310. },
  311. // === /qw/workUser → /qw/work ===
  312. [process.env.VUE_APP_BASE_API + '/qw/workUser']: {
  313. target: 'http://localhost:8006',
  314. changeOrigin: true,
  315. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workUser']: '/qw/work' }
  316. },
  317. // === /qw/analyze → /qw/analyze (直接透传) ===
  318. // === /qw/customerProperty → /qw/customerProperty (直接透传) ===
  319. // === /crm/assist → /crm/assist (直接透传) ===
  320. // === /crm/analyze → /crm/analyze (直接透传) ===
  321. // === /crm/third → /crm/third (直接透传) ===
  322. // === /crm/event → /crm/event (直接透传) ===
  323. // === /crm/report → /crm/report (直接透传) ===
  324. // === /crm/customerHisOrder → /crm/customerHisOrder (直接透传) ===
  325. // === /crm/msg → /crm/msg (直接透传) ===
  326. // === /his/aiWorkflow → /his/aiWorkflow (直接透传) ===
  327. // his/fsXxx → store/xxx(saasadminui 用 his/fs 前缀,后端用 store)
  328. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: {
  329. target: 'http://localhost:8006',
  330. changeOrigin: true,
  331. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: '/store/storeOrder' }
  332. },
  333. [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: {
  334. target: 'http://localhost:8006',
  335. changeOrigin: true,
  336. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: '/store/inquiryOrderReport' }
  337. },
  338. [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: {
  339. target: 'http://localhost:8006',
  340. changeOrigin: true,
  341. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: '/store/inquiryOrder' }
  342. },
  343. [process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: {
  344. target: 'http://localhost:8006',
  345. changeOrigin: true,
  346. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: '/store/drugReportCount' }
  347. },
  348. [process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: {
  349. target: 'http://localhost:8006',
  350. changeOrigin: true,
  351. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: '/store/drugReport' }
  352. },
  353. [process.env.VUE_APP_BASE_API + '/his/fsHealthData']: {
  354. target: 'http://localhost:8006',
  355. changeOrigin: true,
  356. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthData']: '/store/healthData' }
  357. },
  358. [process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: {
  359. target: 'http://localhost:8006',
  360. changeOrigin: true,
  361. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: '/store/healthRecord' }
  362. },
  363. [process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: {
  364. target: 'http://localhost:8006',
  365. changeOrigin: true,
  366. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: '/store/userOnlineState' }
  367. },
  368. [process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: {
  369. target: 'http://localhost:8006',
  370. changeOrigin: true,
  371. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: '/store/userCoupon' }
  372. },
  373. [process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: {
  374. target: 'http://localhost:8006',
  375. changeOrigin: true,
  376. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: '/store/userAddress' }
  377. },
  378. [process.env.VUE_APP_BASE_API + '/his/fsUser']: {
  379. target: 'http://localhost:8006',
  380. changeOrigin: true,
  381. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUser']: '/store/user' }
  382. },
  383. [process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: {
  384. target: 'http://localhost:8006',
  385. changeOrigin: true,
  386. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: '/store/materialGroup' }
  387. },
  388. [process.env.VUE_APP_BASE_API + '/his/fsMaterial']: {
  389. target: 'http://localhost:8006',
  390. changeOrigin: true,
  391. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterial']: '/store/material' }
  392. },
  393. [process.env.VUE_APP_BASE_API + '/his/fsExportTask']: {
  394. target: 'http://localhost:8006',
  395. changeOrigin: true,
  396. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsExportTask']: '/store/exportTask' }
  397. },
  398. [process.env.VUE_APP_BASE_API + '/his/fsCoupon']: {
  399. target: 'http://localhost:8006',
  400. changeOrigin: true,
  401. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCoupon']: '/store/coupon' }
  402. },
  403. [process.env.VUE_APP_BASE_API + '/his/fsPatient']: {
  404. target: 'http://localhost:8006',
  405. changeOrigin: true,
  406. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPatient']: '/store/patient' }
  407. },
  408. [process.env.VUE_APP_BASE_API + '/his/fsPackage']: {
  409. target: 'http://localhost:8006',
  410. changeOrigin: true,
  411. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPackage']: '/store/package' }
  412. },
  413. [process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: {
  414. target: 'http://localhost:8006',
  415. changeOrigin: true,
  416. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: '/store/storeProductCategory' }
  417. },
  418. [process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: {
  419. target: 'http://localhost:8006',
  420. changeOrigin: true,
  421. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: '/store/storeProduct' }
  422. },
  423. [process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: {
  424. target: 'http://localhost:8006',
  425. changeOrigin: true,
  426. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: '/store/storeAfterSales' }
  427. },
  428. [process.env.VUE_APP_BASE_API + '/his/fsPayment']: {
  429. target: 'http://localhost:8006',
  430. changeOrigin: true,
  431. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPayment']: '/store/storePayment' }
  432. },
  433. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: {
  434. target: 'http://localhost:8006',
  435. changeOrigin: true,
  436. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' }
  437. },
  438. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: {
  439. target: 'http://localhost:8006',
  440. changeOrigin: true,
  441. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' }
  442. },
  443. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: {
  444. target: 'http://localhost:8006',
  445. changeOrigin: true,
  446. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: '/bill/billLog' }
  447. },
  448. [process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: {
  449. target: 'http://localhost:8006',
  450. changeOrigin: true,
  451. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: '/hisStore/fsStoreStatisticsScrm' }
  452. },
  453. [process.env.VUE_APP_BASE_API + '/his/fsIcd']: {
  454. target: 'http://localhost:8006',
  455. changeOrigin: true,
  456. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsIcd']: '/store/icd' }
  457. },
  458. [process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: {
  459. target: 'http://localhost:8006',
  460. changeOrigin: true,
  461. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: '/store/prescribe' }
  462. },
  463. [process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: {
  464. target: 'http://localhost:8006',
  465. changeOrigin: true,
  466. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: '/store/followTemp' }
  467. },
  468. [process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: {
  469. target: 'http://localhost:8006',
  470. changeOrigin: true,
  471. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: '/store/collectionSchedule' }
  472. },
  473. [process.env.VUE_APP_BASE_API + '/his/fsCollection']: {
  474. target: 'http://localhost:8006',
  475. changeOrigin: true,
  476. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollection']: '/store/collection' }
  477. },
  478. // his/fsFirstDiagnosis → his/diagnosis
  479. [process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: {
  480. target: 'http://localhost:8006',
  481. changeOrigin: true,
  482. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: '/his/diagnosis' }
  483. },
  484. // hisStore/collection → store/collection
  485. [process.env.VUE_APP_BASE_API + '/hisStore/collection']: {
  486. target: 'http://localhost:8006',
  487. changeOrigin: true,
  488. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/collection']: '/store/collection' }
  489. },
  490. // wx/wxSop* → qwSop/sopUserLogs* (企微SOP)
  491. [process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: {
  492. target: 'http://localhost:8006',
  493. changeOrigin: true,
  494. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: '/qwSop/sopUserLogsInfo' }
  495. },
  496. [process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: {
  497. target: 'http://localhost:8006',
  498. changeOrigin: true,
  499. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: '/qwSop/sopUserLogs' }
  500. },
  501. [process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: {
  502. target: 'http://localhost:8006',
  503. changeOrigin: true,
  504. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: '/qwSop/sopUserLogsInfo' }
  505. },
  506. [process.env.VUE_APP_BASE_API + '/wx/wxSop']: {
  507. target: 'http://localhost:8006',
  508. changeOrigin: true,
  509. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSop']: '/qwSop/sopUserLogs' }
  510. },
  511. // === /live/coupon → /live/coupon (直接透传,后端已有) ===
  512. // === /live/liveLotteryProductConf → /live/liveLotteryProductConf (直接透传) ===
  513. // === /live/liveAfterSalesLogs → /live/liveAfterSalesLogs (直接透传) ===
  514. // === /live/liveEventConf → /live/liveEventConf (直接透传) ===
  515. // === /live/liveOrderStatus → /live/liveOrderStatus (直接透传) ===
  516. // === /live/liveUserRedRecord → /live/liveUserRedRecord (直接透传) ===
  517. // === /live/trafficLog → /live/trafficLog (直接透传) ===
  518. // === /live/comment → /live/comment (直接透传) ===
  519. // === /course/userVideoComment → /course/userVideoComment (直接透传) ===
  520. // === /course/userCourseComment → /course/userCourseComment (直接透传) ===
  521. // === /course/userCourseNote → /course/userCourseNote (直接透传) ===
  522. // === /course/userCourseStudy → /course/userCourseStudy (直接透传) ===
  523. // === /course/userTalent → /course/userTalent (直接透传) ===
  524. // === /course/statistics → /course/statistics (直接透传) ===
  525. // === /course/courseQuestionCategory → /course/courseQuestionCategory (直接透传) ===
  526. // === /course/fsCourseProduct → /course/fsCourseProduct (直接透传) ===
  527. // === /course/fsUserCoursePeriodDays → /course/fsUserCoursePeriodDays (直接透传) ===
  528. // === /course/courseWatchComment → /course/courseWatchComment (直接透传) ===
  529. // === /course/videoTags → /course/videoTags (直接透传) ===
  530. // === /course/videoResource → /course/videoResource (直接透传) ===
  531. // === /his/patient → /his/patient (直接透传) ===
  532. // === /his/store → /his/store (直接透传) ===
  533. // === /his/coupon → /his/coupon (直接透传) ===
  534. // === /his/doctorBill → /his/doctorBill (直接透传) ===
  535. // === /his/storeBill → /his/storeBill (直接透传) ===
  536. // === /his/storeLog → /his/storeLog (直接透传) ===
  537. // === /his/storeExtract → /his/storeExtract (直接透传) ===
  538. // === /his/storeSubOrder → /his/storeSubOrder (直接透传) ===
  539. // === /his/storeAfterSales → /his/storeAfterSales (直接透传) ===
  540. // === /his/storeProduct → /his/storeProduct (直接透传) ===
  541. // === /his/storeProductPackage → /his/storeProductPackage (直接透传) ===
  542. // === /his/storeActivity → /his/storeActivity (直接透传) ===
  543. // === /his/storeOrder → /his/storeOrder (直接透传) ===
  544. // === /his/user → /his/user (直接透传) ===
  545. // === /his/userBill → /his/userBill (直接透传) ===
  546. // === /his/userExtract → /his/userExtract (直接透传) ===
  547. // === /his/userRecharge → /his/userRecharge (直接透传) ===
  548. // === /his/userIntegralLogs → /his/userIntegralLogs (直接透传) ===
  549. // === /his/companyRecharge → /his/companyRecharge (直接透传) ===
  550. // === /his/companyDeduct → /his/companyDeduct (直接透传) ===
  551. // === /his/company → /his/company (直接透传) ===
  552. // === /his/doctorExtract → /his/doctorExtract (直接透传) ===
  553. // === /his/doctorArticle → /his/doctorArticle (直接透传) ===
  554. // === /his/doctorArticleCate → /his/doctorArticleCate (直接透传) ===
  555. // === /his/doctorOperLog → /his/doctorOperLog (直接透传) ===
  556. // === /his/doctorPrescribeDrug → /his/doctorPrescribeDrug (直接透传) ===
  557. // === /his/doctorPrescribe → /his/doctorPrescribe (直接透传) ===
  558. // === /his/doctorProduct → /his/doctorProduct (直接透传) ===
  559. // === /his/disease → /his/disease (直接透传) ===
  560. // === /his/illnessLibrary → /his/illnessLibrary (直接透传) ===
  561. // === /his/inquiryDisease → /his/inquiryDisease (直接透传) ===
  562. // === /his/inquiryOrderPing → /his/inquiryOrderPing (直接透传) ===
  563. // === /his/inquiryTemp → /his/inquiryTemp (直接透传) ===
  564. // === /his/hospital → /his/hospital (直接透传) ===
  565. // === /his/department → /his/department (直接透传) ===
  566. // === /his/vessel → /his/vessel (直接透传) ===
  567. // === /his/chineseMedicine → /his/chineseMedicine (直接透传) ===
  568. // === /his/famousPrescribe → /his/famousPrescribe (直接透传) ===
  569. // === /his/medicatedFood → /his/medicatedFood (直接透传) ===
  570. // === /his/healthLife → /his/healthLife (直接透传) ===
  571. // === /his/healthHistoryTemp → /his/healthHistoryTemp (直接透传) ===
  572. // === /his/physicalReportTemplate → /his/physicalReportTemplate (直接透传) ===
  573. // === /his/physicalReportTemplateField → /his/physicalReportTemplateField (直接透传) ===
  574. // === /his/testReport → /his/testReport (直接透传) ===
  575. // === /his/testTemp → /his/testTemp (直接透传) ===
  576. // === /his/testTempItem → /his/testTempItem (直接透传) ===
  577. // === /his/template → /his/template (直接透传) ===
  578. // === /his/questions → /his/questions (直接透传) ===
  579. // === /his/answer → /his/answer (直接透传) ===
  580. // === /his/packageCate → /his/packageCate (直接透传) ===
  581. // === /his/packageSolarTerm → /his/packageSolarTerm (直接透传) ===
  582. // === /his/packageFavorite → /his/packageFavorite (直接透传) ===
  583. // === /his/packageOrder → /his/packageOrder (直接透传) ===
  584. // === /his/dfAccount → /his/dfAccount (直接透传) ===
  585. // === /his/hfpayConfig → /his/hfpayConfig (直接透传) ===
  586. // === /his/doctorAdvice → /his/doctorAdvice (直接透传) ===
  587. // === /his/homeView → /his/homeView (直接透传) ===
  588. // === /his/homeArticle → /his/homeArticle (直接透传) ===
  589. // === /his/homeCategory → /his/homeCategory (直接透传) ===
  590. // === /his/articleCate → /his/articleCate (直接透传) ===
  591. // === /his/articleViews → /his/articleViews (直接透传) ===
  592. // === /his/caseArticle → /his/caseArticle (直接透传) ===
  593. // === /his/adv → /his/adv (直接透传) ===
  594. // === /his/price → /his/price (直接透传) ===
  595. // === /his/appVersion → /his/appVersion (直接透传) ===
  596. // === /his/express → /his/express (直接透传) ===
  597. // === /his/userAddress → /his/userAddress (直接透传) ===
  598. // === /his/userCoupon → /his/userCoupon (直接透传) ===
  599. // === /his/merchantAppConfig → /his/merchantAppConfig (直接透传) ===
  600. // === /his/pharmacist → /his/pharmacist (直接透传) ===
  601. // === /his/complaint → /his/complaint (直接透传) ===
  602. // === /his/healthArticle → /his/healthArticle (直接透传) ===
  603. // === /his/promotionActive → /his/promotionActive (直接透传) ===
  604. // === /his/promotionActiveLog → /his/promotionActiveLog (直接透传) ===
  605. // === /his/logs → /his/logs (直接透传) ===
  606. // === /his/userNewTask → /his/userNewTask (直接透传) ===
  607. // === /his/divItem → /his/divItem (直接透传) ===
  608. // === /his/icd → /his/icd (直接透传) ===
  609. // === /his/aiWorkflow → /his/aiWorkflow (直接透传) ===
  610. // === /his/healthData → /his/healthData (直接透传) ===
  611. // === /his/inquiryOrder → /his/inquiryOrder (直接透传) ===
  612. // === /his/drugReportCount → /his/drugReportCount (直接透传) ===
  613. // === /his/doctor → /his/doctor (直接透传) ===
  614. // === /his/prescription → /his/prescription (直接透传) ===
  615. // === /his/drugReport → /his/drugReport (直接透传) ===
  616. // === /his/exportTask → /his/exportTask (直接透传) ===
  617. // === /his/healthTongue → /his/healthTongue (直接透传) ===
  618. // === /his/healthRecord → /his/healthRecord (直接透传) ===
  619. // === /his/diagnosis → /his/diagnosis (直接透传) ===
  620. // === /his/healthRecordTemplate → /his/healthRecordTemplate (直接透传) ===
  621. // === /his/healthTongueQuestion → /his/healthTongueQuestion (直接透传) ===
  622. // === /his/followPlan → /his/followPlan (直接透传) ===
  623. // === /his/recoveryRecord → /his/recoveryRecord (直接透传) ===
  624. // === /his/recoveryPlan → /his/recoveryPlan (直接透传) ===
  625. // === /his/healthReport → /his/healthReport (直接透传) ===
  626. // === /his/inquiryOrderReport → /his/inquiryOrderReport (直接透传) ===
  627. // === /his/inquiryDisease → /his/inquiryDisease (直接透传) ===
  628. // === /his/integralGoods → /his/integralGoods (直接透传) ===
  629. // === /his/integralOrder → /his/integralOrder (直接透传) ===
  630. // === /his/redPacket → /his/redPacket (直接透传) ===
  631. // watch-api → fs-watch 微服务(需要单独启动 fs-watch)
  632. [process.env.VUE_APP_BASE_API + '/watch-api']: {
  633. target: 'http://localhost:8010',
  634. changeOrigin: true,
  635. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/watch-api']: '' }
  636. },
  637. // ===== 默认所有其他请求 → fs-company(8006) 租户服务端 =====
  638. [process.env.VUE_APP_BASE_API]: {
  639. target: 'http://localhost:8006',
  640. changeOrigin: true,
  641. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' }
  642. }
  643. }
  644. },
  645. configureWebpack: {
  646. name: name,
  647. resolve: {
  648. alias: {
  649. '@': resolve('src')
  650. }
  651. },
  652. externals: {
  653. 'node:async_hooks': 'commonjs async_hooks',
  654. 'node:crypto': 'commonjs crypto',
  655. 'node:fs': 'commonjs fs',
  656. 'node:fs/promises': 'commonjs fs/promises',
  657. 'node:http': 'commonjs http',
  658. 'node:os': 'commonjs os',
  659. 'node:path': 'commonjs path',
  660. 'node:process': 'commonjs process',
  661. 'node:stream': 'commonjs stream',
  662. 'node:stream/web': 'commonjs stream',
  663. 'node:buffer': 'commonjs buffer',
  664. 'node:util': 'commonjs util',
  665. 'node:url': 'commonjs url',
  666. 'node:net': 'commonjs net',
  667. 'node:tls': 'commonjs tls',
  668. 'node:events': 'commonjs events',
  669. 'node:https': 'commonjs https',
  670. 'node:zlib': 'commonjs zlib',
  671. 'node:child_process': 'commonjs child_process'
  672. }
  673. },
  674. chainWebpack(config) {
  675. config.plugins.delete('preload') // TODO: need test
  676. config.plugins.delete('prefetch') // TODO: need test
  677. // set svg-sprite-loader
  678. config.module
  679. .rule('svg')
  680. .exclude.add(resolve('src/assets/icons'))
  681. .end()
  682. config.module
  683. .rule('icons')
  684. .test(/\.svg$/)
  685. .include.add(resolve('src/assets/icons'))
  686. .end()
  687. .use('svg-sprite-loader')
  688. .loader('svg-sprite-loader')
  689. .options({
  690. symbolId: 'icon-[name]'
  691. })
  692. .end()
  693. config
  694. .when(process.env.NODE_ENV !== 'development',
  695. config => {
  696. config
  697. .plugin('ScriptExtHtmlWebpackPlugin')
  698. .after('html')
  699. .use('script-ext-html-webpack-plugin', [{
  700. // `runtime` must same as runtimeChunk name. default is `runtime`
  701. inline: /runtime\..*\.js$/
  702. }])
  703. .end()
  704. config
  705. .optimization.splitChunks({
  706. chunks: 'all',
  707. cacheGroups: {
  708. libs: {
  709. name: 'chunk-libs',
  710. test: /[\\/]node_modules[\\/]/,
  711. priority: 10,
  712. chunks: 'initial' // only package third parties that are initially dependent
  713. },
  714. elementUI: {
  715. name: 'chunk-elementUI', // split elementUI into a single package
  716. priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
  717. test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
  718. },
  719. commons: {
  720. name: 'chunk-commons',
  721. test: resolve('src/components'), // can customize your rules
  722. minChunks: 3, // minimum common number
  723. priority: 5,
  724. reuseExistingChunk: true
  725. }
  726. }
  727. })
  728. config.optimization.runtimeChunk('single'),
  729. {
  730. from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
  731. to: './' //到根目录下
  732. }
  733. }
  734. )
  735. }
  736. }