Files
energy_storage/web/vue.config.js
zhoumengru 65d1ad93ef ```
feat(web): 添加 sm-crypto 库支持 SM3 加密及导出功能

- 在登录模块中增加 SM3 加密调用逻辑
- 新增导出按钮和相关处理逻辑,支持统计分析数据导出
- 调整多个页面样式布局,优化组件结构与代码可读性
- 更新设备类型配置,新增“冷机”和“网关”类型
- 添加 download 工具函数,支持通过 URL 下载文件
- 配置 webpack 代理,支持文件下载路径转发
```
2025-09-23 14:19:36 +08:00

93 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const Components = require('unplugin-vue-components/webpack')
const { AntDesignVueResolver } = require('unplugin-vue-components/resolvers')
module.exports = defineConfig({
transpileDependencies: true,
publicPath: '/',
// 输出文件目录
outputDir: 'dist',
// 静态资源目录
assetsDir: 'static',
devServer: {
proxy: {
'/api': {
// 代理前缀,可以自定义(如 '/api'
target: 'http://192.168.0.187:19800', // 目标服务器地址
changeOrigin: true, // 是否改变请求源(跨域必备)
pathRewrite: {
'^/api': '' // 重写路径,去掉 '/api' 前缀
}
},
'/download': {
// 代理前缀,可以自定义(如 '/api'
target: 'http://192.168.0.187:19600', // 目标服务器地址
changeOrigin: true, // 是否改变请求源(跨域必备)
pathRewrite: {
'^/download': '/download' // 重写路径,去掉 '/api' 前缀
}
}
}
},
css: {
loaderOptions: {
scss: {
additionalData: `
@import "@/style/color.scss";
@import "@/style/antd.scss";
` //在每个 .scss 文件顶部自动添加这行代码,无需手动导入
},
less: {
lessOptions: {
modifyVars: {
//这是配置css主题色
'primary-color': '#143d7d'
},
javascriptEnabled: true
}
}
},
extract: {
ignoreOrder: true // 忽略 CSS 顺序警告
}
},
// webpack相关配置
configureWebpack: {
// 自定义打包入口
// 扩展 webpack 配置
plugins: [
Components({
resolvers: [
AntDesignVueResolver({
resolveIcons: true, // 自动按需加载图标,
importStyle: false //不单独导入样式,对样式进行全局引入
})
],
dts: true // 生成类型声明
})
],
resolve: {
alias: {
'@': path.join(__dirname, 'src')
}
}
},
// 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
lintOnSave: process.env.NODE_ENV !== 'production',
// 是否使用包含运行时编译器的 Vue 构建版本
runtimeCompiler: false,
// 生产环境的 source map
productionSourceMap: true,
// 第三方插件配置
pluginOptions: {
// ...
}
})