Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:修复前端组件漏洞 #2538 #2545

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/frontend/devops-op/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"axios": "0.18.1",
"core-js": "3.6.5",
"axios": "1.7.7",
"core-js": "3.38.1",
"element-ui": "2.15.14",
"js-cookie": "2.2.0",
"jsencrypt": "^3.2.1",
Expand All @@ -31,17 +31,17 @@
"vuex": "3.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.1",
"@vue/cli-plugin-eslint": "~5.0.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-service": "~5.0.1",
"autoprefixer": "9.5.1",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "2.4.2",
"connect": "3.6.6",
"html-webpack-plugin": "^5.3.2",
"runjs": "4.3.2",
"html-webpack-plugin": "^5.6.0",
"tasksfile": "^5.1.1",
"serve-static": "1.13.2",
"svgo": "1.2.2"
"svgo": "3.3.2"
},
"browserslist": [
"> 1%",
Expand Down
1 change: 0 additions & 1 deletion src/frontend/devops-op/src/layout/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
import { toLoginPage } from '@/utils/login'
import { getBkUid } from '@/utils/auth'

export default {
components: {
Expand Down
4 changes: 1 addition & 3 deletions src/frontend/devops-op/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ function resolve(dir) {

const envDist = process.env && process.env.dist ? process.env.dist : 'frontend'
const dist = resolve(`../${envDist}/${process.env.VUE_APP_BASE_DIR}`)
const targetDist = path.join(__dirname, `../${envDist}/ui`)
const fileName = process.env.NODE_ENV !== 'development' ? `${targetDist}/frontend#admin#index.html` : `index.html`

module.exports = {
publicPath: `/${process.env.VUE_APP_BASE_DIR}`,
Expand Down Expand Up @@ -61,7 +59,7 @@ module.exports = {
config
.plugin('html')
.use(new HtmlWebpackPlugin({
filename: fileName,
filename: process.env.NODE_ENV !== 'development' ? '../ui/frontend#admin#index.html' : 'index.html',
templateParameters: {
BASE_URL: `/`
},
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/devops-repository/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"dependencies": {
"@blueking/notice-component-vue2": "^2.0.5",
"@blueking/sub-saas": "0.0.0-beta.9",
"axios": "^0.21.1",
"axios": "^1.7.7",
"js-cookie": "^2.2.1",
"marked": "^4.0.8",
"qrcode": "^1.5.0",
"vue-i18n": "^8.18.1",
"vuedraggable": "^2.24.1"
},
"devDependencies": {
"copy-webpack-plugin": "9.0.1",
"html-webpack-plugin": "^5.3.2"
"copy-webpack-plugin": "12.0.2",
"html-webpack-plugin": "^5.6.0"
}
}
6 changes: 3 additions & 3 deletions src/frontend/devops-software/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"public:external": "cross-env NODE_ENV=external yarn public --"
},
"dependencies": {
"axios": "^0.21.1",
"axios": "^1.7.7",
"js-cookie": "^2.2.1",
"marked": "^4.0.8",
"qrcode": "^1.5.0",
"vue-i18n": "^8.18.1",
"vuedraggable": "^2.24.1"
},
"devDependencies": {
"copy-webpack-plugin": "9.0.1",
"html-webpack-plugin": "^5.3.2"
"copy-webpack-plugin": "12.0.2",
"html-webpack-plugin": "^5.6.0"
}
}
3 changes: 1 addition & 2 deletions src/frontend/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"npmClient": "yarn",
"version": "independent",
"useWorkspaces": true
"version": "independent"
}
34 changes: 17 additions & 17 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "root",
"private": true,
"devDependencies": {
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.8",
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.15.8",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.15.8",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.24.7",
"@babel/plugin-proposal-json-strings": "^7.14.5",
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
Expand All @@ -18,8 +18,8 @@
"@babel/plugin-transform-object-assign": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^8.2.2",
"babel-plugin-transform-vue-jsx": "4.0.1",
Expand All @@ -28,16 +28,16 @@
"eslint": "^7.3.1",
"eslint-config-standard": "^16.0.3",
"eslint-friendly-formatter": "~4.0.1",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-promise": "^5.2.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "6.2.2",
"gulp": "^4.0.2",
"eslint-plugin-vue": "9.28.0",
"eslint-webpack-plugin": "^3.2.0",
"gulp": "^5.0.0",
"husky": "^3.0.7",
"lerna": "3.17.0",
"lint-staged": "^10.2.11",
"lerna": "8.1.8",
"lint-staged": "^15.2.10",
"mini-css-extract-plugin": "~2.4.5",
"ora": "^3.4.0",
"sass": "^1.42.1",
Expand All @@ -48,12 +48,12 @@
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "2.6.14",
"webpack": "^5.71.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1"
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
},
"scripts": {
"start": "lerna bootstrap",
"start": "npm install",
"build:dev": "lerna run public:dev --parallel",
"build:test": "lerna run public:test --parallel",
"build:master": "lerna run public:master --parallel",
Expand Down
34 changes: 22 additions & 12 deletions src/frontend/webpack.base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')
const ESLintPlugin = require('eslint-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { VueLoaderPlugin } = require('vue-loader')
const CopyWebpackPlugin = require('copy-webpack-plugin')
Expand Down Expand Up @@ -53,17 +54,6 @@ module.exports = ({ entry, publicPath, dist, port = 8080, argv, env }) => {
},
'sass-loader'
]
},
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [path.resolve(__dirname, 'devops-repository/src'), path.resolve('src')],
exclude: [/node_modules/],
options: {
fix: true,
formatter: require('eslint-friendly-formatter')
}
}
]
},
Expand All @@ -75,8 +65,28 @@ module.exports = ({ entry, publicPath, dist, port = 8080, argv, env }) => {
ignoreOrder: true
}),
new CopyWebpackPlugin({
patterns: [{ from: path.join(__dirname, 'locale', dist), to: buildDist }],
patterns: [{ from: path.join(__dirname, 'locale'), to: buildDist }],
options: { concurrency: 100 }
}),
new ESLintPlugin({
// 指定要检查的文件扩展名
extensions: ['js', 'vue'],
// 指定要检查的目录
context: path.resolve(__dirname, 'devops-repository/src'), // 主要上下文目录
// 其他选项
fix: true, // 自动修复问题
formatter: require('eslint-friendly-formatter'), // 使用友好的格式化程序
// 你可以添加更多选项,例如:
emitWarning: true, // 如果有 ESLint 警告,是否在控制台中显示
failOnError: false, // 如果有错误,是否使构建失败
failOnWarning: false, // 如果有警告,是否使构建失败
// 使用 include 选项来指定多个路径
files: [
path.resolve(__dirname, 'devops-repository/src/**/*.js'),
path.resolve(__dirname, 'devops-repository/src/**/*.vue'),
path.resolve(__dirname, 'src/**/*.js'),
path.resolve(__dirname, 'src/**/*.vue')
]
})
],
optimization: {
Expand Down
Loading
Loading