import request from "@/utils/request";
import { Account_BaseUrl } from "@/api/config";
import { get } from "lodash";
const baseURL = Account_BaseUrl + "/admin/shopPagePermission";
const Api = {
  // 获取所有页面路径
  getPageAll(params: any) {
    return request<any, object[]>({
      url: `${baseURL}`,
      method: "get",
      params: params,
    });
  },
  // 保存修改权限
  save(data: any) {
    return request<any>({
      url: `${baseURL}`,
      method: "post",
      data: data,
    });
  },
  //获取员工拥有页面路径
  detail(params: any) {
    return request<any, PagePath[]>({
      url: `${baseURL}/detail`,
      method: "get",
      params: params,
    });
  },
  //获取当前员工已拥有页面路径
  mine(params: any) {
    return request<any>({
      url: `${baseURL}/mine`,
      method: "get",
      params: params,
    });
  }
};

export default Api;

interface PagePath {
  label: string;
  value: string;
  [property: string]: any;
}