Commit 30d9f5ea authored by 智勇's avatar 智勇

关闭用户订单

parent d1d14822
......@@ -10,23 +10,6 @@ NProgress.configure({ showSpinner: false })// NProgress configuration
const whiteList = ['/login'] // 不重定向白名单
router.beforeEach((to, from, next) => {
NProgress.start()
// if (whiteList.indexOf(to.path) !== -1) {
// next()
// } else {
// if (store.getters.roles.length === 0) {
// store.dispatch('GetInfo').then(res => { // 拉取用户信息
// next()
// }).catch(() => {
// store.dispatch('FedLogOut').then(() => {
// // Message.error(err || 'Verification failed, please login again')
// next(`/login`) // 否则全部重定向到登录页
// // next({ path: '/' })
// })
// })
// } else {
// next()
// }
// }
if (getToken()) {
if (to.path === '/login') {
......@@ -39,7 +22,7 @@ router.beforeEach((to, from, next) => {
}).catch((err) => {
store.dispatch('FedLogOut').then(() => {
Message.error(err || 'Verification failed, please login again')
next({ path: '/' })
// next({ path: '/' })
})
})
} else {
......@@ -50,6 +33,7 @@ router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
Message.warning('请登录...')
next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
NProgress.done()
}
......
......@@ -2,6 +2,7 @@ import axios from 'axios'
import { Message } from 'element-ui'
import store from '../store'
import { getToken } from '@/utils/auth'
import { MessageBox } from 'element-ui'
// 创建axios实例
const service = axios.create({
......@@ -36,26 +37,28 @@ service.interceptors.response.use(
* code为非20000是抛错 可结合自己业务进行修改
*/
const res = response.data
if ((typeof res.code === 'number' && res.code !== 200000) || (typeof res.code === 'string' && res.code !== '0000')) {
Message({
message: res.message,
type: 'error',
duration: 5 * 1000
})
if ((typeof res.code === 'number' && res.code !== 200000) || (typeof res.code === 'string' && res.code !== '0000')) {
// 500003:Token 过期了;
if (res.code === 500003) {
if (res.code === 500003 || res.code === 500006) {
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
// location.replace(`${location.protocol}//${location.host}/login`)
})
}).catch(() => {})
} else {
Message({
message: 'token失效,你已被登出',
type: 'warning',
duration: 2000
message: res.message,
type: 'error',
duration: 5 * 1000
})
}
return Promise.reject('error')
return Promise.reject('responseInterceptorsError')
} else {
return response.data
}
......
......@@ -14,7 +14,7 @@
</div>
<div class="bullshit__headline">{{ message }}</div>
<div class="bullshit__info">请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告</div>
<a href="" class="bullshit__return-home">返回首页</a>
<a href="/" class="bullshit__return-home">返回首页</a>
</div>
</div>
</div>
......
......@@ -168,6 +168,7 @@ export default {
this.count = res.data.totalElements
this.$refs.myTable.setCurrentRow(this.channels[0])
}
}).catch(() => {
})
},
......
......@@ -50,7 +50,8 @@ export default {
},
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
// location.reload() // 为了重新实例化vue-router对象 避免bug
this.$router.push({ path: '/login' })
})
}
}
......
......@@ -67,7 +67,11 @@
<el-table-column label="状态枚举值" prop="callbackStatus" align="center"/>
<el-table-column label="重试次数" prop="retryTimes" align="center"/>
<el-table-column label="失败原因" prop="failCode" align="center"/>
<el-table-column label="是否活跃" prop="isActive" align="center"/>
<el-table-column label="是否活跃" prop="isActive" align="center">
<template slot-scope="scope">
<el-tag >{{ scope.row.isActive | activeFilter }}</el-tag>
</template>
</el-table-column>
<el-table-column
label="其他数据"
align="center">
......@@ -173,6 +177,14 @@ export default {
false: '失败'
}
return statusMap[status]
},
activeFilter(status) {
const activeMap = {
true: '',
false: ''
}
return activeMap[status]
}
},
data() {
......@@ -233,6 +245,7 @@ export default {
// for (const o in this.orders) {
// this.orders[o].opt = o % 2 === 0 ? [{ action: 'audit', name: '审核' }, { action: 'loan', name: '放款' }] : [{ action: 'audit', name: '审核' }]
// }
}).catch(() => {
})
},
......
......@@ -49,11 +49,19 @@ export default {
closeOrder() {
closeOrder({ mobile: this.closeOrderMobile }).then(res => {
if (res.data) {
this.$notify({
title: '成功',
message: res.message,
type: 'success',
duration: 2000
})
} else {
this.$notify({
message: res.message,
type: 'error',
duration: 2000
})
}
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment