feat(fsgx): 完成全部24项开发任务 Phase1-7
Phase1 后端核心:
- 新增 fsgx_v1.sql 迁移脚本(is_queue_goods/frozen_points/available_points/no_assess)
- SystemConfigServices 返佣设置扩展(周期人数/分档比例/范围/时机)
- StoreOrderCreateServices 周期循环佣金计算
- StoreOrderTakeServices 佣金发放后同步冻结积分
- StoreProductServices/StoreProduct 保存 is_queue_goods
Phase2 后端接口:
- GET /api/hjf/brokerage/progress 佣金周期进度
- GET /api/hjf/assets/overview 资产总览
- HjfPointsServices 每日 frozen_points 0.4‰ 释放定时任务
- PUT /adminapi/hjf/member/{uid}/no_assess 不考核接口
- GET /adminapi/hjf/points/release_log 积分日志接口
Phase3 前端清理:
- hjfCustom.js 路由精简(仅保留 points/log)
- hjfQueue.js/hjfMember.js API 清理/重定向至 CRMEB 原生接口
- pages.json 公排→推荐佣金/佣金记录/佣金规则
Phase4-5 前端改造:
- queue/status.vue 推荐佣金进度页整体重写
- 商品详情/订单确认/支付结果页文案与逻辑改造
- 个人中心/资产页/引导页/规则页文案改造
- HjfQueueProgress/HjfRefundNotice/HjfAssetCard 组件改造
- 推广中心嵌入佣金进度摘要
- hjfMockData.js 全量更新(公排字段→佣金字段)
Phase6 Admin 增强:
- 用户列表新增 frozen_points/available_points 列及不考核操作按钮
- hjfPoints.js USE_MOCK=false 对接真实积分日志接口
Phase7 配置文档:
- docs/fsgx-phase7-config-checklist.md 后台配置与全链路验收清单
Made-with: Cursor
This commit is contained in:
148
pro_v3.5.1_副本/view/admin/vue.config.js
Normal file
148
pro_v3.5.1_副本/view/admin/vue.config.js
Normal file
@@ -0,0 +1,148 @@
|
||||
const Setting = require("./src/setting.env");
|
||||
|
||||
// 引入打包分析文件
|
||||
// const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
||||
|
||||
// 引入Gzip压缩文件
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
|
||||
// 引入js打包工具
|
||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
|
||||
|
||||
|
||||
// 拼接路径
|
||||
const resolve = (dir) => require("path").join(__dirname, dir);
|
||||
|
||||
// 增加环境变量
|
||||
process.env.VUE_APP_VERSION = require("./package.json").version;
|
||||
process.env.VUE_APP_BUILD_TIME = require("dayjs")().format("YYYY-M-D HH:mm:ss");
|
||||
|
||||
module.exports = {
|
||||
publicPath: Setting.publicPath,
|
||||
lintOnSave: Setting.lintOnSave,
|
||||
outputDir: Setting.outputDir,
|
||||
assetsDir: Setting.assetsDir,
|
||||
runtimeCompiler: true,
|
||||
productionSourceMap: false, //关闭生产环境下的SourceMap映射文件
|
||||
devServer: {
|
||||
publicPath: Setting.publicPath,
|
||||
port: 8080,
|
||||
proxy: {
|
||||
'/adminapi': { target: 'http://127.0.0.1:20199', changeOrigin: true },
|
||||
'/api': { target: 'http://127.0.0.1:20199', changeOrigin: true },
|
||||
'/kefuapi': { target: 'http://127.0.0.1:20199', changeOrigin: true },
|
||||
},
|
||||
},
|
||||
|
||||
// 打包优化
|
||||
configureWebpack: (config) => {
|
||||
const pluginsPro = [];
|
||||
|
||||
pluginsPro.push(
|
||||
new CompressionPlugin({
|
||||
algorithm: "gzip",
|
||||
test: /\.js$|\.html$|\.css$/, // 匹配文件名
|
||||
minRatio: 0.8, // 压缩率小于1才会压缩
|
||||
threshold: 10240, // 对超过10k的数据压缩
|
||||
deleteOriginalAssets: false // 是否删除未压缩的源文件,谨慎设置,如果希望提供非gzip的资源,可不设置或者设置为false(比如删除打包后的gz后还可以加载到原始资源文件)
|
||||
})
|
||||
);
|
||||
|
||||
pluginsPro.push(
|
||||
// js文件压缩
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
drop_debugger: true,
|
||||
drop_console: true, //生产环境自动删除console
|
||||
pure_funcs: ["console.log"] //移除console
|
||||
},
|
||||
},
|
||||
sourceMap: false,
|
||||
parallel: true //使用多进程并行运行来提高构建速度。默认并发运行数:os.cpus().length - 1。
|
||||
})
|
||||
);
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
config.plugins = [...config.plugins, ...pluginsPro];
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
css: {
|
||||
sourceMap: false, // css sourceMap 配置
|
||||
loaderOptions: {
|
||||
less: {},
|
||||
},
|
||||
},
|
||||
|
||||
transpileDependencies: ["view-design", "iview", "vuedraggable"],
|
||||
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-service/lib/config/base.js
|
||||
|
||||
chainWebpack: (config) => {
|
||||
/**
|
||||
* 删除懒加载模块的 prefetch preload,降低带宽压力
|
||||
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch
|
||||
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#preload
|
||||
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
|
||||
*/
|
||||
config.plugins.delete("prefetch").delete("preload");
|
||||
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
|
||||
config.resolve.symlinks(true);
|
||||
config
|
||||
// 开发环境
|
||||
.when(
|
||||
process.env.NODE_ENV === "development",
|
||||
// sourcemap不包含列信息
|
||||
(config) => config.devtool("cheap-source-map")
|
||||
)
|
||||
// 非开发环境
|
||||
.when(process.env.NODE_ENV !== "development", () => {});
|
||||
// 不编译 iView Pro
|
||||
config.module
|
||||
.rule("js")
|
||||
.test(/\.jsx?$/)
|
||||
.exclude.add(resolve("src/libs/iview-pro"))
|
||||
.end();
|
||||
// 使用 iView Loader
|
||||
config.module
|
||||
.rule("vue")
|
||||
.test(/\.vue$/)
|
||||
.use("iview-loader")
|
||||
.loader("iview-loader")
|
||||
.tap(() => {
|
||||
return Setting.iviewLoaderOptions;
|
||||
})
|
||||
.end();
|
||||
// markdown
|
||||
config.module
|
||||
.rule("md")
|
||||
.test(/\.md$/)
|
||||
.use("text-loader")
|
||||
.loader("text-loader")
|
||||
.end();
|
||||
// i18n
|
||||
config.module
|
||||
.rule("i18n")
|
||||
.resourceQuery(/blockType=i18n/)
|
||||
.use("i18n")
|
||||
.loader("@kazupon/vue-i18n-loader")
|
||||
.end();
|
||||
// image exclude
|
||||
const imagesRule = config.module.rule("images");
|
||||
imagesRule
|
||||
.test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/)
|
||||
.exclude.add(resolve("src/assets/svg"))
|
||||
.end();
|
||||
// 重新设置 alias
|
||||
config.resolve.alias.set("@api", resolve("src/api"));
|
||||
// node
|
||||
config.node.set("__dirname", true).set("__filename", true);
|
||||
// 判断是否需要加入模拟数据
|
||||
// const entry = config.entry("app");
|
||||
// if (Setting.isMock) {
|
||||
// entry.add("@/mock").end();
|
||||
// }
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user