Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
ka-op-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
ka-op-ui
Commits
30d9f5ea
Commit
30d9f5ea
authored
Sep 26, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关闭用户订单
parent
d1d14822
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
41 deletions
+51
-41
permission.js
src/permission.js
+2
-18
request.js
src/utils/request.js
+18
-15
404.vue
src/views/404.vue
+1
-1
index.vue
src/views/channel/index.vue
+1
-0
Navbar.vue
src/views/layout/components/Navbar.vue
+2
-1
index.vue
src/views/order/index.vue
+14
-1
index.vue
src/views/user/index.vue
+13
-5
No files found.
src/permission.js
View file @
30d9f5ea
...
...
@@ -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
()
}
...
...
src/utils/request.js
View file @
30d9f5ea
...
...
@@ -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
)
{
store
.
dispatch
(
'
FedLogOut
'
).
then
(()
=>
{
location
.
reload
()
// 为了重新实例化vue-router对象 避免bug
})
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
:
2
000
message
:
res
.
message
,
type
:
'
error
'
,
duration
:
5
*
1
000
})
}
return
Promise
.
reject
(
'
e
rror
'
)
return
Promise
.
reject
(
'
responseInterceptorsE
rror
'
)
}
else
{
return
response
.
data
}
...
...
src/views/404.vue
View file @
30d9f5ea
...
...
@@ -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>
...
...
src/views/channel/index.vue
View file @
30d9f5ea
...
...
@@ -168,6 +168,7 @@ export default {
this
.
count
=
res
.
data
.
totalElements
this
.
$refs
.
myTable
.
setCurrentRow
(
this
.
channels
[
0
])
}
}).
catch
(()
=>
{
})
},
...
...
src/views/layout/components/Navbar.vue
View file @
30d9f5ea
...
...
@@ -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
'
})
})
}
}
...
...
src/views/order/index.vue
View file @
30d9f5ea
...
...
@@ -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
(()
=>
{
})
},
...
...
src/views/user/index.vue
View file @
30d9f5ea
...
...
@@ -49,11 +49,19 @@ export default {
closeOrder
()
{
closeOrder
({
mobile
:
this
.
closeOrderMobile
}).
then
(
res
=>
{
this
.
$notify
({
title
:
'
成功
'
,
type
:
'
success
'
,
duration
:
2000
})
if
(
res
.
data
)
{
this
.
$notify
({
message
:
res
.
message
,
type
:
'
success
'
,
duration
:
2000
})
}
else
{
this
.
$notify
({
message
:
res
.
message
,
type
:
'
error
'
,
duration
:
2000
})
}
})
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment