diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9bb88c3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,54 @@ +kind: pipeline +type: docker +name: makeit-scan + +steps: + - name: 'build' + image: node + volumes: + - name: node_modules_cache + path: /drone/src/node_modules + commands: + - node -v + - npm -v + - ls -al + - npm config set registry https://registry.npmmirror.com/ + - npm i + - npm run build + + - name: 'copy' + image: appleboy/drone-scp + settings: + host: + from_secret: secret_host + username: + from_secret: secret_username + password: + from_secret: secret_password + port: 22 + source: ./dist/* + target: /makeit/web/scan + + - name: 'deploy' + image: appleboy/drone-ssh + settings: + host: + from_secret: secret_host + username: + from_secret: secret_username + password: + from_secret: secret_password + port: 22 + command_timeout: 3m + script: + - echo '====== deploy start ======' + - cd /makeit/web/scan + - rm -rf index.html favicon.ico _assets + - mv ./dist/* ./ + - rm -rf dist + - echo '====== deploy success ======' + +volumes: + - name: node_modules_cache + host: + path: /makeit/web/drone/node_modules \ No newline at end of file diff --git a/README.md b/README.md index 638b161..10a4ba5 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,18 @@ # 扫描解析二维码 / 条形码 -> 整个 Demo 项目采用的是 Vue3 + Vite + zxing + Ant Design Vue 构建。实现 Web 浏览器端拉起摄像头,扫描二维码 / 条形码并对其解析的功能。(注意:iPhone 系列的手机,除了 Safari 自带浏览器外,其它任何的浏览器是没有权限配置网站是否可用摄像头的,所以采用折中的解决方案,拉起摄像头后拍照进行识别)。 +> 整个 Demo 项目采用的是 Vue3 + Vite + zxing + Ant Design Vue 构建。实现 Web 浏览器端拉起摄像头,扫描二维码 / 条形码并对其解析的功能。(注意:iPhone 系列的手机,除了 Safari 自带浏览器外,其它任何的浏览器是没有权限配置网站是否可用摄像头的,所以采用折中的解决方案,拉起摄像头后拍照进行识别)。 +> > Demo 体验地址:[https://scan.makeit.vip/](https://scan.makeit.vip/) ## 证书 + > `localhost` 支持调试,需要用其它任何域名来调试的话,先配置 `https`(我测试的时候用的是 `letsencrypt` + `docker` 来生成免费的 `https` 证书的) ## 运行 -``` + +```bash git clone https://github.com/lirongtong/miitvip-canvas-demo.git cd miitvip-scan-demo npm install npm run dev -``` \ No newline at end of file +``` diff --git a/index.html b/index.html index 914d25b..0565471 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,7 @@