mirror of
http://112.124.100.131/ebiz-ai/ebiz-base-ai.git
synced 2025-12-08 10:26:49 +08:00
feat(AI): 优化聊天组件并添加新功能
- 移除 request 和 response 拦截器中的 console.log 语句- 优化消息组件样式和逻辑,支持渐进式消息显示- 更新 TabBox 组件,支持动态列表数据 - 重构 treasureBox 组件,展示产品详情和知识库 - 优化 AI聊天流程,支持流式响应和消息动画 - 添加 markdown 渲染支持,包括数学公式和流程图
This commit is contained in:
107
vue.config.js
107
vue.config.js
@@ -1,42 +1,48 @@
|
||||
const autoprefixer = require('autoprefixer')
|
||||
const pxtoviewport = require('postcss-px-to-viewport')
|
||||
const path = require('path')
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const pxtoviewport = require('postcss-px-to-viewport');
|
||||
const path = require('path');
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
publicPath: '/',
|
||||
lintOnSave: false, //是否开启代码检查
|
||||
outputDir: 'dist', //打包输出目录
|
||||
lintOnSave: false,
|
||||
outputDir: 'dist',
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
https: false,
|
||||
host: "0.0.0.0",
|
||||
disableHostCheck: true
|
||||
host: '0.0.0.0',
|
||||
disableHostCheck: true,
|
||||
},
|
||||
css: {
|
||||
sourceMap: true, // 查看css属于哪个css文件
|
||||
loaderOptions: {
|
||||
sourceMap: true,
|
||||
loaderOptions: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
autoprefixer(),
|
||||
pxtoviewport({
|
||||
viewportWidth: 375,
|
||||
// 该项仅在使用 Circle 组件时需要
|
||||
// 原因参见 https://github.com/youzan/vant/issues/1948
|
||||
selectorBlackList: ['van-circle__layer']
|
||||
})
|
||||
]
|
||||
postcssOptions: {
|
||||
plugins: [
|
||||
autoprefixer(), // 自动加浏览器前缀
|
||||
pxtoviewport({ // px 转 viewport
|
||||
viewportWidth: 375,
|
||||
selectorBlackList: ['van-circle__layer'] // 排除vant circle组件样式转换
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
chainWebpack: (config) => {
|
||||
// 移除 prefetch 插件
|
||||
config.resolve.alias.set('@utils', resolve('./src/assets/js/utils'))
|
||||
// 设置路径别名
|
||||
config.resolve.alias
|
||||
.set('@', resolve('src'))
|
||||
.set('@utils', resolve('src/assets/js/utils'));
|
||||
|
||||
// config.plugins.delete('prefetch')
|
||||
/* 配置svg图标自动加载 begin */
|
||||
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
|
||||
// 移除 prefetch 插件(减少初始加载体积)
|
||||
config.plugins.delete('prefetch');
|
||||
|
||||
// SVG 图标配置
|
||||
config.module.rule('svg').exclude.add(resolve('src/icons')).end();
|
||||
config.module
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
@@ -45,8 +51,10 @@ module.exports = {
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: 'icon-[name]'
|
||||
})
|
||||
symbolId: 'icon-[name]',
|
||||
});
|
||||
|
||||
// 处理 .mjs 文件(用于 mermaid 等模块)
|
||||
config.module
|
||||
.rule('mjs')
|
||||
.test(/\.mjs$/)
|
||||
@@ -54,20 +62,37 @@ module.exports = {
|
||||
.end()
|
||||
.use('babel-loader')
|
||||
.loader('babel-loader');
|
||||
//设置路径别名
|
||||
|
||||
// 添加对现代 JS 的支持(如 ?? 和 ?.)
|
||||
config.module
|
||||
.rule('js')
|
||||
.test(/\.js$/)
|
||||
.use('babel-loader')
|
||||
.loader('babel-loader')
|
||||
.options({
|
||||
presets: ['@babel/preset-env'],
|
||||
});
|
||||
},
|
||||
configureWebpack: (config) => {
|
||||
;(config.devtool = 'source-map'), // 调试js
|
||||
(config.performance = {
|
||||
hints: 'error',
|
||||
//入口起点的最大体积 700kb
|
||||
maxEntrypointSize: 7168000,
|
||||
//生成文件的最大体积 700kb
|
||||
maxAssetSize: 7168000,
|
||||
//只给出 js 文件的性能提示
|
||||
assetFilter: function (assetFilename) {
|
||||
return assetFilename.endsWith('.js')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 强制使用 CommonJS 模块加载 mermaid
|
||||
config.resolve = config.resolve || {};
|
||||
config.resolve.alias = config.resolve.alias || {};
|
||||
// config.resolve.alias.mermaid$ = path.resolve(
|
||||
// __dirname,
|
||||
// './node_modules/mermaid/dist/mermaid.common.js'
|
||||
// );
|
||||
|
||||
// Webpack devtool 设置
|
||||
config.devtool = 'source-map';
|
||||
|
||||
// 打包性能提示设置
|
||||
config.performance = {
|
||||
hints: 'error',
|
||||
maxEntrypointSize: 7168000, // 7MB
|
||||
maxAssetSize: 7168000, // 7MB
|
||||
assetFilter: function (assetFilename) {
|
||||
return assetFilename.endsWith('.js');
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user