vue.config.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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. // ===== 前端路径与后端不一致的路径重写 → fs-company(8006) =====
  40. //
  41. // saasadminui 前端 API 路径与 fs-company 后端控制器路径存在以下不一致:
  42. // 1. /store/store/* → 后端是 /store/* (前端多了一层 store)
  43. // 2. /store/his/* → 后端是 /his/* (前端 store/his 实际是 his)
  44. // 3. /his/fsXxx → 后端是 /store/xxx (his/fs 前缀映射到 store)
  45. // 4. /his_store/* → 后端是 /hisStore/* (下划线 vs 驼峰)
  46. // 5. /admin/medical/* → 路由到 fs-admin(8003)
  47. // 6. /fast_gpt/* → 后端是 /fastGpt/*
  48. // 7. /wx/wxSop* → 后端是 /qwSop/sopUserLogs*
  49. // 8. /wxSop/sopUserLogsWx → 后端是 /qwSop/sopUserLogs
  50. // 9. /sop/companySopRole → 后端是 /companySopRole
  51. //
  52. // === 批量路径重写:/store/store/* → /store/* ===
  53. [process.env.VUE_APP_BASE_API + '/store/store']: {
  54. target: 'http://localhost:8006',
  55. changeOrigin: true,
  56. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/store']: '/store' }
  57. },
  58. // === 批量路径重写:/store/his/* → /his/* ===
  59. [process.env.VUE_APP_BASE_API + '/store/his']: {
  60. target: 'http://localhost:8006',
  61. changeOrigin: true,
  62. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/his']: '/his' }
  63. },
  64. // === 批量路径重写:/store/doctor/* → /his/doctor/* ===
  65. [process.env.VUE_APP_BASE_API + '/store/doctor']: {
  66. target: 'http://localhost:8006',
  67. changeOrigin: true,
  68. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/doctor']: '/his/doctor' }
  69. },
  70. // === 批量路径重写:/store/healthTongue/* → /his/healthTongue/* ===
  71. [process.env.VUE_APP_BASE_API + '/store/healthTongue']: {
  72. target: 'http://localhost:8006',
  73. changeOrigin: true,
  74. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthTongue']: '/his/healthTongue' }
  75. },
  76. // === 批量路径重写:/store/inquiryOrder/* → /his/inquiryOrder/* ===
  77. [process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: {
  78. target: 'http://localhost:8006',
  79. changeOrigin: true,
  80. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: '/his/inquiryOrder' }
  81. },
  82. // === 批量路径重写:/store/prescribeDrug/* → /his/prescribeDrug/* ===
  83. [process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: {
  84. target: 'http://localhost:8006',
  85. changeOrigin: true,
  86. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: '/his/prescribeDrug' }
  87. },
  88. // === 批量路径重写:/store/healthStoreOrder/* → /hisStore/fsStoreOrderScrm/* ===
  89. [process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: {
  90. target: 'http://localhost:8006',
  91. changeOrigin: true,
  92. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: '/hisStore/fsStoreOrderScrm' }
  93. },
  94. // === 批量路径重写:/store/operlogScrm/* → /hisStore/operlogScrm/* ===
  95. [process.env.VUE_APP_BASE_API + '/store/operlogScrm']: {
  96. target: 'http://localhost:8006',
  97. changeOrigin: true,
  98. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/operlogScrm']: '/hisStore/operlogScrm' }
  99. },
  100. // === 批量路径重写:/store/storeOrderOffline/* → /hisStore/fsStoreOrderOfflineScrm/* ===
  101. [process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: {
  102. target: 'http://localhost:8006',
  103. changeOrigin: true,
  104. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' }
  105. },
  106. // === 批量路径重写:/store/storeOrderAudit/* → /hisStore/fsStoreOrderAuditScrm/* ===
  107. [process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: {
  108. target: 'http://localhost:8006',
  109. changeOrigin: true,
  110. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' }
  111. },
  112. // === 批量路径重写:/store/recommend/* → /store/storeRecommend/* ===
  113. [process.env.VUE_APP_BASE_API + '/store/recommend']: {
  114. target: 'http://localhost:8006',
  115. changeOrigin: true,
  116. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/recommend']: '/store/storeRecommend' }
  117. },
  118. // === 批量路径重写:/store/storeActivity/* → /hisStore/fsStoreActivityScrm/* ===
  119. [process.env.VUE_APP_BASE_API + '/store/storeActivity']: {
  120. target: 'http://localhost:8006',
  121. changeOrigin: true,
  122. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeActivity']: '/hisStore/fsStoreActivityScrm' }
  123. },
  124. // === 批量路径重写:/store/collectionSchedule/* → /hisStore/fsCollectionScheduleScrm/* ===
  125. [process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: {
  126. target: 'http://localhost:8006',
  127. changeOrigin: true,
  128. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: '/hisStore/fsCollectionScheduleScrm' }
  129. },
  130. // === his_store/* → hisStore/* (下划线转驼峰) ===
  131. [process.env.VUE_APP_BASE_API + '/his_store']: {
  132. target: 'http://localhost:8006',
  133. changeOrigin: true,
  134. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his_store']: '/hisStore' }
  135. },
  136. // === /admin/medical/* → fs-admin(8003) ===
  137. [process.env.VUE_APP_BASE_API + '/admin/medical']: {
  138. target: 'http://localhost:8003',
  139. changeOrigin: true,
  140. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/admin/medical']: '/admin/medical' }
  141. },
  142. // === /fast_gpt/* → /fastGpt/* ===
  143. [process.env.VUE_APP_BASE_API + '/fast_gpt']: {
  144. target: 'http://localhost:8006',
  145. changeOrigin: true,
  146. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/fast_gpt']: '/fastGpt' }
  147. },
  148. // === /wxSop/sopUserLogsWx → /qwSop/sopUserLogs ===
  149. [process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: {
  150. target: 'http://localhost:8006',
  151. changeOrigin: true,
  152. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: '/qwSop/sopUserLogs' }
  153. },
  154. // === /sop/companySopRole → /companySopRole ===
  155. [process.env.VUE_APP_BASE_API + '/sop/companySopRole']: {
  156. target: 'http://localhost:8006',
  157. changeOrigin: true,
  158. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/sop/companySopRole']: '/companySopRole' }
  159. },
  160. // === /company/ 路径无需特殊重写,走全局代理(只去掉 /dev-api 前缀,保留 /company/xxx)===
  161. // === /qw/qwInformation → /qw/information ===
  162. [process.env.VUE_APP_BASE_API + '/qw/qwInformation']: {
  163. target: 'http://localhost:8006',
  164. changeOrigin: true,
  165. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwInformation']: '/qw/information' }
  166. },
  167. // === /qw/qwAppContactWayLogs → /qw/appContactWayLogs ===
  168. [process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: {
  169. target: 'http://localhost:8006',
  170. changeOrigin: true,
  171. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: '/qw/appContactWayLogs' }
  172. },
  173. // === /qw/qwPushCount → /qw/pushCount ===
  174. [process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: {
  175. target: 'http://localhost:8006',
  176. changeOrigin: true,
  177. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: '/qw/pushCount' }
  178. },
  179. // === /qw/records → /qw/record ===
  180. [process.env.VUE_APP_BASE_API + '/qw/records']: {
  181. target: 'http://localhost:8006',
  182. changeOrigin: true,
  183. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/records']: '/qw/record' }
  184. },
  185. // === /qw/workLinkUser → /qw/workLink ===
  186. [process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: {
  187. target: 'http://localhost:8006',
  188. changeOrigin: true,
  189. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: '/qw/workLink' }
  190. },
  191. // === /qw/workUser → /qw/work ===
  192. [process.env.VUE_APP_BASE_API + '/qw/workUser']: {
  193. target: 'http://localhost:8006',
  194. changeOrigin: true,
  195. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workUser']: '/qw/work' }
  196. },
  197. // === /qw/analyze → /qw/analyze (直接透传) ===
  198. // === /qw/customerProperty → /qw/customerProperty (直接透传) ===
  199. // === /crm/assist → /crm/assist (直接透传) ===
  200. // === /crm/analyze → /crm/analyze (直接透传) ===
  201. // === /crm/third → /crm/third (直接透传) ===
  202. // === /crm/event → /crm/event (直接透传) ===
  203. // === /crm/report → /crm/report (直接透传) ===
  204. // === /crm/customerHisOrder → /crm/customerHisOrder (直接透传) ===
  205. // === /crm/msg → /crm/msg (直接透传) ===
  206. // === /his/aiWorkflow → /his/aiWorkflow (直接透传) ===
  207. // his/fsXxx → store/xxx(saasadminui 用 his/fs 前缀,后端用 store)
  208. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: {
  209. target: 'http://localhost:8006',
  210. changeOrigin: true,
  211. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: '/store/storeOrder' }
  212. },
  213. [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: {
  214. target: 'http://localhost:8006',
  215. changeOrigin: true,
  216. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: '/store/inquiryOrderReport' }
  217. },
  218. [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: {
  219. target: 'http://localhost:8006',
  220. changeOrigin: true,
  221. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: '/store/inquiryOrder' }
  222. },
  223. [process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: {
  224. target: 'http://localhost:8006',
  225. changeOrigin: true,
  226. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: '/store/drugReportCount' }
  227. },
  228. [process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: {
  229. target: 'http://localhost:8006',
  230. changeOrigin: true,
  231. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: '/store/drugReport' }
  232. },
  233. [process.env.VUE_APP_BASE_API + '/his/fsHealthData']: {
  234. target: 'http://localhost:8006',
  235. changeOrigin: true,
  236. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthData']: '/store/healthData' }
  237. },
  238. [process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: {
  239. target: 'http://localhost:8006',
  240. changeOrigin: true,
  241. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: '/store/healthRecord' }
  242. },
  243. [process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: {
  244. target: 'http://localhost:8006',
  245. changeOrigin: true,
  246. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: '/store/userOnlineState' }
  247. },
  248. [process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: {
  249. target: 'http://localhost:8006',
  250. changeOrigin: true,
  251. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: '/store/userCoupon' }
  252. },
  253. [process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: {
  254. target: 'http://localhost:8006',
  255. changeOrigin: true,
  256. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: '/store/userAddress' }
  257. },
  258. [process.env.VUE_APP_BASE_API + '/his/fsUser']: {
  259. target: 'http://localhost:8006',
  260. changeOrigin: true,
  261. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUser']: '/store/user' }
  262. },
  263. [process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: {
  264. target: 'http://localhost:8006',
  265. changeOrigin: true,
  266. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: '/store/materialGroup' }
  267. },
  268. [process.env.VUE_APP_BASE_API + '/his/fsMaterial']: {
  269. target: 'http://localhost:8006',
  270. changeOrigin: true,
  271. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterial']: '/store/material' }
  272. },
  273. [process.env.VUE_APP_BASE_API + '/his/fsExportTask']: {
  274. target: 'http://localhost:8006',
  275. changeOrigin: true,
  276. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsExportTask']: '/store/exportTask' }
  277. },
  278. [process.env.VUE_APP_BASE_API + '/his/fsCoupon']: {
  279. target: 'http://localhost:8006',
  280. changeOrigin: true,
  281. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCoupon']: '/store/coupon' }
  282. },
  283. [process.env.VUE_APP_BASE_API + '/his/fsPatient']: {
  284. target: 'http://localhost:8006',
  285. changeOrigin: true,
  286. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPatient']: '/store/patient' }
  287. },
  288. [process.env.VUE_APP_BASE_API + '/his/fsPackage']: {
  289. target: 'http://localhost:8006',
  290. changeOrigin: true,
  291. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPackage']: '/store/package' }
  292. },
  293. [process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: {
  294. target: 'http://localhost:8006',
  295. changeOrigin: true,
  296. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: '/store/storeProductCategory' }
  297. },
  298. [process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: {
  299. target: 'http://localhost:8006',
  300. changeOrigin: true,
  301. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: '/store/storeProduct' }
  302. },
  303. [process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: {
  304. target: 'http://localhost:8006',
  305. changeOrigin: true,
  306. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: '/store/storeAfterSales' }
  307. },
  308. [process.env.VUE_APP_BASE_API + '/his/fsPayment']: {
  309. target: 'http://localhost:8006',
  310. changeOrigin: true,
  311. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPayment']: '/store/storePayment' }
  312. },
  313. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: {
  314. target: 'http://localhost:8006',
  315. changeOrigin: true,
  316. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' }
  317. },
  318. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: {
  319. target: 'http://localhost:8006',
  320. changeOrigin: true,
  321. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' }
  322. },
  323. [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: {
  324. target: 'http://localhost:8006',
  325. changeOrigin: true,
  326. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: '/bill/billLog' }
  327. },
  328. [process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: {
  329. target: 'http://localhost:8006',
  330. changeOrigin: true,
  331. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: '/hisStore/fsStoreStatisticsScrm' }
  332. },
  333. [process.env.VUE_APP_BASE_API + '/his/fsIcd']: {
  334. target: 'http://localhost:8006',
  335. changeOrigin: true,
  336. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsIcd']: '/store/icd' }
  337. },
  338. [process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: {
  339. target: 'http://localhost:8006',
  340. changeOrigin: true,
  341. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: '/store/prescribe' }
  342. },
  343. [process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: {
  344. target: 'http://localhost:8006',
  345. changeOrigin: true,
  346. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: '/store/followTemp' }
  347. },
  348. [process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: {
  349. target: 'http://localhost:8006',
  350. changeOrigin: true,
  351. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: '/store/collectionSchedule' }
  352. },
  353. [process.env.VUE_APP_BASE_API + '/his/fsCollection']: {
  354. target: 'http://localhost:8006',
  355. changeOrigin: true,
  356. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollection']: '/store/collection' }
  357. },
  358. // his/fsFirstDiagnosis → his/diagnosis
  359. [process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: {
  360. target: 'http://localhost:8006',
  361. changeOrigin: true,
  362. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: '/his/diagnosis' }
  363. },
  364. // hisStore/collection → store/collection
  365. [process.env.VUE_APP_BASE_API + '/hisStore/collection']: {
  366. target: 'http://localhost:8006',
  367. changeOrigin: true,
  368. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/collection']: '/store/collection' }
  369. },
  370. // wx/wxSop* → qwSop/sopUserLogs* (企微SOP)
  371. [process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: {
  372. target: 'http://localhost:8006',
  373. changeOrigin: true,
  374. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: '/qwSop/sopUserLogsInfo' }
  375. },
  376. [process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: {
  377. target: 'http://localhost:8006',
  378. changeOrigin: true,
  379. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: '/qwSop/sopUserLogs' }
  380. },
  381. [process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: {
  382. target: 'http://localhost:8006',
  383. changeOrigin: true,
  384. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: '/qwSop/sopUserLogsInfo' }
  385. },
  386. [process.env.VUE_APP_BASE_API + '/wx/wxSop']: {
  387. target: 'http://localhost:8006',
  388. changeOrigin: true,
  389. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSop']: '/qwSop/sopUserLogs' }
  390. },
  391. // === /live/coupon → /live/coupon (直接透传,后端已有) ===
  392. // === /live/liveLotteryProductConf → /live/liveLotteryProductConf (直接透传) ===
  393. // === /live/liveAfterSalesLogs → /live/liveAfterSalesLogs (直接透传) ===
  394. // === /live/liveEventConf → /live/liveEventConf (直接透传) ===
  395. // === /live/liveOrderStatus → /live/liveOrderStatus (直接透传) ===
  396. // === /live/liveUserRedRecord → /live/liveUserRedRecord (直接透传) ===
  397. // === /live/trafficLog → /live/trafficLog (直接透传) ===
  398. // === /live/comment → /live/comment (直接透传) ===
  399. // === /course/userVideoComment → /course/userVideoComment (直接透传) ===
  400. // === /course/userCourseComment → /course/userCourseComment (直接透传) ===
  401. // === /course/userCourseNote → /course/userCourseNote (直接透传) ===
  402. // === /course/userCourseStudy → /course/userCourseStudy (直接透传) ===
  403. // === /course/userTalent → /course/userTalent (直接透传) ===
  404. // === /course/statistics → /course/statistics (直接透传) ===
  405. // === /course/courseQuestionCategory → /course/courseQuestionCategory (直接透传) ===
  406. // === /course/fsCourseProduct → /course/fsCourseProduct (直接透传) ===
  407. // === /course/fsUserCoursePeriodDays → /course/fsUserCoursePeriodDays (直接透传) ===
  408. // === /course/courseWatchComment → /course/courseWatchComment (直接透传) ===
  409. // === /course/videoTags → /course/videoTags (直接透传) ===
  410. // === /course/videoResource → /course/videoResource (直接透传) ===
  411. // === /his/patient → /his/patient (直接透传) ===
  412. // === /his/store → /his/store (直接透传) ===
  413. // === /his/coupon → /his/coupon (直接透传) ===
  414. // === /his/doctorBill → /his/doctorBill (直接透传) ===
  415. // === /his/storeBill → /his/storeBill (直接透传) ===
  416. // === /his/storeLog → /his/storeLog (直接透传) ===
  417. // === /his/storeExtract → /his/storeExtract (直接透传) ===
  418. // === /his/storeSubOrder → /his/storeSubOrder (直接透传) ===
  419. // === /his/storeAfterSales → /his/storeAfterSales (直接透传) ===
  420. // === /his/storeProduct → /his/storeProduct (直接透传) ===
  421. // === /his/storeProductPackage → /his/storeProductPackage (直接透传) ===
  422. // === /his/storeActivity → /his/storeActivity (直接透传) ===
  423. // === /his/storeOrder → /his/storeOrder (直接透传) ===
  424. // === /his/user → /his/user (直接透传) ===
  425. // === /his/userBill → /his/userBill (直接透传) ===
  426. // === /his/userExtract → /his/userExtract (直接透传) ===
  427. // === /his/userRecharge → /his/userRecharge (直接透传) ===
  428. // === /his/userIntegralLogs → /his/userIntegralLogs (直接透传) ===
  429. // === /his/companyRecharge → /his/companyRecharge (直接透传) ===
  430. // === /his/companyDeduct → /his/companyDeduct (直接透传) ===
  431. // === /his/company → /his/company (直接透传) ===
  432. // === /his/doctorExtract → /his/doctorExtract (直接透传) ===
  433. // === /his/doctorArticle → /his/doctorArticle (直接透传) ===
  434. // === /his/doctorArticleCate → /his/doctorArticleCate (直接透传) ===
  435. // === /his/doctorOperLog → /his/doctorOperLog (直接透传) ===
  436. // === /his/doctorPrescribeDrug → /his/doctorPrescribeDrug (直接透传) ===
  437. // === /his/doctorPrescribe → /his/doctorPrescribe (直接透传) ===
  438. // === /his/doctorProduct → /his/doctorProduct (直接透传) ===
  439. // === /his/disease → /his/disease (直接透传) ===
  440. // === /his/illnessLibrary → /his/illnessLibrary (直接透传) ===
  441. // === /his/inquiryDisease → /his/inquiryDisease (直接透传) ===
  442. // === /his/inquiryOrderPing → /his/inquiryOrderPing (直接透传) ===
  443. // === /his/inquiryTemp → /his/inquiryTemp (直接透传) ===
  444. // === /his/hospital → /his/hospital (直接透传) ===
  445. // === /his/department → /his/department (直接透传) ===
  446. // === /his/vessel → /his/vessel (直接透传) ===
  447. // === /his/chineseMedicine → /his/chineseMedicine (直接透传) ===
  448. // === /his/famousPrescribe → /his/famousPrescribe (直接透传) ===
  449. // === /his/medicatedFood → /his/medicatedFood (直接透传) ===
  450. // === /his/healthLife → /his/healthLife (直接透传) ===
  451. // === /his/healthHistoryTemp → /his/healthHistoryTemp (直接透传) ===
  452. // === /his/physicalReportTemplate → /his/physicalReportTemplate (直接透传) ===
  453. // === /his/physicalReportTemplateField → /his/physicalReportTemplateField (直接透传) ===
  454. // === /his/testReport → /his/testReport (直接透传) ===
  455. // === /his/testTemp → /his/testTemp (直接透传) ===
  456. // === /his/testTempItem → /his/testTempItem (直接透传) ===
  457. // === /his/template → /his/template (直接透传) ===
  458. // === /his/questions → /his/questions (直接透传) ===
  459. // === /his/answer → /his/answer (直接透传) ===
  460. // === /his/packageCate → /his/packageCate (直接透传) ===
  461. // === /his/packageSolarTerm → /his/packageSolarTerm (直接透传) ===
  462. // === /his/packageFavorite → /his/packageFavorite (直接透传) ===
  463. // === /his/packageOrder → /his/packageOrder (直接透传) ===
  464. // === /his/dfAccount → /his/dfAccount (直接透传) ===
  465. // === /his/hfpayConfig → /his/hfpayConfig (直接透传) ===
  466. // === /his/doctorAdvice → /his/doctorAdvice (直接透传) ===
  467. // === /his/homeView → /his/homeView (直接透传) ===
  468. // === /his/homeArticle → /his/homeArticle (直接透传) ===
  469. // === /his/homeCategory → /his/homeCategory (直接透传) ===
  470. // === /his/articleCate → /his/articleCate (直接透传) ===
  471. // === /his/articleViews → /his/articleViews (直接透传) ===
  472. // === /his/caseArticle → /his/caseArticle (直接透传) ===
  473. // === /his/adv → /his/adv (直接透传) ===
  474. // === /his/price → /his/price (直接透传) ===
  475. // === /his/appVersion → /his/appVersion (直接透传) ===
  476. // === /his/express → /his/express (直接透传) ===
  477. // === /his/userAddress → /his/userAddress (直接透传) ===
  478. // === /his/userCoupon → /his/userCoupon (直接透传) ===
  479. // === /his/merchantAppConfig → /his/merchantAppConfig (直接透传) ===
  480. // === /his/pharmacist → /his/pharmacist (直接透传) ===
  481. // === /his/complaint → /his/complaint (直接透传) ===
  482. // === /his/healthArticle → /his/healthArticle (直接透传) ===
  483. // === /his/promotionActive → /his/promotionActive (直接透传) ===
  484. // === /his/promotionActiveLog → /his/promotionActiveLog (直接透传) ===
  485. // === /his/logs → /his/logs (直接透传) ===
  486. // === /his/userNewTask → /his/userNewTask (直接透传) ===
  487. // === /his/divItem → /his/divItem (直接透传) ===
  488. // === /his/icd → /his/icd (直接透传) ===
  489. // === /his/aiWorkflow → /his/aiWorkflow (直接透传) ===
  490. // === /his/healthData → /his/healthData (直接透传) ===
  491. // === /his/inquiryOrder → /his/inquiryOrder (直接透传) ===
  492. // === /his/drugReportCount → /his/drugReportCount (直接透传) ===
  493. // === /his/doctor → /his/doctor (直接透传) ===
  494. // === /his/prescription → /his/prescription (直接透传) ===
  495. // === /his/drugReport → /his/drugReport (直接透传) ===
  496. // === /his/exportTask → /his/exportTask (直接透传) ===
  497. // === /his/healthTongue → /his/healthTongue (直接透传) ===
  498. // === /his/healthRecord → /his/healthRecord (直接透传) ===
  499. // === /his/diagnosis → /his/diagnosis (直接透传) ===
  500. // === /his/healthRecordTemplate → /his/healthRecordTemplate (直接透传) ===
  501. // === /his/healthTongueQuestion → /his/healthTongueQuestion (直接透传) ===
  502. // === /his/followPlan → /his/followPlan (直接透传) ===
  503. // === /his/recoveryRecord → /his/recoveryRecord (直接透传) ===
  504. // === /his/recoveryPlan → /his/recoveryPlan (直接透传) ===
  505. // === /his/healthReport → /his/healthReport (直接透传) ===
  506. // === /his/inquiryOrderReport → /his/inquiryOrderReport (直接透传) ===
  507. // === /his/inquiryDisease → /his/inquiryDisease (直接透传) ===
  508. // === /his/integralGoods → /his/integralGoods (直接透传) ===
  509. // === /his/integralOrder → /his/integralOrder (直接透传) ===
  510. // === /his/redPacket → /his/redPacket (直接透传) ===
  511. // watch-api → fs-watch 微服务(需要单独启动 fs-watch)
  512. [process.env.VUE_APP_BASE_API + '/watch-api']: {
  513. target: 'http://localhost:8010',
  514. changeOrigin: true,
  515. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/watch-api']: '' }
  516. },
  517. // ===== 默认所有其他请求 → fs-company(8006) 租户服务端 =====
  518. [process.env.VUE_APP_BASE_API]: {
  519. target: 'http://localhost:8006',
  520. changeOrigin: true,
  521. pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' }
  522. }
  523. }
  524. },
  525. configureWebpack: {
  526. name: name,
  527. resolve: {
  528. alias: {
  529. '@': resolve('src')
  530. }
  531. },
  532. externals: {
  533. 'node:async_hooks': 'commonjs async_hooks',
  534. 'node:crypto': 'commonjs crypto',
  535. 'node:fs': 'commonjs fs',
  536. 'node:fs/promises': 'commonjs fs/promises',
  537. 'node:http': 'commonjs http',
  538. 'node:os': 'commonjs os',
  539. 'node:path': 'commonjs path',
  540. 'node:process': 'commonjs process',
  541. 'node:stream': 'commonjs stream',
  542. 'node:stream/web': 'commonjs stream',
  543. 'node:buffer': 'commonjs buffer',
  544. 'node:util': 'commonjs util',
  545. 'node:url': 'commonjs url',
  546. 'node:net': 'commonjs net',
  547. 'node:tls': 'commonjs tls',
  548. 'node:events': 'commonjs events',
  549. 'node:https': 'commonjs https',
  550. 'node:zlib': 'commonjs zlib',
  551. 'node:child_process': 'commonjs child_process'
  552. }
  553. },
  554. chainWebpack(config) {
  555. config.plugins.delete('preload') // TODO: need test
  556. config.plugins.delete('prefetch') // TODO: need test
  557. // set svg-sprite-loader
  558. config.module
  559. .rule('svg')
  560. .exclude.add(resolve('src/assets/icons'))
  561. .end()
  562. config.module
  563. .rule('icons')
  564. .test(/\.svg$/)
  565. .include.add(resolve('src/assets/icons'))
  566. .end()
  567. .use('svg-sprite-loader')
  568. .loader('svg-sprite-loader')
  569. .options({
  570. symbolId: 'icon-[name]'
  571. })
  572. .end()
  573. config
  574. .when(process.env.NODE_ENV !== 'development',
  575. config => {
  576. config
  577. .plugin('ScriptExtHtmlWebpackPlugin')
  578. .after('html')
  579. .use('script-ext-html-webpack-plugin', [{
  580. // `runtime` must same as runtimeChunk name. default is `runtime`
  581. inline: /runtime\..*\.js$/
  582. }])
  583. .end()
  584. config
  585. .optimization.splitChunks({
  586. chunks: 'all',
  587. cacheGroups: {
  588. libs: {
  589. name: 'chunk-libs',
  590. test: /[\\/]node_modules[\\/]/,
  591. priority: 10,
  592. chunks: 'initial' // only package third parties that are initially dependent
  593. },
  594. elementUI: {
  595. name: 'chunk-elementUI', // split elementUI into a single package
  596. priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
  597. test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
  598. },
  599. commons: {
  600. name: 'chunk-commons',
  601. test: resolve('src/components'), // can customize your rules
  602. minChunks: 3, // minimum common number
  603. priority: 5,
  604. reuseExistingChunk: true
  605. }
  606. }
  607. })
  608. config.optimization.runtimeChunk('single'),
  609. {
  610. from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
  611. to: './' //到根目录下
  612. }
  613. }
  614. )
  615. }
  616. }