From aa50c314647ea5aef6ab40f3cfd62a0c24163c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E5=B0=8F=E7=8E=8B=E5=91=80=5C24601?= <819653817@qq.com> Date: Fri, 9 Aug 2024 10:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5test=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=BC=B9=E6=A1=86=E4=B8=8D=E9=80=80?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 5 +++++ package.json | 1 + src/config/env.test.js | 10 ++++++++++ src/router/index.js | 10 +++++++--- src/store/index.js | 4 +++- src/store/modules/app.js | 3 ++- src/utils/request.js | 10 ++++++++-- src/views/Hotline/index.vue | 29 +++++++++++++++++------------ src/views/HotlineDetail/index.vue | 21 +++------------------ 9 files changed, 56 insertions(+), 37 deletions(-) create mode 100644 .env.test create mode 100644 src/config/env.test.js diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..9bf27bc --- /dev/null +++ b/.env.test @@ -0,0 +1,5 @@ +NODE_ENV='test' +# must start with VUE_APP_ +VUE_APP_ENV = 'test' +outputDir = 'epmet-work-h5-test' + diff --git a/package.json b/package.json index afbe7f7..bc34b8f 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build": "vue-cli-service build", "build:dev": "vue-cli-service build --mode development", "build:prod": "vue-cli-service build --mode production", + "build:test": "vue-cli-service build --mode test", "build:stage": "vue-cli-service build --mode staging", "lint": "vue-cli-service lint", "deps": "yarn upgrade-interactive --latest" diff --git a/src/config/env.test.js b/src/config/env.test.js new file mode 100644 index 0000000..5b60c24 --- /dev/null +++ b/src/config/env.test.js @@ -0,0 +1,10 @@ +// 本地环境配置 +module.exports = { + env: 'test', + title: 'e联社区', + baseUrl: 'https://epmet-test.elinkservice.cn/', // 项目地址 + baseApi: 'https://epmet-test.elinkservice.cn/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' + // baseApi: 'http://219.146.91.110:30801/api', // 本地api请求地址,注意:如果你使用了代理,请设置成'/' + APPID: 'xxx', + APPSECRET: 'xxx', +} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 55f819a..8d44c77 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,7 @@ import Vue from 'vue' import Router from 'vue-router' import { constantRouterMap } from './router.config.js' +import store from '@/store' // hack router push callback const originalPush = Router.prototype.push @@ -27,13 +28,16 @@ function getQueryParams() { }) return params } - router.beforeEach((to, from, next) => { + let urlParams = getQueryParams() - if(urlParams.worktoken){ + if(urlParams.worktoken&&to.path=='/Hotline'){ + console.log(store.state.app,"store.state.app.userInfo"); + store.state.app.isRouterLoading = true + console.log(to,"to"); console.log(urlParams.worktoken,"Sdfsfdjhjh") localStorage.setItem('token_work',urlParams.worktoken) - next({ path:'/Hotline'}) + next({ }) }else{ next() console.log(urlParams.worktoken,"Sdfsfd") diff --git a/src/store/index.js b/src/store/index.js index c621c2e..f30faa5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -11,7 +11,8 @@ const userInfo = { userInfo: { userName: '', agencyName: '', - serviceOrgIdentities: [] + serviceOrgIdentities: [], + isRouterLoading:false } }, mutations: { @@ -21,6 +22,7 @@ const userInfo = { } }; + const userInfoGetters = { userInfo: state => state.userInfo.userInfo }; diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 9596135..9dd0860 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,7 +1,8 @@ const state = { userName: '', tabActive:1, - scrollTop:0 + scrollTop:0, + isRouterLoading:false } const mutations = { SET_USER_NAME(state, name) { diff --git a/src/utils/request.js b/src/utils/request.js index 842153f..57a7c25 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -50,9 +50,15 @@ service.interceptors.response.use( return Promise.resolve(res) } else { let loginCode = [10007, 401, 10001, 10005, 10006] + if (loginCode.includes(res.code)) { - localStorage.removeItem('token_work') - router.replace('/') + if (store.state.app.userInfo.isRouterLoading) { + return + }else{ + localStorage.removeItem('token_work') + router.replace('/') + } + }else if(code > 8000){ Tips.error(res.msg) }else{ diff --git a/src/views/Hotline/index.vue b/src/views/Hotline/index.vue index f0c7dde..350ab60 100644 --- a/src/views/Hotline/index.vue +++ b/src/views/Hotline/index.vue @@ -8,11 +8,15 @@ - - + + - + @@ -23,7 +27,7 @@
-
+
工单号:{{ item.workOrderNum }} @@ -42,7 +46,8 @@ 来电人:{{item.name}} {{item.mobile}}
- 办理 + 办理
@@ -119,7 +124,6 @@ export default { }, methods: { statusClass(item) { - console.log(item,"dklslksjvx"); return { 'status-red': item === '未联系当事人', 'lan': item === '已联系当事人', @@ -133,14 +137,15 @@ export default { this.operationTypeType=value.text this.operationType=value.value // this.value = value; - this.showPicker2 = false; + this.showpicker2 = false; console.log( this.showPicker2,"iugui"); - this.$nextTick(() => { - console.log('Popup visibility status:', this.showpicker2); - }); + }, + onConfirm(value) { + // this.value = value; + this.showpicker2 = false; + }, showpicker1(){ - console.log("fds "); this.showpicker2=true }, diff --git a/src/views/HotlineDetail/index.vue b/src/views/HotlineDetail/index.vue index 91968fb..39e117d 100644 --- a/src/views/HotlineDetail/index.vue +++ b/src/views/HotlineDetail/index.vue @@ -103,10 +103,10 @@ {{ tableData.eventContent}}
-->
-
-
指派
+
指派
+
{{item.processName}}
{{item.processTime}}
@@ -132,7 +132,6 @@
{{item.timeLimit}}
-
@@ -180,7 +179,6 @@ placeholder="请选择" @click="showtime = true" /> - - - - - - - - - -
@@ -217,7 +206,7 @@
取消 - 办理 + 办理
@@ -257,7 +246,6 @@ export default { icEventId:"", workOrderNum:"", mobile:"", - operationType:"未联系当事人", status: false, pageNo: 1, pageSize: 20, @@ -331,9 +319,6 @@ export default { this.icEventId =this.$route.query.icEventId; this.icEventList() this.process() - - - }, mounted() {