import { post, upload } from "./axios";

export const Login = (params) => post("/admin/check", params); // 登录
export const logout = (params) => post("/main/logout", params); // 退出登录
export const getAsyncRouter = (params) => post("/main/index", params); // 获取动态路由
export const getHasMenu = (params) =>
  post("/head/hasMenu", { loading: false, ...params }); // 获取有没有权限访问路由
export const getUserInfo = (params) => post("/user/goEditMyInfo", params); // 获取用户信息
export const setUserInfo = (params) => post("/user/editUserOwn", params); // 修改用户信息
export const getVerifyDuplicateEmail = (params) =>
  post("/user/hasEmail", params); // 验证邮箱重复
export const getVerifyDeduplicationUser = (params) =>
  post("/user/hasUser", params); // 用户名去重
export const setAvatar = (params) => upload("/photo/saveNew", params); // 修改头像
export const getInfo = (params) =>
  post("/head/getInfo", { loading: false, ...params }); // 获取用户信息
export const setUploadImg = (params) => upload("/imgfiles/add", params); // 上传附件
export const setDeleteImg = (params) => post("/imgfiles/delete", params); // 删除附件
export const getViewImg = (params) => post("/imgfiles/listImgs", params); // 查看图片

export const getVideoSource = (params) =>
  post("/videoRes/getVideoPlayAuth", params); // 获取视频 目前404

export const getVideoAuth = (params) =>
  post("/videocourseware/getVideoPlayAuth", params); // 获取视频权限
