From 7f205259ca521c41c9314ed35bf5d73dd5c47f64 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 22 Oct 2021 18:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 74 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++ src/request/index.js | 6 ++-- vue.config.js | 26 ++++++++-------- 4 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e7d1591 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,74 @@ +kind: pipeline +type: docker +name: master +steps: + - name: restore-cache + image: meltwater/drone-cache + settings: + backend: filesystem + restore: true + cache_key: node_modules-taskvue + archive_format: gzip + filesystem_cache_root: "/var/lib/cache" + mount: + - node_modules + volumes: + - name: cache + path: "/var/lib/cache" + # Do stuff.. + - name: install + image: node:14 + commands: + - yarn install + - name: rebuild-cache + image: meltwater/drone-cache + settings: + backend: filesystem + rebuild: true + cache_key: node_modules-taskvue + archive_format: gzip + filesystem_cache_root: "/var/lib/cache" + mount: + - 'node_modules' + volumes: + - name: cache + path: "/var/lib/cache" + # Do stuff.. + - name: build + image: node:14 + commands: + - yarn run build + - name: scp files + image: appleboy/drone-scp + settings: + host: 121.41.13.10 + username: + from_secret: pro_user + password: + from_secret: pro_pass + port: 22 + target: /data/data/wwwroot/sws.oa00.com + source: dist/* + - name: ssh + image: appleboy/drone-ssh + settings: + host: 121.41.13.10 + username: + from_secret: pro_user + password: + from_secret: pro_pass + port: 22 + script: + - cd /data/data/wwwroot/sws.oa00.com + - \cp -rf dist/* ./ + - rm -rf dist +volumes: + - name: cache + host: + path: "/tmp/cache" +trigger: + branch: + - master + event: + - push + - merge diff --git a/README.md b/README.md index 3aeacbb..2d9eae8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # data-show +## build status +[![Build Status](https://drone.oa00.com/api/badges/SWS/carInsightSystem/status.svg?ref=refs/heads/master)](https://drone.oa00.com/SWS/carInsightSystem) + ## Project setup ``` yarn install diff --git a/src/request/index.js b/src/request/index.js index ca7aac7..3f38c33 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -22,7 +22,7 @@ function filterRequestData(obj) { } //创建axios的实例 const httpService = axios.create({ - baseURL: '/sws',// TODO:具体的配置可以根据项目情况而来 + baseURL: 'http://cloud.sws010.com',// TODO:具体的配置可以根据项目情况而来 timeout: 5000 }) @@ -32,7 +32,7 @@ httpService.interceptors.request.use(config => { // if(localStorage.getItem('token')){//判断浏览器中的cookie中是否存在项目的token // config.headers.token = localStorage.getItem('token') // } - + const rqData = filterRequestData(config.data); const rqParams = filterRequestData(config.params); // post 'Content-Type' === 'application/x-www-form-urlencoded' @@ -69,7 +69,7 @@ httpService.interceptors.response.use(response => { // TODO:具体的code对应的处理可继续添加修改 if(err.response.Code === 301){ // console.log('登录过期'); - //登录过期跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面 + //登录过期跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 ---主页(index) 或者 退出到登录前的浏览的页面 //这样登录页面登录接口成功之后可以进行跳转 主页(index) 或者 退出到登录前的页面: let path = this.$route.query.redirect || '/index.js'; this.$router.push(path); setTimeout(() => { router.replace({ diff --git a/vue.config.js b/vue.config.js index d36f139..cacd008 100644 --- a/vue.config.js +++ b/vue.config.js @@ -11,19 +11,19 @@ const productionGzipExtensions = ['js', 'css', 'svg'] module.exports = { productionSourceMap: false, publicPath: "./", - devServer: { - port: "8081", - proxy: { - '/sws': {//代理api - target: "http://cloud.sws010.com",// 代理接口 - changeOrigin: true,//是否跨域 - ws: true, // proxy websockets - pathRewrite: {//重写路径 - "^/sws": ''//代理路径 - } - } - } - }, + // devServer: { + // port: "8081", + // proxy: { + // '/sws': {//代理api + // target: "http://cloud.sws010.com",// 代理接口 + // changeOrigin: true,//是否跨域 + // ws: true, // proxy websockets + // pathRewrite: {//重写路径 + // "^/sws": ''//代理路径 + // } + // } + // } + // }, configureWebpack: config => { if (process.env.NODE_ENV === 'production') { // 配置productionGzip-高级的方式