Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
bp
op-web-service
Commits
b78f4acf
Commit
b78f4acf
authored
Jul 26, 2021
by
Qingyu Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: resolve posible racing condition
parent
1e3147e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
38 deletions
+38
-38
App.vue
src/App.vue
+8
-10
index.vue
src/pages/Withdrawal/Examine/index.vue
+30
-28
No files found.
src/App.vue
View file @
b78f4acf
...
...
@@ -10,24 +10,22 @@
</
template
>
<
script
>
import
{
fetchCurrentUser
}
from
'./service/user'
;
import
{
redirectToLogin
}
from
'./utils/util'
;
import
{
fetchCurrentUser
}
from
"./service/user"
;
import
{
redirectToLogin
}
from
"./utils/util"
;
export
default
{
async
mounted
()
{
console
.
log
(
"master debug 2 !!!!!!"
)
if
(
this
.
$store
.
state
.
permissions
&&
this
.
$store
.
state
.
userInfo
)
return
async
created
()
{
console
.
log
(
"master debug 2 !!!!!!"
)
;
if
(
this
.
$store
.
state
.
permissions
&&
this
.
$store
.
state
.
userInfo
)
return
;
const
{
status
,
user
}
=
await
fetchCurrentUser
();
if
(
status
===
'success'
)
{
this
.
$store
.
commit
(
'updateUserInfo'
,
user
);
this
.
$store
.
dispatch
(
'updateUserPermission'
,
{
email
:
user
.
email
})
if
(
status
===
"success"
)
{
this
.
$store
.
commit
(
"updateUserInfo"
,
user
);
this
.
$store
.
dispatch
(
"updateUserPermission"
,
{
email
:
user
.
email
});
}
else
{
redirectToLogin
();
}
},
};
</
script
>
<
style
lang=
"less"
src=
"./global.less"
></
style
>
src/pages/Withdrawal/Examine/index.vue
View file @
b78f4acf
...
...
@@ -47,12 +47,7 @@
>
</el-form>
<!-- 列表区 -->
<el-table
class=
"goods_list"
:data=
"goodsList"
border
stripe
>
<el-table
class=
"goods_list"
:data=
"goodsList"
border
stripe
>
<el-table-column
label=
"提现用户"
prop=
"user_id"
...
...
@@ -120,7 +115,10 @@
@
click=
"handleDetail('audit', scope.row.id)"
>
审核
</el-button
>
<el-popconfirm
title=
"确定解冻吗?"
@
confirm=
"handleFinzingFind(scope.row.id)"
>
<el-popconfirm
title=
"确定解冻吗?"
@
confirm=
"handleFinzingFind(scope.row.id)"
>
<template
#
reference
>
<el-button
type=
"text"
...
...
@@ -129,7 +127,7 @@
>
</
template
>
</el-popconfirm>
<!-- <el-button
type="text"
v-if="searchProps.withdraw_apply_status == '3'"
...
...
@@ -270,6 +268,7 @@ import {
getAll_role_list
,
}
from
"../../../service/Withdrawal/withdrawal"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
fetchCurrentUser
}
from
"../../../service/user"
;
const
TABS
=
{
pending
:
"0"
,
...
...
@@ -304,7 +303,7 @@ export default {
searchProps
:
{
user_id
:
""
,
//用户id
page
:
1
,
count
:
0
,
count
:
0
,
page_size
:
20
,
//每页条数
status
:
TABS
.
pending
,
//状态
},
...
...
@@ -328,12 +327,12 @@ export default {
TABS
,
};
},
created
()
{
created
()
{
this
.
getApplyList
();
},
async
mounted
()
{
const
res
=
await
this
.
getPermissionsAll
()
console
.
log
(
res
)
const
res
=
await
this
.
getPermissionsAll
()
;
console
.
log
(
res
)
;
if
(
!
res
)
{
this
.
$router
.
push
({
name
:
'Forbidden'
})
...
...
@@ -341,28 +340,31 @@ export default {
}
let
withdrawlPermission
=
res
.
filter
(
({
name
})
=>
name
===
"withdrawal_audit"
)
({
name
})
=>
name
===
"withdrawal_audit"
)
;
if
(
withdrawlPermission
.
length
===
0
)
{
if
(
withdrawlPermission
.
length
===
0
)
{
// push to forbidden
this
.
$router
.
push
({
name
:
'Forbidden'
})
return
this
.
$router
.
push
({
name
:
"Forbidden"
});
return
;
}
console
.
log
(
"withdrawlPermission"
,
withdrawlPermission
)
withdrawlPermission
=
withdrawlPermission
[
0
]
console
.
log
(
"withdrawlPermission"
,
withdrawlPermission
)
;
withdrawlPermission
=
withdrawlPermission
[
0
]
;
// judge subpermission
let
subpermissions
=
withdrawlPermission
.
sub_permissions
.
filter
(
({
name
})
=>
name
===
"show"
)
if
(
subpermissions
.
length
===
0
)
{
this
.
$router
.
push
({
name
:
'Forbidden'
})
({
name
})
=>
name
===
"show"
)
;
if
(
subpermissions
.
length
===
0
)
{
this
.
$router
.
push
({
name
:
"Forbidden"
});
}
},
methods
:
{
async
getPermissionsAll
()
{
let
{
email
}
=
this
.
$store
.
state
.
userInfo
;
const
res
=
await
getAll_role_list
(
email
);
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 是一个重构的点
const
{
user
}
=
await
fetchCurrentUser
();
const
res
=
await
getAll_role_list
(
user
.
email
);
this
.
permissions
=
res
;
return
res
;
},
...
...
@@ -433,7 +435,7 @@ export default {
//获取黑名单
handleBlackList
(
action
)
{
const
{
id
,
user_id
,
wallet_id
}
=
this
.
dialogData
.
showData
;
const
{
id
,
user_id
,
wallet_id
}
=
this
.
dialogData
.
showData
;
const
params
=
{
id
,
user_id
,
...
...
@@ -503,8 +505,8 @@ export default {
showMode
:
"audit"
,
//判断是审核还是查看
}),
(
this
.
award
=
""
),
//奖励明细
(
this
.
outerVisible
=
false
)
//外层弹框
},
(
this
.
outerVisible
=
false
)
;
//外层弹框
},
},
computed
:
{
isAllowedToAudit
()
{
...
...
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