diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..193884a --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "打包文件" +yarn build +echo "传输文件" +scp -r ./dist/** pig@139.224.200.249:/data/avue/sword +echo "部署成功" \ No newline at end of file diff --git a/src/config/website.js b/src/config/website.js index 2f430e0..848a762 100644 --- a/src/config/website.js +++ b/src/config/website.js @@ -9,7 +9,7 @@ export default { lockPage: '/lock', tokenTime: 6000, //http的status默认放行不才用统一处理的, - statusWhiteList: [400], + statusWhiteList: [], //配置首页不可关闭 isFirstPage: false, fistPage: { diff --git a/src/router/axios.js b/src/router/axios.js index 0774561..75ee549 100644 --- a/src/router/axios.js +++ b/src/router/axios.js @@ -44,9 +44,9 @@ axios.interceptors.request.use(config => { //HTTPresponse拦截 axios.interceptors.response.use(res => { NProgress.done(); - const status = Number(res.status) || 200; + const status = res.data.code || 200 const statusWhiteList = website.statusWhiteList || []; - const message = res.data.message || '未知错误'; + const message = res.data.msg || '未知错误'; //如果在白名单里则自行catch逻辑处理 if (statusWhiteList.includes(status)) return Promise.reject(res); //如果是401则跳转到登录页面