'use strict' const path = require('path') function resolve(dir) { return path.join(__dirname, dir) } const name = process.env.VUE_APP_TITLE || '云联私域管理系统' // 网页标题 const port = process.env.port || process.env.npm_config_port || 80 // 端口 // vue.config.js 配置说明 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions // 这里只列一部分,具体配置参考文档 module.exports = { // 部署生产环境和开发环境下的URL。 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.test.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.test.vip/admin/,则设置 baseUrl 为 /admin/。 publicPath: process.env.NODE_ENV === "production" ? "/" : "/", // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) outputDir: 'dist', // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) assetsDir: 'static', // 是否开启eslint保存检测,有效值:ture | false | 'error' lintOnSave: process.env.NODE_ENV === 'development', // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, // transpileDependencies: true, // 默认情况下 babel-loader 忽略 node_modules 中的所有文件,启用此选项需配置transpileDependencies transpileDependencies: [ /@aws-sdk/, /@aws/, /@smithy/, /@huaweicloud/, /vod-js-sdk-v6/ ], // webpack-dev-server 相关配置 devServer: { host: '0.0.0.0', port: port, open: true, disableHostCheck: true, proxy: { // ===== 前端路径与后端不一致的路径重写 → fs-company(8006) ===== // // saasadminui 前端 API 路径与 fs-company 后端控制器路径存在以下不一致: // 1. /store/store/* → 后端是 /store/* (前端多了一层 store) // 2. /store/his/* → 后端是 /his/* (前端 store/his 实际是 his) // 3. /his/fsXxx → 后端是 /store/xxx (his/fs 前缀映射到 store) // 4. /his_store/* → 后端是 /hisStore/* (下划线 vs 驼峰) // 5. /admin/medical/* → 路由到 fs-admin(8003) // 6. /fast_gpt/* → 后端是 /fastGpt/* // 7. /wx/wxSop* → 后端是 /qwSop/sopUserLogs* // 8. /wxSop/sopUserLogsWx → 后端是 /qwSop/sopUserLogs // 9. /sop/companySopRole → 后端是 /companySopRole // // === 批量路径重写:/store/store/ → /store/ (仅匹配 hisStore 二级目录下的 store 前缀) === // 注意:此规则仅匹配前端 api/hisStore/store*.js 中 url 以 /store/store/ 开头的请求 // 不匹配 /store/storeProduct 等路径 [process.env.VUE_APP_BASE_API + '/store/store/']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/store/']: '/store/' } }, // === /store/store/storeOrder → /hisStore/fsStoreOrderScrm (hisStore订单API在fs-admin-saas) === [process.env.VUE_APP_BASE_API + '/store/store/storeOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/store/storeOrder']: '/hisStore/fsStoreOrderScrm' } }, // === 批量路径重写:/store/his/* → /his/* === [process.env.VUE_APP_BASE_API + '/store/his']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/his']: '/his' } }, // === 批量路径重写:/store/doctor/* → /his/doctor/* === [process.env.VUE_APP_BASE_API + '/store/doctor']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/doctor']: '/his/doctor' } }, // === 批量路径重写:/store/healthTongue/* → /his/healthTongue/* === [process.env.VUE_APP_BASE_API + '/store/healthTongue']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthTongue']: '/his/healthTongue' } }, // === 批量路径重写:/store/inquiryOrder/* → /his/inquiryOrder/* === [process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/inquiryOrder']: '/his/inquiryOrder' } }, // === 批量路径重写:/store/prescribeDrug/* → /his/prescribeDrug/* === [process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/prescribeDrug']: '/his/prescribeDrug' } }, // === 批量路径重写:/store/healthStoreOrder/* → /hisStore/fsStoreOrderScrm/* === [process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/healthStoreOrder']: '/hisStore/fsStoreOrderScrm' } }, // === 批量路径重写:/store/operlogScrm/* → /hisStore/operlogScrm/* === [process.env.VUE_APP_BASE_API + '/store/operlogScrm']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/operlogScrm']: '/hisStore/operlogScrm' } }, // === 批量路径重写:/store/storeOrderOffline/* → /hisStore/fsStoreOrderOfflineScrm/* === [process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' } }, // === 批量路径重写:/store/storeOrderAudit/* → /hisStore/fsStoreOrderAuditScrm/* === [process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' } }, // === 批量路径重写:/store/recommend/* → /store/storeRecommend/* === [process.env.VUE_APP_BASE_API + '/store/recommend']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/recommend']: '/store/storeRecommend' } }, // === 批量路径重写:/store/storeActivity/* → /hisStore/fsStoreActivityScrm/* === [process.env.VUE_APP_BASE_API + '/store/storeActivity']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/storeActivity']: '/hisStore/fsStoreActivityScrm' } }, // === 批量路径重写:/store/collectionSchedule/* → /hisStore/fsCollectionScheduleScrm/* === [process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/store/collectionSchedule']: '/hisStore/fsCollectionScheduleScrm' } }, // === his_store/* → hisStore/* (下划线转驼峰) === [process.env.VUE_APP_BASE_API + '/his_store']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his_store']: '/hisStore' } }, // === /admin/medical/* → fs-admin(8003) === [process.env.VUE_APP_BASE_API + '/admin/medical']: { target: 'http://localhost:8003', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/admin/medical']: '/admin/medical' } }, // === /fast_gpt/* → /fastGpt/* === [process.env.VUE_APP_BASE_API + '/fast_gpt']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/fast_gpt']: '/fastGpt' } }, // === /wxSop/sopUserLogsWx → /qwSop/sopUserLogs === [process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wxSop/sopUserLogsWx']: '/qwSop/sopUserLogs' } }, // === /sop/companySopRole → /companySopRole === [process.env.VUE_APP_BASE_API + '/sop/companySopRole']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/sop/companySopRole']: '/companySopRole' } }, // === /company/ 路径无需特殊重写,走全局代理(只去掉 /dev-api 前缀,保留 /company/xxx)=== // === /qw/qwInformation → /qw/information === [process.env.VUE_APP_BASE_API + '/qw/qwInformation']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwInformation']: '/qw/information' } }, // === /qw/qwAppContactWayLogs → /qw/appContactWayLogs === [process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwAppContactWayLogs']: '/qw/appContactWayLogs' } }, // === /qw/qwPushCount → /qw/pushCount === [process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/qwPushCount']: '/qw/pushCount' } }, // === /qw/records → /qw/record === [process.env.VUE_APP_BASE_API + '/qw/records']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/records']: '/qw/record' } }, // === /qw/workLinkUser → /qw/workLink === [process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workLinkUser']: '/qw/workLink' } }, // === /qw/workUser → /qw/work === [process.env.VUE_APP_BASE_API + '/qw/workUser']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/workUser']: '/qw/work' } }, // === /qw/analyze → /qw/analyze (直接透传) === // === /qw/customerProperty → /qw/customerProperty (直接透传) === // === /crm/assist → /crm/assist (直接透传) === // === /crm/analyze → /crm/analyze (直接透传) === // === /crm/third → /crm/third (直接透传) === // === /crm/event → /crm/event (直接透传) === // === /crm/report → /crm/report (直接透传) === // === /crm/customerHisOrder → /crm/customerHisOrder (直接透传) === // === /crm/msg → /crm/msg (直接透传) === // === /his/aiWorkflow → /his/aiWorkflow (直接透传) === // his/fsXxx → store/xxx(saasadminui 用 his/fs 前缀,后端用 store) [process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrder']: '/store/storeOrder' } }, [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrderReport']: '/store/inquiryOrderReport' } }, [process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsInquiryOrder']: '/store/inquiryOrder' } }, [process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReportCount']: '/store/drugReportCount' } }, [process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsDrugReport']: '/store/drugReport' } }, [process.env.VUE_APP_BASE_API + '/his/fsHealthData']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthData']: '/store/healthData' } }, [process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsHealthRecord']: '/store/healthRecord' } }, [process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserOnlineState']: '/store/userOnlineState' } }, [process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserCoupon']: '/store/userCoupon' } }, [process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUserAddress']: '/store/userAddress' } }, [process.env.VUE_APP_BASE_API + '/his/fsUser']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsUser']: '/store/user' } }, [process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterialGroup']: '/store/materialGroup' } }, [process.env.VUE_APP_BASE_API + '/his/fsMaterial']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsMaterial']: '/store/material' } }, [process.env.VUE_APP_BASE_API + '/his/fsExportTask']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsExportTask']: '/store/exportTask' } }, [process.env.VUE_APP_BASE_API + '/his/fsCoupon']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCoupon']: '/store/coupon' } }, [process.env.VUE_APP_BASE_API + '/his/fsPatient']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPatient']: '/store/patient' } }, [process.env.VUE_APP_BASE_API + '/his/fsPackage']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPackage']: '/store/package' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProductCategory']: '/store/storeProductCategory' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreProduct']: '/store/storeProduct' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreAfterSales']: '/store/storeAfterSales' } }, [process.env.VUE_APP_BASE_API + '/his/fsPayment']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPayment']: '/store/storePayment' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreOrderBillLog']: '/bill/billLog' } }, [process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsStoreStatistics']: '/hisStore/fsStoreStatisticsScrm' } }, [process.env.VUE_APP_BASE_API + '/his/fsIcd']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsIcd']: '/store/icd' } }, [process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsPrescribe']: '/store/prescribe' } }, [process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFollowTemp']: '/store/followTemp' } }, [process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollectionSchedule']: '/store/collectionSchedule' } }, [process.env.VUE_APP_BASE_API + '/his/fsCollection']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsCollection']: '/store/collection' } }, // his/fsFirstDiagnosis → his/diagnosis [process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/his/fsFirstDiagnosis']: '/his/diagnosis' } }, // hisStore/collection → store/collection [process.env.VUE_APP_BASE_API + '/hisStore/collection']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/collection']: '/store/collection' } }, // wx/wxSop* → qwSop/sopUserLogs* (企微SOP) [process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUserInfo']: '/qwSop/sopUserLogsInfo' } }, [process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopUser']: '/qwSop/sopUserLogs' } }, [process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSopLogs']: '/qwSop/sopUserLogsInfo' } }, [process.env.VUE_APP_BASE_API + '/wx/wxSop']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/wx/wxSop']: '/qwSop/sopUserLogs' } }, // === /live/coupon → /live/coupon (直接透传,后端已有) === // === /live/liveLotteryProductConf → /live/liveLotteryProductConf (直接透传) === // === /live/liveAfterSalesLogs → /live/liveAfterSalesLogs (直接透传) === // === /live/liveEventConf → /live/liveEventConf (直接透传) === // === /live/liveOrderStatus → /live/liveOrderStatus (直接透传) === // === /live/liveUserRedRecord → /live/liveUserRedRecord (直接透传) === // === /live/trafficLog → /live/trafficLog (直接透传) === // === /live/comment → /live/comment (直接透传) === // === /course/userVideoComment → /course/userVideoComment (直接透传) === // === /course/userCourseComment → /course/userCourseComment (直接透传) === // === /course/userCourseNote → /course/userCourseNote (直接透传) === // === /course/userCourseStudy → /course/userCourseStudy (直接透传) === // === /course/userTalent → /course/userTalent (直接透传) === // === /course/statistics → /course/statistics (直接透传) === // === /course/courseQuestionCategory → /course/courseQuestionCategory (直接透传) === // === /course/fsCourseProduct → /course/fsCourseProduct (直接透传) === // === /course/fsUserCoursePeriodDays → /course/fsUserCoursePeriodDays (直接透传) === // === /course/courseWatchComment → /course/courseWatchComment (直接透传) === // === /course/videoTags → /course/videoTags (直接透传) === // === /course/videoResource → /course/videoResource (直接透传) === // === /his/patient → /his/patient (直接透传) === // === /his/store → /his/store (直接透传) === // === /his/coupon → /his/coupon (直接透传) === // === /his/doctorBill → /his/doctorBill (直接透传) === // === /his/storeBill → /his/storeBill (直接透传) === // === /his/storeLog → /his/storeLog (直接透传) === // === /his/storeExtract → /his/storeExtract (直接透传) === // === /his/storeSubOrder → /his/storeSubOrder (直接透传) === // === /his/storeAfterSales → /his/storeAfterSales (直接透传) === // === /his/storeProduct → /his/storeProduct (直接透传) === // === /his/storeProductPackage → /his/storeProductPackage (直接透传) === // === /his/storeActivity → /his/storeActivity (直接透传) === // === /his/storeOrder → /his/storeOrder (直接透传) === // === /his/user → /his/user (直接透传) === // === /his/userBill → /his/userBill (直接透传) === // === /his/userExtract → /his/userExtract (直接透传) === // === /his/userRecharge → /his/userRecharge (直接透传) === // === /his/userIntegralLogs → /his/userIntegralLogs (直接透传) === // === /his/companyRecharge → /his/companyRecharge (直接透传) === // === /his/companyDeduct → /his/companyDeduct (直接透传) === // === /his/company → /his/company (直接透传) === // === /his/doctorExtract → /his/doctorExtract (直接透传) === // === /his/doctorArticle → /his/doctorArticle (直接透传) === // === /his/doctorArticleCate → /his/doctorArticleCate (直接透传) === // === /his/doctorOperLog → /his/doctorOperLog (直接透传) === // === /his/doctorPrescribeDrug → /his/doctorPrescribeDrug (直接透传) === // === /his/doctorPrescribe → /his/doctorPrescribe (直接透传) === // === /his/doctorProduct → /his/doctorProduct (直接透传) === // === /his/disease → /his/disease (直接透传) === // === /his/illnessLibrary → /his/illnessLibrary (直接透传) === // === /his/inquiryDisease → /his/inquiryDisease (直接透传) === // === /his/inquiryOrderPing → /his/inquiryOrderPing (直接透传) === // === /his/inquiryTemp → /his/inquiryTemp (直接透传) === // === /his/hospital → /his/hospital (直接透传) === // === /his/department → /his/department (直接透传) === // === /his/vessel → /his/vessel (直接透传) === // === /his/chineseMedicine → /his/chineseMedicine (直接透传) === // === /his/famousPrescribe → /his/famousPrescribe (直接透传) === // === /his/medicatedFood → /his/medicatedFood (直接透传) === // === /his/healthLife → /his/healthLife (直接透传) === // === /his/healthHistoryTemp → /his/healthHistoryTemp (直接透传) === // === /his/physicalReportTemplate → /his/physicalReportTemplate (直接透传) === // === /his/physicalReportTemplateField → /his/physicalReportTemplateField (直接透传) === // === /his/testReport → /his/testReport (直接透传) === // === /his/testTemp → /his/testTemp (直接透传) === // === /his/testTempItem → /his/testTempItem (直接透传) === // === /his/template → /his/template (直接透传) === // === /his/questions → /his/questions (直接透传) === // === /his/answer → /his/answer (直接透传) === // === /his/packageCate → /his/packageCate (直接透传) === // === /his/packageSolarTerm → /his/packageSolarTerm (直接透传) === // === /his/packageFavorite → /his/packageFavorite (直接透传) === // === /his/packageOrder → /his/packageOrder (直接透传) === // === /his/dfAccount → /his/dfAccount (直接透传) === // === /his/hfpayConfig → /his/hfpayConfig (直接透传) === // === /his/doctorAdvice → /his/doctorAdvice (直接透传) === // === /his/homeView → /his/homeView (直接透传) === // === /his/homeArticle → /his/homeArticle (直接透传) === // === /his/homeCategory → /his/homeCategory (直接透传) === // === /his/articleCate → /his/articleCate (直接透传) === // === /his/articleViews → /his/articleViews (直接透传) === // === /his/caseArticle → /his/caseArticle (直接透传) === // === /his/adv → /his/adv (直接透传) === // === /his/price → /his/price (直接透传) === // === /his/appVersion → /his/appVersion (直接透传) === // === /his/express → /his/express (直接透传) === // === /his/userAddress → /his/userAddress (直接透传) === // === /his/userCoupon → /his/userCoupon (直接透传) === // === /his/merchantAppConfig → /his/merchantAppConfig (直接透传) === // === /his/pharmacist → /his/pharmacist (直接透传) === // === /his/complaint → /his/complaint (直接透传) === // === /his/healthArticle → /his/healthArticle (直接透传) === // === /his/promotionActive → /his/promotionActive (直接透传) === // === /his/promotionActiveLog → /his/promotionActiveLog (直接透传) === // === /his/logs → /his/logs (直接透传) === // === /his/userNewTask → /his/userNewTask (直接透传) === // === /his/divItem → /his/divItem (直接透传) === // === /his/icd → /his/icd (直接透传) === // === /his/aiWorkflow → /his/aiWorkflow (直接透传) === // === /his/healthData → /his/healthData (直接透传) === // === /his/inquiryOrder → /his/inquiryOrder (直接透传) === // === /his/drugReportCount → /his/drugReportCount (直接透传) === // === /his/doctor → /his/doctor (直接透传) === // === /his/prescription → /his/prescription (直接透传) === // === /his/drugReport → /his/drugReport (直接透传) === // === /his/exportTask → /his/exportTask (直接透传) === // === /his/healthTongue → /his/healthTongue (直接透传) === // === /his/healthRecord → /his/healthRecord (直接透传) === // === /his/diagnosis → /his/diagnosis (直接透传) === // === /his/healthRecordTemplate → /his/healthRecordTemplate (直接透传) === // === /his/healthTongueQuestion → /his/healthTongueQuestion (直接透传) === // === /his/followPlan → /his/followPlan (直接透传) === // === /his/recoveryRecord → /his/recoveryRecord (直接透传) === // === /his/recoveryPlan → /his/recoveryPlan (直接透传) === // === /his/healthReport → /his/healthReport (直接透传) === // === /his/inquiryOrderReport → /his/inquiryOrderReport (直接透传) === // === /his/inquiryDisease → /his/inquiryDisease (直接透传) === // === /his/integralGoods → /his/integralGoods (直接透传) === // === /his/integralOrder → /his/integralOrder (直接透传) === // === /his/redPacket → /his/redPacket (直接透传) === // === /company/wxAccount → /company/wxUser (微信账号) === [process.env.VUE_APP_BASE_API + '/company/wxAccount']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/company/wxAccount']: '/company/wxUser' } }, // === /user/darkRoom → /store/user/darkRoomList (小黑屋) === [process.env.VUE_APP_BASE_API + '/user/darkRoom']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/user/darkRoom']: '/store/user/darkRoomList' } }, // === /user/transfer → /system/approval (转接管理) === [process.env.VUE_APP_BASE_API + '/user/transfer']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/user/transfer']: '/system/approval' } }, // === /lobster/billing → /workflow/lobster/billing (龙虾计费) === [process.env.VUE_APP_BASE_API + '/lobster/billing']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/billing']: '/workflow/lobster/billing' } }, // === /lobster/prompt → /workflow/lobster/prompt (提示词) === [process.env.VUE_APP_BASE_API + '/lobster/prompt']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/prompt']: '/workflow/lobster/prompt' } }, // === /lobster/api-registry → /workflow/lobster/api-registry (接口注册中心) === [process.env.VUE_APP_BASE_API + '/lobster/api-registry']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/api-registry']: '/workflow/lobster/api-registry' } }, // === /lobster/dead-letter → /workflow/lobster/dead-letter (死信队列) === [process.env.VUE_APP_BASE_API + '/lobster/dead-letter']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/dead-letter']: '/workflow/lobster/dead-letter' } }, // === /lobster/event-audit → /workflow/lobster/event-audit (节点审核) === [process.env.VUE_APP_BASE_API + '/lobster/event-audit']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/event-audit']: '/workflow/lobster/event-audit' } }, // === /lobster/optimization → /workflow/lobster/optimization (AI优化建议) === [process.env.VUE_APP_BASE_API + '/lobster/optimization']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/optimization']: '/workflow/lobster/optimization' } }, // === /lobster/sales-corpus → /workflow/lobster/sales-corpus (销冠语料) === [process.env.VUE_APP_BASE_API + '/lobster/sales-corpus']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/sales-corpus']: '/workflow/lobster/sales-corpus' } }, // === /lobster/model-config → /company/aiProvider (模型配置→AI供应商) === [process.env.VUE_APP_BASE_API + '/lobster/model-config']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/lobster/model-config']: '/company/aiProvider' } }, // === /hisStore/storeOrder → /store/storeOrder (商城订单) === [process.env.VUE_APP_BASE_API + '/hisStore/storeOrder']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeOrder']: '/store/storeOrder' } }, // === /hisStore/storeProduct → /store/storeProduct (商城商品) === [process.env.VUE_APP_BASE_API + '/hisStore/storeProduct']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeProduct']: '/store/storeProduct' } }, // === /hisStore/storeProductPackage → /store/storeProductPackage (商品套餐) === [process.env.VUE_APP_BASE_API + '/hisStore/storeProductPackage']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeProductPackage']: '/store/storeProductPackage' } }, // === /hisStore/storePayment → /store/storePayment (门店支付) === [process.env.VUE_APP_BASE_API + '/hisStore/storePayment']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storePayment']: '/store/storePayment' } }, // === /hisStore/userOnlineState → /store/userOnlineState (用户在线状态) === [process.env.VUE_APP_BASE_API + '/hisStore/userOnlineState']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/userOnlineState']: '/store/userOnlineState' } }, // === /hisStore/storeProductCategory → /store/storeProductCategory (商品分类) === [process.env.VUE_APP_BASE_API + '/hisStore/storeProductCategory']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeProductCategory']: '/store/storeProductCategory' } }, // === /live/liveData → /liveData/liveData (直播数据) === [process.env.VUE_APP_BASE_API + '/live/liveData']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/live/liveData']: '/liveData/liveData' } }, // === /live/liveConfig → /live/config (直播配置) === [process.env.VUE_APP_BASE_API + '/live/liveConfig']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/live/liveConfig']: '/live/config' } }, // === /live/liveConsole → /live/liveVideo (直播控制台→直播视频) === [process.env.VUE_APP_BASE_API + '/live/liveConsole']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/live/liveConsole']: '/live/liveVideo' } }, // === /course/courseAnswerlogs → /course/courseAnswerLog (答题记录) === [process.env.VUE_APP_BASE_API + '/course/courseAnswerlogs']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/course/courseAnswerlogs']: '/course/courseAnswerLog' } }, // === /course/coursePlaySourceConfig → /course/playSourceConfig (播放源配置) === [process.env.VUE_APP_BASE_API + '/course/coursePlaySourceConfig']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/course/coursePlaySourceConfig']: '/course/playSourceConfig' } }, // === /course/courseUserStatistics → /course/userWatchStatistics (用户统计) === [process.env.VUE_APP_BASE_API + '/course/courseUserStatistics']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/course/courseUserStatistics']: '/course/userWatchStatistics' } }, // === /course/category → /course/userCourseCategory (课程分类) === [process.env.VUE_APP_BASE_API + '/course/category']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/course/category']: '/course/userCourseCategory' } }, // === /hisStore/storeOrderAudit → /store/storeOrderAudit (订单审核) === [process.env.VUE_APP_BASE_API + '/hisStore/storeOrderAudit']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeOrderAudit']: '/hisStore/fsStoreOrderAuditScrm' } }, // === /hisStore/storeOrderOffline → /hisStore/fsStoreOrderOfflineScrm (线下订单) === [process.env.VUE_APP_BASE_API + '/hisStore/storeOrderOffline']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/hisStore/storeOrderOffline']: '/hisStore/fsStoreOrderOfflineScrm' } }, // === /qw/QwWorkTask/qw/list → /qw/workTask/list (企微任务) === [process.env.VUE_APP_BASE_API + '/qw/QwWorkTask/qw']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/qw/QwWorkTask/qw']: '/qw/workTask' } }, // === /crm/customer/list → /crm/customer/getCustomerList (客户管理) === [process.env.VUE_APP_BASE_API + '/crm/customer/list']: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/crm/customer/list']: '/crm/customer/getCustomerList' } }, // watch-api → fs-watch 微服务(需要单独启动 fs-watch) [process.env.VUE_APP_BASE_API + '/watch-api']: { target: 'http://localhost:8010', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API + '/watch-api']: '' } }, // ===== 默认所有其他请求 → fs-company(8006) 租户服务端 ===== [process.env.VUE_APP_BASE_API]: { target: 'http://localhost:8006', changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } } } }, configureWebpack: { name: name, resolve: { alias: { '@': resolve('src') } }, externals: { 'node:async_hooks': 'commonjs async_hooks', 'node:crypto': 'commonjs crypto', 'node:fs': 'commonjs fs', 'node:fs/promises': 'commonjs fs/promises', 'node:http': 'commonjs http', 'node:os': 'commonjs os', 'node:path': 'commonjs path', 'node:process': 'commonjs process', 'node:stream': 'commonjs stream', 'node:stream/web': 'commonjs stream', 'node:buffer': 'commonjs buffer', 'node:util': 'commonjs util', 'node:url': 'commonjs url', 'node:net': 'commonjs net', 'node:tls': 'commonjs tls', 'node:events': 'commonjs events', 'node:https': 'commonjs https', 'node:zlib': 'commonjs zlib', 'node:child_process': 'commonjs child_process' } }, chainWebpack(config) { config.plugins.delete('preload') // TODO: need test config.plugins.delete('prefetch') // TODO: need test // set svg-sprite-loader config.module .rule('svg') .exclude.add(resolve('src/assets/icons')) .end() config.module .rule('icons') .test(/\.svg$/) .include.add(resolve('src/assets/icons')) .end() .use('svg-sprite-loader') .loader('svg-sprite-loader') .options({ symbolId: 'icon-[name]' }) .end() config .when(process.env.NODE_ENV !== 'development', config => { config .plugin('ScriptExtHtmlWebpackPlugin') .after('html') .use('script-ext-html-webpack-plugin', [{ // `runtime` must same as runtimeChunk name. default is `runtime` inline: /runtime\..*\.js$/ }]) .end() config .optimization.splitChunks({ chunks: 'all', cacheGroups: { libs: { name: 'chunk-libs', test: /[\\/]node_modules[\\/]/, priority: 10, chunks: 'initial' // only package third parties that are initially dependent }, elementUI: { name: 'chunk-elementUI', // split elementUI into a single package priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm }, commons: { name: 'chunk-commons', test: resolve('src/components'), // can customize your rules minChunks: 3, // minimum common number priority: 5, reuseExistingChunk: true } } }) config.optimization.runtimeChunk('single'), { from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件 to: './' //到根目录下 } } ) } }