店铺管理-》员工管理增加权限设置
This commit is contained in:
@@ -4,14 +4,14 @@ const baseURL = Account_BaseUrl + "/admin";
|
||||
const ShopStaffApi = {
|
||||
// 获取店铺权限列表
|
||||
getshopPermission() {
|
||||
return request<any>({
|
||||
return request<any, PermissionResonpseResponse>({
|
||||
url: `${baseURL}/shopPermission`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
// 获取员工对应的权限id
|
||||
getPermission(id: number | string) {
|
||||
return request<any>({
|
||||
return request<any, string[]>({
|
||||
url: `${baseURL}/shopStaff/permission`,
|
||||
method: "get",
|
||||
params: { id }
|
||||
@@ -20,3 +20,56 @@ const ShopStaffApi = {
|
||||
};
|
||||
|
||||
export default ShopStaffApi;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*
|
||||
* CzgResult«List«ShopPermission»»
|
||||
*/
|
||||
export interface PermissionResonpseResponse {
|
||||
code?: number | null;
|
||||
data?: ShopPermission[] | null;
|
||||
msg?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺权限 实体类。
|
||||
*
|
||||
* ShopPermission
|
||||
*/
|
||||
export interface ShopPermission {
|
||||
children?: ShopPermission[] | null;
|
||||
/**
|
||||
* 权限code,为了区分采用汉语拼音
|
||||
*/
|
||||
code?: null | string;
|
||||
createTime?: null | string;
|
||||
id: string;
|
||||
/**
|
||||
* 是否重要: 重要对应页面红色
|
||||
*/
|
||||
isImportant?: number | null;
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
label?: null | string;
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
level?: number | null;
|
||||
/**
|
||||
* 上级ID
|
||||
*/
|
||||
parentId?: number | null;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number | null;
|
||||
/**
|
||||
* 权限类型:staff 员工,
|
||||
*/
|
||||
type?: null | string;
|
||||
updateTime?: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
78
src/api/account/shopArea.ts
Normal file
78
src/api/account/shopArea.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import request from "@/utils/request";
|
||||
import { Account_BaseUrl } from "@/api/config";
|
||||
const baseURL = Account_BaseUrl + "/admin/shopArea";
|
||||
const ShopStaffApi = {
|
||||
getList(params: getListRequest) {
|
||||
return request<any>({
|
||||
url: `${baseURL}`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
add(data: addRequest) {
|
||||
return request<any>({
|
||||
url: `${baseURL}`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
},
|
||||
edit(data: editRequest) {
|
||||
return request<any>({
|
||||
url: `${baseURL}`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
},
|
||||
delete(id: string | number) {
|
||||
return request<any>({
|
||||
url: `${baseURL}`,
|
||||
method: "delete",
|
||||
data: { id }
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ShopStaffApi;
|
||||
|
||||
export interface getListRequest {
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
name?: string;
|
||||
page?: string;
|
||||
size?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
/**
|
||||
* ShopAreaEditDTO
|
||||
*/
|
||||
export interface editRequest {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
id: number | null;
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
name?: null | string;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number | null;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* ShopAreaAddDTO
|
||||
*/
|
||||
export interface addRequest {
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
name: null | string;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number | null;
|
||||
[property: string]: any;
|
||||
}
|
||||
Reference in New Issue
Block a user