75 lines
1.4 KiB
TypeScript
75 lines
1.4 KiB
TypeScript
import request from "@/utils/request";
|
||
import { Account_BaseUrl } from "@/api/config";
|
||
const baseURL = Account_BaseUrl + "/admin";
|
||
const ShopStaffApi = {
|
||
// 获取店铺权限列表
|
||
getshopPermission() {
|
||
return request<any, PermissionResonpseResponse>({
|
||
url: `${baseURL}/shopPermission`,
|
||
method: "get",
|
||
});
|
||
},
|
||
// 获取员工对应的权限id
|
||
getPermission(id: number | string) {
|
||
return request<any, string[]>({
|
||
url: `${baseURL}/shopStaff/permission`,
|
||
method: "get",
|
||
params: { id }
|
||
});
|
||
},
|
||
};
|
||
|
||
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;
|
||
} |