Commit 1cec5b57 authored by Qingyu Deng's avatar Qingyu Deng

fix: refactored get role method

parent 7018a549
......@@ -265,7 +265,7 @@ import {
getWithdrawAudit,
getApplyDetail,
getFreezingFund,
getAll_role_list,
getRolesForUser,
} from "../../../service/Withdrawal/withdrawal";
import { ElMessage } from "element-plus";
import { fetchCurrentUser } from "../../../service/user";
......@@ -334,9 +334,9 @@ export default {
const res = await this.getPermissionsAll();
console.log(res);
if(!res) {
this.$router.push({name: 'Forbidden'})
return
if (!res) {
this.$router.push({ name: "Forbidden" });
return;
}
let withdrawlPermission = res.filter(
......@@ -363,7 +363,7 @@ export default {
// 不能够信赖 store 中的 email,无法知道全局中的 fetchCurrentUser 处理完毕
// 是一个重构的点
const { user } = await fetchCurrentUser();
const res = await getAll_role_list(user.email);
const res = await getRolesForUser(user.email);
this.permissions = res;
return res;
......
import axios from '../utils/request';
import axios from "../utils/request";
// import qs from 'qs';
//角色列表
export async function getRole_list (parmasRole_list, appid) {
export async function getRole_list(parmasRole_list, appid) {
const opts = {
method: "post",
url: "/api/v1/merchant/authority/role_list",
......@@ -13,7 +13,7 @@ export async function getRole_list (parmasRole_list, appid) {
return await axios(opts);
}
//添加角色
export async function getAdd_role (parmasAdd_role, appid) {
export async function getAdd_role(parmasAdd_role, appid) {
const opts = {
method: "post",
url: "/api/v1/merchant/authority/add_role",
......@@ -25,7 +25,7 @@ export async function getAdd_role (parmasAdd_role, appid) {
// return res;
}
//角色编辑
export async function getUpdate_role (parmasUpdate_role, appid) {
export async function getUpdate_role(parmasUpdate_role, appid) {
const opts = {
method: "post",
url: "/api/v1/merchant/authority/update_role",
......@@ -37,7 +37,7 @@ export async function getUpdate_role (parmasUpdate_role, appid) {
// return res;
}
//角色详情
export async function get_role_info (role_id, appid) {
export async function get_role_info(role_id, appid) {
const opts = {
method: "post",
url: "/api/v1/merchant/authority/get_role_info",
......@@ -52,7 +52,7 @@ export async function get_role_info (role_id, appid) {
// return res.result;
}
//角色删除
export async function getDelete_role (role_id, appid) {
export async function getDelete_role(role_id, appid) {
const opts = {
method: "post",
url: "/api/v1/merchant/authority/delete_role",
......@@ -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 = {
method: "post",
url: "/api/v1/merchant/authority/get_role_list",
......
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