提交
From 2faf99c2ff8ba8ad3c0d480d8562e9f46da6c24b Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Fri, 8 Mar 2024 18:58:06 +0800
Subject: [PATCH 4/9] ci(custom): add CICD
---
.dockerignore | 1 +
.drone.yml | 170 +++++++++++++++++++++
.env.development | 3 -
.env.production | 3 -
.env.sentry-build-plugin | 5 -
.env.test | 3 -
build/plugin/index.js | 17 ---
package.json | 4 +-
pnpm-lock.yaml | 309 +--------------------------------------
src/router/index.js | 17 ---
10 files changed, 175 insertions(+), 357 deletions(-)
create mode 100644 .dockerignore
create mode 100644 .drone.yml
delete mode 100644 .env.sentry-build-plugin
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..35bc5b9
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,170 @@
+kind: pipeline
+type: docker
+name: default
+
+platform:
+ os: linux
+ arch: amd64
+
+steps:
+ - name: 测试服-依赖安装&&编译打包
+ pull: if-not-exists
+ image: node:20-alpine
+ when:
+ branch:
+ - test
+ commands:
+ - npm config set registry https://registry.npmmirror.com/
+ - npm install -g pnpm
+ - pnpm install
+ - pnpm build:test
+ - rm -rf dist.tar
+ - rm -rf node_modules
+ - tar -zcvf dist.tar ./dist ./default.conf ./Dockerfile
+
+ - name: 正式服-依赖安装&&编译打包
+ pull: if-not-exists
+ image: node:20-alpine
+ when:
+ branch:
+ - master
+ commands:
+ - npm config set registry https://registry.npmmirror.com/
+ - npm install -g pnpm
+ - pnpm install
+ - pnpm build:prod
+ - rm -rf dist.tar
+ - rm -rf node_modules
+ - tar -zcvf dist.tar ./dist ./default.conf ./Dockerfile
+
+ - name: 测试服-产物上传
+ pull: if-not-exists
+ image: appleboy/drone-scp
+ when:
+ branch:
+ - test
+ settings:
+ host:
+ from_secret: HOST_DEV
+ username:
+ from_secret: USER_DEV
+ password:
+ from_secret: PWD_DEV
+ port: 22
+ strip_components: 1
+ target: /www/builder
+ source:
+ - ./dist.tar
+
+ - name: 测试服-部署
+ pull: if-not-exists
+ image: appleboy/drone-ssh
+ when:
+ branch:
+ - test
+ settings:
+ host:
+ from_secret: HOST_DEV
+ username:
+ from_secret: USER_DEV
+ password:
+ from_secret: PWD_DEV
+ port: 22
+ script:
+ - cd /www/builder
+ - mkdir jdt-mer-dev
+ - tar -xzvf dist.tar -C /www/builder/jdt-mer-dev
+ - rm -rf dist.tar
+ - cd jdt-mer-dev
+ - docker build -t jdt-mer-dev .
+ - target_container="jdt-mer-dev"
+ - if docker ps -a --format '{{.Names}}' | grep -q "^$target_container$"; then
+ - echo "容器存在,执行操作..."
+ - docker stop jdt-mer-dev
+ - docker rm jdt-mer-dev
+ - else
+ - echo "容器不存在"
+ - fi
+ - docker run -d -p 8085:80 --restart=always --name jdt-mer-dev jdt-mer-dev
+ - cd ..
+ - rm -rf jdt-mer-dev
+
+ - name: 正式服-产物上传
+ pull: if-not-exists
+ image: appleboy/drone-scp
+ when:
+ branch:
+ - main
+ settings:
+ host:
+ from_secret: HOST_PROD
+ username:
+ from_secret: USER_PROD
+ password:
+ from_secret: PWD_PROD
+ port: 22
+ strip_components: 1
+ target: /www/builder
+ source:
+ - ./dist.tar
+
+ - name: 正式服-部署
+ pull: if-not-exists
+ image: appleboy/drone-ssh
+ when:
+ branch:
+ - main
+ settings:
+ host:
+ from_secret: HOST_PROD
+ username:
+ from_secret: USER_PROD
+ password:
+ from_secret: PWD_PROD
+ port: 22
+ script:
+ - cd /www/builder
+ - mkdir jdt-mer-prod
+ - tar -xzvf dist.tar -C /www/builder/jdt-mer-prod
+ - rm -rf dist.tar
+ - cd jdt-mer-prod
+ - cd docker build -t jdt-mer-prod .
+ - target_container="jdt-mer-prod"
+ - if docker ps -a --format '{{.Names}}' | grep -q "^$target_container$"; then
+ - echo "容器存在,执行操作..."
+ - docker stop jdt-mer-prod
+ - docker rm jdt-mer-prod
+ - else
+ - echo "容器不存在"
+ - fi
+ - docker run -d -p 8085:80 --restart=always --name jdt-mer-prod jdt-mer-prod
+ - cd ..
+ - rm -rf jdt-mer-prod
+
+ - name: 企业微信通知
+ pull: if-not-exists
+ image: plugins/webhook
+ when:
+ branch:
+ - test
+ - main
+ status:
+ - success
+ - failure
+ settings:
+ urls: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a2065e21-4f92-4f5b-a432-2c0cd1d965b5
+ content_type: application/json
+ template: |
+ {
+ "msgtype": "markdown",
+ "markdown": {
+ "content": "{{#success build.status}}✅{{else}}❌{{/success}}**{{ repo.owner }}/{{ repo.name }}** (Build #{{build.number}})\n
+ >**构建结果**: {{ build.status }}
+ >**构建详情**: [点击查看]({{ build.link }})
+ >**代码分支**: {{ build.branch }}
+ >**提交标识**: {{ build.commit }}
+ >**提交发起**: {{ build.author }}
+ >**提交信息**: {{ build.message }}
+ "
+ }
+ }
diff --git a/.env.development b/.env.development
index 00c5979..9c106c8 100644
--- a/.env.development
+++ b/.env.development
@@ -11,6 +11,3 @@ VITE_USE_PROXY=true
VITE_BASE_API='/store'
VITE_ADMIN_API='/admin'
-
-# 是否启用监控
-VITE_SENTRY=false
diff --git a/.env.production b/.env.production
index 66ab486..91b5a7e 100644
--- a/.env.production
+++ b/.env.production
@@ -14,6 +14,3 @@ VITE_USE_COMPRESS=true
# 压缩类型
VITE_COMPRESS_TYPE=gzip
-
-# 是否启用监控
-VITE_SENTRY=true
diff --git a/.env.sentry-build-plugin b/.env.sentry-build-plugin
deleted file mode 100644
index f56d30f..0000000
--- a/.env.sentry-build-plugin
+++ /dev/null
@@ -1,5 +0,0 @@
-# DO NOT commit this file to your repository!
-# The SENTRY_AUTH_TOKEN variable is picked up by the Sentry Build Plugin.
-# It's used for authentication when uploading source maps.
-# You can also set this env variable in your own `.env` files and remove this file.
-SENTRY_AUTH_TOKEN="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"
diff --git a/.env.test b/.env.test
index 3199db9..cb8caec 100644
--- a/.env.test
+++ b/.env.test
@@ -13,6 +13,3 @@ VITE_USE_COMPRESS=true
# 压缩类型
VITE_COMPRESS_TYPE=gzip
-
-# 是否启用监控
-VITE_SENTRY=false
diff --git a/build/plugin/index.js b/build/plugin/index.js
index 459bc2b..d7d357a 100644
--- a/build/plugin/index.js
+++ b/build/plugin/index.js
@@ -14,7 +14,6 @@ import viteCompression from 'vite-plugin-compression'
import { configHtmlPlugin } from './html'
import { configMockPlugin } from './mock'
import unplugin from './unplugin'
-import { sentryVitePlugin } from '@sentry/vite-plugin'
export function createVitePlugins(viteEnv, isBuild) {
const plugins = [vue(), ...unplugin, configHtmlPlugin(viteEnv, isBuild), Unocss()]
@@ -36,21 +35,5 @@ export function createVitePlugins(viteEnv, isBuild) {
})
)
}
-
- if (viteEnv.VITE_SENTRY) {
- plugins.push(
- sentryVitePlugin({
- authToken: process.env.SENTRY_AUTH_TOKEN,
- org: 'sentry',
- project: 'jdt-mer',
- url: 'https://w.huakk.top',
- sourcemaps: {
- ignore: ['node_modules'],
- filesToDeleteAfterUpload: ['dist/**/*.js.map'],
- },
- })
- )
- }
-
return plugins
}
diff --git a/package.json b/package.json
index af779ab..ffe2e36 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "vue-naive-admin",
"version": "1.0.0",
"scripts": {
- "build": "vite build",
+ "build:prod": "vite build",
"build:test": "vite build --mode test",
"cz": "cz",
"dev": "vite",
@@ -32,8 +32,6 @@
]
},
"dependencies": {
- "@sentry/vite-plugin": "^2.10.2",
- "@sentry/vue": "^7.84.0",
"@unocss/eslint-config": "^0.55.7",
"@vueuse/core": "^10.6.1",
"@wangeditor/editor": "^5.1.23",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e8f9e2f..30f4ac7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5,12 +5,6 @@ settings:
excludeLinksFromLockfile: false
dependencies:
- '@sentry/vite-plugin':
- specifier: ^2.10.2
- version: 2.10.2
- '@sentry/vue':
- specifier: ^7.84.0
- version: 7.84.0(vue@3.3.4)
'@unocss/eslint-config':
specifier: ^0.55.7
version: 0.55.7(eslint@8.54.0)(typescript@5.3.2)
@@ -1344,195 +1338,6 @@ packages:
rollup: 2.79.1
dev: true
- /@sentry-internal/tracing@7.84.0:
- resolution: {integrity: sha512-y9bGYA0OM6PEREfd+nk4UURZy29tpIw+7vQwpxWfEVs2fqq0/5TBFX/tKFb8AKUI9lVM8v0bcF0bNSCnuPQZHQ==}
- engines: {node: '>=8'}
- dependencies:
- '@sentry/core': 7.84.0
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- dev: false
-
- /@sentry/browser@7.84.0:
- resolution: {integrity: sha512-X50TlTKY9WzAnHsYc4FYrCWgm+CdVo0h02ggmodVBUpRLUBjj+cs5Q1plov/v/XeorSwmorNEMUu/n+XZNSsrA==}
- engines: {node: '>=8'}
- dependencies:
- '@sentry-internal/tracing': 7.84.0
- '@sentry/core': 7.84.0
- '@sentry/replay': 7.84.0
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- dev: false
-
- /@sentry/bundler-plugin-core@2.10.2:
- resolution: {integrity: sha512-7IoekLtROlJZqTxtHQ3IhocBuf9dsEq+JjqlHMyZXoq+QKuvJFvMd/4T+r6KjZ15kMZOIkR+spK3V7duH201hw==}
- engines: {node: '>= 14'}
- dependencies:
- '@sentry/cli': 2.22.3
- '@sentry/node': 7.84.0
- '@sentry/utils': 7.84.0
- dotenv: 16.3.1
- find-up: 5.0.0
- glob: 9.3.2
- magic-string: 0.27.0
- unplugin: 1.0.1
- transitivePeerDependencies:
- - encoding
- - supports-color
- dev: false
-
- /@sentry/cli-darwin@2.22.3:
- resolution: {integrity: sha512-A1DwFTffg3+fF68qujaJI07dk/1H1pRuihlvS5WQ9sD7nQLnXZGoLUht4eULixhDzZYinWHKkcWzQ6k40UTvNA==}
- engines: {node: '>=10'}
- os: [darwin]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-linux-arm64@2.22.3:
- resolution: {integrity: sha512-PnBPb4LJ+A2LlqLjtVFn4mEizcVdxBSLZvB85pEGzq9DRXjZ6ZEuGWFHTVnWvjd79TB/s0me29QnLc3n4B6lgA==}
- engines: {node: '>=10'}
- cpu: [arm64]
- os: [linux, freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-linux-arm@2.22.3:
- resolution: {integrity: sha512-mDtLVbqbCu/5b/v2quTAMzY/atGlJVvrqO2Wvpro0Jb/LYhn7Y1pVBdoXEDcnOX82/pseFkLT8PFfq/OcezPhA==}
- engines: {node: '>=10'}
- cpu: [arm]
- os: [linux, freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-linux-i686@2.22.3:
- resolution: {integrity: sha512-wxvbpQ2hiw4hwJWfJMp7K45BV40nXL62f91jLuftFXIbieKX1Li57NNKNu2JUVn7W1bJxkwz/PKGGTXSgeJlRw==}
- engines: {node: '>=10'}
- cpu: [x86, ia32]
- os: [linux, freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-linux-x64@2.22.3:
- resolution: {integrity: sha512-0GxsYNO5GyRWifeOpng+MmdUFZRA64bgA1n1prsEsXnoeLcm3Zj4Q63hBZmiwz9Qbhf5ibohkpf94a7dI7pv3A==}
- engines: {node: '>=10'}
- cpu: [x64]
- os: [linux, freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-win32-i686@2.22.3:
- resolution: {integrity: sha512-YERPsd7ClBrxKcmCUw+ZrAvQfbyIZFrqh269hgDuXFodpsB7LPGnI33ilo0uzmKdq2vGppTb6Z3gf1Rbq0Hadg==}
- engines: {node: '>=10'}
- cpu: [x86, ia32]
- os: [win32]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli-win32-x64@2.22.3:
- resolution: {integrity: sha512-NUh56xWvgJo2KuC9lI6o6nTPXdzbpQUB4qGwJ73L9NP3HT2P1I27jtHyrC2zlXTVlYE23gQZGrL3wgW4Jy80QA==}
- engines: {node: '>=10'}
- cpu: [x64]
- os: [win32]
- requiresBuild: true
- dev: false
- optional: true
-
- /@sentry/cli@2.22.3:
- resolution: {integrity: sha512-VFHdtrHsMyTRSZhDLeMyXvit7xB4e81KugIEwMve95c7h5HO672bfmCcM/403CAugj4NzvQ+IR2NKF/2SsEPlg==}
- engines: {node: '>= 10'}
- hasBin: true
- dependencies:
- https-proxy-agent: 5.0.1
- node-fetch: 2.7.0
- progress: 2.0.3
- proxy-from-env: 1.1.0
- which: 2.0.2
- optionalDependencies:
- '@sentry/cli-darwin': 2.22.3
- '@sentry/cli-linux-arm': 2.22.3
- '@sentry/cli-linux-arm64': 2.22.3
- '@sentry/cli-linux-i686': 2.22.3
- '@sentry/cli-linux-x64': 2.22.3
- '@sentry/cli-win32-i686': 2.22.3
- '@sentry/cli-win32-x64': 2.22.3
- transitivePeerDependencies:
- - encoding
- - supports-color
- dev: false
-
- /@sentry/core@7.84.0:
- resolution: {integrity: sha512-tbuwunbBx2kSex15IHCqHDnrMfIlqPc6w/76fwkGqokz3oh9GSEGlLICwmBWL8AypWimUg13IDtFpD0TJTriWA==}
- engines: {node: '>=8'}
- dependencies:
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- dev: false
-
- /@sentry/node@7.84.0:
- resolution: {integrity: sha512-Xm3fIXT3TZOQi+6uQBavI8iOehD3PkY7v0y3hog0d4lQTH88vQK9BBsI+jZEq81Em+RG/u7vZNiFo6YMTnWF7Q==}
- engines: {node: '>=8'}
- dependencies:
- '@sentry-internal/tracing': 7.84.0
- '@sentry/core': 7.84.0
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- https-proxy-agent: 5.0.1
- transitivePeerDependencies:
- - supports-color
- dev: false
-
- /@sentry/replay@7.84.0:
- resolution: {integrity: sha512-c4PxT0ZpvkR9zXNfmAk3ojkm6eZ9+NlDze09RFBOCNo69QwIN90hnvbjXFC1+vRIJsfgo78Zr0ya/Wzb3Rog7Q==}
- engines: {node: '>=12'}
- dependencies:
- '@sentry-internal/tracing': 7.84.0
- '@sentry/core': 7.84.0
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- dev: false
-
- /@sentry/types@7.84.0:
- resolution: {integrity: sha512-VqGLIF3JOUrk7yIXjLXJvAORkZL1e3dDX0Q1okRehwyt/5CRE+mdUTeJZkBo9P9mBwgMyvtwklzOGGrzjb4eMA==}
- engines: {node: '>=8'}
- dev: false
-
- /@sentry/utils@7.84.0:
- resolution: {integrity: sha512-qdUVuxnRBvaf05AU+28R+xYtZmi/Ymf8os3Njq9g4XuA+QEkZLbzmIpRK5W9Ja7vUtjOeg29Xgg43A8znde9LQ==}
- engines: {node: '>=8'}
- dependencies:
- '@sentry/types': 7.84.0
- dev: false
-
- /@sentry/vite-plugin@2.10.2:
- resolution: {integrity: sha512-30uu0L8ZCpAKOxAXmtyqwL06sG8UEBXGY5mxUDITyQYDf8pKuiOEf5018KlEDjhYVypfMQH3jq5xXUUka+/ipg==}
- engines: {node: '>= 14'}
- dependencies:
- '@sentry/bundler-plugin-core': 2.10.2
- unplugin: 1.0.1
- transitivePeerDependencies:
- - encoding
- - supports-color
- dev: false
-
- /@sentry/vue@7.84.0(vue@3.3.4):
- resolution: {integrity: sha512-Tbw3ahuChdGIHdE4SvVXj9wUrlR/Z1vKWUebd/8IXEyASJvCRlMJmFCE4R4CPvEQkzFkYN2DHixwZyicxpaFVw==}
- engines: {node: '>=8'}
- peerDependencies:
- vue: 2.x || 3.x
- dependencies:
- '@sentry/browser': 7.84.0
- '@sentry/core': 7.84.0
- '@sentry/types': 7.84.0
- '@sentry/utils': 7.84.0
- vue: 3.3.4
- dev: false
-
/@transloadit/prettier-bytes@0.0.7:
resolution: {integrity: sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==}
dev: false
@@ -2386,15 +2191,6 @@ packages:
engines: {node: '>=0.8'}
dev: false
- /agent-base@6.0.2:
- resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
- engines: {node: '>= 6.0.0'}
- dependencies:
- debug: 4.3.4
- transitivePeerDependencies:
- - supports-color
- dev: false
-
/ajv@6.12.6:
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
dependencies:
@@ -2632,6 +2428,7 @@ packages:
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
dependencies:
balanced-match: 1.0.2
+ dev: true
/braces@2.3.2:
resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==}
@@ -3477,6 +3274,7 @@ packages:
/dotenv@16.3.1:
resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==}
engines: {node: '>=12'}
+ dev: true
/duplexer@0.1.2:
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
@@ -4159,16 +3957,6 @@ packages:
once: 1.4.0
path-is-absolute: 1.0.1
- /glob@9.3.2:
- resolution: {integrity: sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA==}
- engines: {node: '>=16 || 14 >=14.17'}
- dependencies:
- fs.realpath: 1.0.0
- minimatch: 7.4.6
- minipass: 4.2.8
- path-scurry: 1.10.1
- dev: false
-
/global-dirs@0.1.1:
resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==}
engines: {node: '>=4'}
@@ -4349,16 +4137,6 @@ packages:
readable-stream: 3.6.2
dev: true
- /https-proxy-agent@5.0.1:
- resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
- engines: {node: '>= 6'}
- dependencies:
- agent-base: 6.0.2
- debug: 4.3.4
- transitivePeerDependencies:
- - supports-color
- dev: false
-
/human-signals@2.1.0:
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
engines: {node: '>=10.17.0'}
@@ -4996,11 +4774,6 @@ packages:
tslib: 2.6.2
dev: true
- /lru-cache@10.1.0:
- resolution: {integrity: sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==}
- engines: {node: 14 || >=16.14}
- dev: false
-
/lru-cache@6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
@@ -5012,13 +4785,6 @@ packages:
engines: {node: '>=16.14'}
dev: false
- /magic-string@0.27.0:
- resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==}
- engines: {node: '>=12'}
- dependencies:
- '@jridgewell/sourcemap-codec': 1.4.15
- dev: false
-
/magic-string@0.30.5:
resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==}
engines: {node: '>=12'}
@@ -5224,13 +4990,6 @@ packages:
brace-expansion: 2.0.1
dev: true
- /minimatch@7.4.6:
- resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==}
- engines: {node: '>=10'}
- dependencies:
- brace-expansion: 2.0.1
- dev: false
-
/minimatch@9.0.3:
resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
engines: {node: '>=16 || 14 >=14.17'}
@@ -5255,16 +5014,6 @@ packages:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
dev: true
- /minipass@4.2.8:
- resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==}
- engines: {node: '>=8'}
- dev: false
-
- /minipass@7.0.4:
- resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
- engines: {node: '>=16 || 14 >=14.17'}
- dev: false
-
/mixin-deep@1.3.2:
resolution: {integrity: sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==}
engines: {node: '>=0.10.0'}
@@ -5386,18 +5135,6 @@ packages:
resolution: {integrity: sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==}
dev: true
- /node-fetch@2.7.0:
- resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
- engines: {node: 4.x || >=6.0.0}
- peerDependencies:
- encoding: ^0.1.0
- peerDependenciesMeta:
- encoding:
- optional: true
- dependencies:
- whatwg-url: 5.0.0
- dev: false
-
/node-html-parser@5.4.2:
resolution: {integrity: sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==}
dependencies:
@@ -5664,14 +5401,6 @@ packages:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
dev: true
- /path-scurry@1.10.1:
- resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==}
- engines: {node: '>=16 || 14 >=14.17'}
- dependencies:
- lru-cache: 10.1.0
- minipass: 7.0.4
- dev: false
-
/path-to-regexp@6.2.1:
resolution: {integrity: sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==}
dev: true
@@ -5829,11 +5558,6 @@ packages:
engines: {node: '>=6'}
dev: false
- /progress@2.0.3:
- resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
- engines: {node: '>=0.4.0'}
- dev: false
-
/proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
@@ -6626,10 +6350,6 @@ packages:
engines: {node: '>=6'}
dev: true
- /tr46@0.0.3:
- resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
- dev: false
-
/traverse@0.6.7:
resolution: {integrity: sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==}
dev: true
@@ -6938,15 +6658,6 @@ packages:
- supports-color
dev: true
- /unplugin@1.0.1:
- resolution: {integrity: sha512-aqrHaVBWW1JVKBHmGo33T5TxeL0qWzfvjWokObHA9bYmN7eNDkwOxmLjhioHl9878qDFMAaT51XNroRyuz7WxA==}
- dependencies:
- acorn: 8.11.2
- chokidar: 3.5.3
- webpack-sources: 3.2.3
- webpack-virtual-modules: 0.5.0
- dev: false
-
/unplugin@1.5.1:
resolution: {integrity: sha512-0QkvG13z6RD+1L1FoibQqnvTwVBXvS4XSPwAyinVgoOCl2jAgwzdUKmEj05o4Lt8xwQI85Hb6mSyYkcAGwZPew==}
dependencies:
@@ -7269,29 +6980,15 @@ packages:
defaults: 1.0.4
dev: true
- /webidl-conversions@3.0.1:
- resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
- dev: false
-
/webpack-sources@3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
engines: {node: '>=10.13.0'}
-
- /webpack-virtual-modules@0.5.0:
- resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==}
- dev: false
+ dev: true
/webpack-virtual-modules@0.6.1:
resolution: {integrity: sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==}
dev: true
- /whatwg-url@5.0.0:
- resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
- dependencies:
- tr46: 0.0.3
- webidl-conversions: 3.0.1
- dev: false
-
/which@1.3.1:
resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
hasBin: true
diff --git a/src/router/index.js b/src/router/index.js
index 2e6606a..d5439a6 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -3,7 +3,6 @@ import { setupRouterGuard } from './guard'
import { basicRoutes, EMPTY_ROUTE, NOT_FOUND_ROUTE } from './routes'
import { getToken, isNullOrWhitespace } from '@/utils'
import { useUserStore, usePermissionStore } from '@/store'
-import * as Sentry from '@sentry/vue'
const isHash = false
export const router = createRouter({
@@ -15,22 +14,6 @@ export const router = createRouter({
export async function setupRouter(app) {
await addDynamicRoutes()
setupRouterGuard(router)
- if (import.meta.env.VITE_SENTRY === 'true') {
- Sentry.init({
- app,
- dsn: 'https://aa4308fc56a9d107786b8dbcd2ae56e8@w.huakk.top/13',
- integrations: [
- new Sentry.BrowserTracing({
- tracePropagationTargets: ['localhost', /^https:\/\/w\.huakk\.top\/api/],
- routingInstrumentation: Sentry.vueRouterInstrumentation(router),
- }),
- new Sentry.Replay(),
- ],
- tracesSampleRate: 1.0,
- replaysSessionSampleRate: 0.1,
- replaysOnErrorSampleRate: 1.0,
- })
- }
app.use(router)
}
From eb1f6ff40040780059bb92ea7e11f2afbd3c74d2 Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Fri, 8 Mar 2024 18:58:53 +0800
Subject: [PATCH 5/9] ci(custom): update .drone.yml
---
.drone.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.drone.yml b/.drone.yml
index 35bc5b9..40c904e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -85,7 +85,7 @@ steps:
- else
- echo "容器不存在"
- fi
- - docker run -d -p 8085:80 --restart=always --name jdt-mer-dev jdt-mer-dev
+ - docker run -d -p 8083:80 --restart=always --name jdt-mer-dev jdt-mer-dev
- cd ..
- rm -rf jdt-mer-dev
@@ -137,7 +137,7 @@ steps:
- else
- echo "容器不存在"
- fi
- - docker run -d -p 8085:80 --restart=always --name jdt-mer-prod jdt-mer-prod
+ - docker run -d -p 8083:80 --restart=always --name jdt-mer-prod jdt-mer-prod
- cd ..
- rm -rf jdt-mer-prod
From 7d7ac808f810f7ab56d19b90de9925cff4f36688 Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Fri, 8 Mar 2024 19:06:17 +0800
Subject: [PATCH 6/9] ci(custom):
---
.idea/.gitignore | 5 --
.idea/codeStyles/Project.xml | 65 --------------------
.idea/codeStyles/codeStyleConfig.xml | 5 --
.idea/inspectionProfiles/Project_Default.xml | 6 --
.idea/jsLibraryMappings.xml | 6 --
.idea/jsLinters/eslint.xml | 6 --
.idea/mer.iml | 12 ----
.idea/modules.xml | 8 ---
.idea/prettier.xml | 6 --
.idea/vcs.xml | 6 --
build/plugin/unplugin.js | 8 ---
11 files changed, 133 deletions(-)
delete mode 100644 .idea/.gitignore
delete mode 100644 .idea/codeStyles/Project.xml
delete mode 100644 .idea/codeStyles/codeStyleConfig.xml
delete mode 100644 .idea/inspectionProfiles/Project_Default.xml
delete mode 100644 .idea/jsLibraryMappings.xml
delete mode 100644 .idea/jsLinters/eslint.xml
delete mode 100644 .idea/mer.iml
delete mode 100644 .idea/modules.xml
delete mode 100644 .idea/prettier.xml
delete mode 100644 .idea/vcs.xml
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 10b731c..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# 默认忽略的文件
-/shelf/
-/workspace.xml
-# 基于编辑器的 HTTP 客户端请求
-/httpRequests/
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 7b84c3a..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 307554b..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 50c6144..0000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
deleted file mode 100644
index 63326a8..0000000
--- a/.idea/jsLibraryMappings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jsLinters/eslint.xml b/.idea/jsLinters/eslint.xml
deleted file mode 100644
index e94fc66..0000000
--- a/.idea/jsLinters/eslint.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/mer.iml b/.idea/mer.iml
deleted file mode 100644
index 0b872d8..0000000
--- a/.idea/mer.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 947e478..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/prettier.xml b/.idea/prettier.xml
deleted file mode 100644
index 8bc49dc..0000000
--- a/.idea/prettier.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index c8397c9..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/plugin/unplugin.js b/build/plugin/unplugin.js
index c4b59d9..e61066d 100644
--- a/build/plugin/unplugin.js
+++ b/build/plugin/unplugin.js
@@ -5,7 +5,6 @@ import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
import IconsResolver from 'unplugin-icons/resolver'
import mkcert from 'vite-plugin-mkcert'
-import { sentryVitePlugin } from '@sentry/vite-plugin'
/**
* * unplugin-icons插件,自动引入iconify图标
@@ -46,11 +45,4 @@ export default [
customDomId: '__CUSTOM_SVG_ICON__',
}),
mkcert(),
- sentryVitePlugin({
- authToken:
- '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',
- org: 'sentry',
- project: 'jdt-mer',
- url: 'https://w.huakk.top',
- }),
]
From 3a246511e1459c06666519385fc7715e8ceaaa4d Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Fri, 8 Mar 2024 19:15:47 +0800
Subject: [PATCH 7/9] ci(custom):
---
.drone.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.drone.yml b/.drone.yml
index 40c904e..88402a6 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -27,7 +27,7 @@ steps:
image: node:20-alpine
when:
branch:
- - master
+ - main
commands:
- npm config set registry https://registry.npmmirror.com/
- npm install -g pnpm
From dd49ee9cd6f73fc7d25f5a0ec2f72063076fcb1f Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Fri, 8 Mar 2024 20:54:49 +0800
Subject: [PATCH 8/9] ci(custom):
---
.drone.yml | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/.drone.yml b/.drone.yml
index 88402a6..16cd62f 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -77,14 +77,8 @@ steps:
- rm -rf dist.tar
- cd jdt-mer-dev
- docker build -t jdt-mer-dev .
- - target_container="jdt-mer-dev"
- - if docker ps -a --format '{{.Names}}' | grep -q "^$target_container$"; then
- - echo "容器存在,执行操作..."
- docker stop jdt-mer-dev
- docker rm jdt-mer-dev
- - else
- - echo "容器不存在"
- - fi
- docker run -d -p 8083:80 --restart=always --name jdt-mer-dev jdt-mer-dev
- cd ..
- rm -rf jdt-mer-dev
@@ -129,14 +123,8 @@ steps:
- rm -rf dist.tar
- cd jdt-mer-prod
- cd docker build -t jdt-mer-prod .
- - target_container="jdt-mer-prod"
- - if docker ps -a --format '{{.Names}}' | grep -q "^$target_container$"; then
- - echo "容器存在,执行操作..."
- docker stop jdt-mer-prod
- docker rm jdt-mer-prod
- - else
- - echo "容器不存在"
- - fi
- docker run -d -p 8083:80 --restart=always --name jdt-mer-prod jdt-mer-prod
- cd ..
- rm -rf jdt-mer-prod
From 71f72ff03ddfe0e2fc12623ce10d1f96646c138b Mon Sep 17 00:00:00 2001
From: YuanHuakk <1751826683@qq.com>
Date: Sat, 9 Mar 2024 18:17:51 +0800
Subject: [PATCH 9/9] =?UTF-8?q?feat(custom):=20=E5=A2=9E=E5=8A=A0=E5=90=8E?=
=?UTF-8?q?=E7=BB=93=E7=BB=9F=E8=AE=A1=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.drone.yml | 2 +-
src/views/order/pengding_order_data/index.vue | 36 ++++++++++++++++++-
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/.drone.yml b/.drone.yml
index 16cd62f..9ed1c60 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -122,7 +122,7 @@ steps:
- tar -xzvf dist.tar -C /www/builder/jdt-mer-prod
- rm -rf dist.tar
- cd jdt-mer-prod
- - cd docker build -t jdt-mer-prod .
+ - docker build -t jdt-mer-prod .
- docker stop jdt-mer-prod
- docker rm jdt-mer-prod
- docker run -d -p 8083:80 --restart=always --name jdt-mer-prod jdt-mer-prod
diff --git a/src/views/order/pengding_order_data/index.vue b/src/views/order/pengding_order_data/index.vue
index 70b4eb8..b6bc961 100644
--- a/src/views/order/pengding_order_data/index.vue
+++ b/src/views/order/pengding_order_data/index.vue
@@ -1,5 +1,25 @@
+
+
+
+
+ 时间筛选:
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
@@ -67,6 +87,10 @@ const cardData = ref({})
const loading = ref(false)
+const queryData = ref({
+ time: null,
+})
+
const option = ref({
tooltip: {
trigger: 'axis',
@@ -91,6 +115,7 @@ const option = ref({
{
data: [],
type: 'bar',
+ barWidth: '10%',
name: '金额(元)',
label: {
show: true,
@@ -119,7 +144,11 @@ const get_data = async () => {
loading.value = true
option.value.xAxis.data = []
option.value.series[0].data = []
- const res = await api.getData()
+ const query_data = {
+ StartTime: queryData.value.time === null ? '' : queryData.value.time[0] || '',
+ EndTime: queryData.value.time === null ? '' : queryData.value.time[1] || '',
+ }
+ const res = await api.getData(query_data)
cardData.value = res.data
for (let i = 0; i < res.data.data.length; i++) {
option.value.xAxis.data.push(res.data.data[i].Name)
@@ -128,6 +157,11 @@ const get_data = async () => {
console.log(cardData.value)
loading.value = false
}
+
+const clear = async () => {
+ queryData.value.time = null
+ get_data()
+}