Files
cashier-web/src/api/account/permission.ts

75 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}