/*
 * @Author: wufan
 * @Date: 2020-12-01 17:21:21
 * @LastEditors: renmanyi
 * @LastEditTime: 2026-02-03 15:38:02
 * @Description: Description
 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
 */
import Service from "@/common/js/service";
import User from "@/common/js/user";
import axios  from 'axios';

export function sendLoginAuthCode(params: object) {
  return Service.Hades("anon/hades/sendLoginAuthCode", params);
}
export function login(params: object) {
  return Service.Hades("anon/hades/login", params);
}
export function getUserStore(params: object) {
  return Service.Hades("public/hades/getUserStore", params);
}
export function getUserPermission(params: object) {
  return Service.Hades("public/hades/getPermission", params);
}
export function logout(params: object) {
  return Service.Hades("public/hades/logout", params);
}
export function getStoreUser(params: object) {
  return Service.Hades("public/hades/getStoreUser", params);
}
export function sendBizAuthCode(params: object) {
  return Service.Hades("public/hades/sendBizAuthCode", params);
}
export function checkBizAuthCode(params: object) {
  return Service.Hades("public/hades/checkBizAuthCode", params);
}
export function sendNewPhoneAuthCode(params: object) {
  return Service.Hades("public/hades/sendUserCenterAuthCode", params);
}
export function editUserPhone(params: object) {
  return Service.Hades("public/hades/editUserPhone", params);
}
export function getLastedVersion(params: object) {
  return Service.Hades("public/hades/getLastedVersion", params);
}
export function getEnterpriseUser(params: object) {
  return Service.Hades('public/customerHades/getEnterpriseUser', params);
}
export function getWXWorkLoginNoCheck(params: object) {
  return Service.Hades('anon/hades/getWXWorkLoginNoCheck', params);
}
export function getLesseeVersionMsg() {
  return Service.Hades("public/customerHades/getLesseeVersionMsg",{enterpriseId:User.getEnterpriseId()})
}

export function getYoZoSign(params: object) {
  return Service.Apollo('public/apollo/getYoZoSign', params);
}
export function saveYoZoFileVersionId(params: object) {
  return Service.Apollo('public/apollo/saveYoZoFileVersionId', params);
}
export function yoZoUpload(ossUrl:String,appId:String,uploadSign:String){
  return axios.post(`https://dmc.yozocloud.cn/api/file/http?fileUrl=${ossUrl}&appId=${appId}&sign=${uploadSign}`)
}
export function saveFileVersionIdByCourseChapter(params: object) {
  return Service.Hades('public/hades/saveFileVersionIdByCourseChapter', params);
}
export const getOssClient = (
  data: object,
  instId: string,
  bizCode: string,
  resourceName: string,
  accessTypeEnum: string
) => {
  return Service.postJSON('business/public/mfs/commonUpload', {
    data,
    instId,
    bizCode,
    resourceName,
    needSecret: true,
    accessTypeEnum
  });
}


