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
1cec5b57
Commit
1cec5b57
authored
Jul 26, 2021
by
Qingyu Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: refactored get role method
parent
7018a549
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
index.vue
src/pages/Withdrawal/Examine/index.vue
+5
-5
role.js
src/service/role.js
+7
-7
No files found.
src/pages/Withdrawal/Examine/index.vue
View file @
1cec5b57
...
@@ -265,7 +265,7 @@ import {
...
@@ -265,7 +265,7 @@ import {
getWithdrawAudit
,
getWithdrawAudit
,
getApplyDetail
,
getApplyDetail
,
getFreezingFund
,
getFreezingFund
,
get
All_role_list
,
get
RolesForUser
,
}
from
"../../../service/Withdrawal/withdrawal"
;
}
from
"../../../service/Withdrawal/withdrawal"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
fetchCurrentUser
}
from
"../../../service/user"
;
import
{
fetchCurrentUser
}
from
"../../../service/user"
;
...
@@ -334,9 +334,9 @@ export default {
...
@@ -334,9 +334,9 @@ export default {
const
res
=
await
this
.
getPermissionsAll
();
const
res
=
await
this
.
getPermissionsAll
();
console
.
log
(
res
);
console
.
log
(
res
);
if
(
!
res
)
{
if
(
!
res
)
{
this
.
$router
.
push
({
name
:
'Forbidden'
})
this
.
$router
.
push
({
name
:
"Forbidden"
});
return
return
;
}
}
let
withdrawlPermission
=
res
.
filter
(
let
withdrawlPermission
=
res
.
filter
(
...
@@ -363,7 +363,7 @@ export default {
...
@@ -363,7 +363,7 @@ export default {
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 是一个重构的点
// 是一个重构的点
const
{
user
}
=
await
fetchCurrentUser
();
const
{
user
}
=
await
fetchCurrentUser
();
const
res
=
await
get
All_role_list
(
user
.
email
);
const
res
=
await
get
RolesForUser
(
user
.
email
);
this
.
permissions
=
res
;
this
.
permissions
=
res
;
return
res
;
return
res
;
...
...
src/service/role.js
View file @
1cec5b57
import
axios
from
'../utils/request'
;
import
axios
from
"../utils/request"
;
// import qs from 'qs';
// import qs from 'qs';
//角色列表
//角色列表
export
async
function
getRole_list
(
parmasRole_list
,
appid
)
{
export
async
function
getRole_list
(
parmasRole_list
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/role_list"
,
url
:
"/api/v1/merchant/authority/role_list"
,
...
@@ -13,7 +13,7 @@ export async function getRole_list (parmasRole_list, appid) {
...
@@ -13,7 +13,7 @@ export async function getRole_list (parmasRole_list, appid) {
return
await
axios
(
opts
);
return
await
axios
(
opts
);
}
}
//添加角色
//添加角色
export
async
function
getAdd_role
(
parmasAdd_role
,
appid
)
{
export
async
function
getAdd_role
(
parmasAdd_role
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/add_role"
,
url
:
"/api/v1/merchant/authority/add_role"
,
...
@@ -25,7 +25,7 @@ export async function getAdd_role (parmasAdd_role, appid) {
...
@@ -25,7 +25,7 @@ export async function getAdd_role (parmasAdd_role, appid) {
// return res;
// return res;
}
}
//角色编辑
//角色编辑
export
async
function
getUpdate_role
(
parmasUpdate_role
,
appid
)
{
export
async
function
getUpdate_role
(
parmasUpdate_role
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/update_role"
,
url
:
"/api/v1/merchant/authority/update_role"
,
...
@@ -37,7 +37,7 @@ export async function getUpdate_role (parmasUpdate_role, appid) {
...
@@ -37,7 +37,7 @@ export async function getUpdate_role (parmasUpdate_role, appid) {
// return res;
// return res;
}
}
//角色详情
//角色详情
export
async
function
get_role_info
(
role_id
,
appid
)
{
export
async
function
get_role_info
(
role_id
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/get_role_info"
,
url
:
"/api/v1/merchant/authority/get_role_info"
,
...
@@ -52,7 +52,7 @@ export async function get_role_info (role_id, appid) {
...
@@ -52,7 +52,7 @@ export async function get_role_info (role_id, appid) {
// return res.result;
// return res.result;
}
}
//角色删除
//角色删除
export
async
function
getDelete_role
(
role_id
,
appid
)
{
export
async
function
getDelete_role
(
role_id
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/delete_role"
,
url
:
"/api/v1/merchant/authority/delete_role"
,
...
@@ -68,7 +68,7 @@ export async function getDelete_role (role_id, appid) {
...
@@ -68,7 +68,7 @@ export async function getDelete_role (role_id, appid) {
}
}
//权限列表
//权限列表
export
async
function
getAll_role_list
(
user_email
,
appid
)
{
export
async
function
getAll_role_list
(
user_email
,
appid
)
{
const
opts
=
{
const
opts
=
{
method
:
"post"
,
method
:
"post"
,
url
:
"/api/v1/merchant/authority/get_role_list"
,
url
:
"/api/v1/merchant/authority/get_role_list"
,
...
...
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