import http from '../utils/http/http.js'

const indexdata = (data) => {
    return http.get("/admin/index/data", data);
};
const getindex = (data) => {
    return http.get("/admin/index", data);
};
const agreement = (type,data) => {
    return http.get("/admin/basic/agreement/"+type, data);
};
const updateagreement = (type,data) => {
    return http.put("/admin/basic/agreement/"+type, data);
};
const gettime = (data) => {
    return http.get("/admin/system/time/1", data);
};
const updatetime = (data) => {
    return http.put("/admin/system/time/1", data);
};
const getarticle = (data) => {
    return http.posts("/admin/article/page", data);
};
const getavideo = (data) => {
    return http.posts("/admin/video/page", data);
};
const gethospital = (data) => {
    return http.get("/admin/basic/hospital/page", data);
};
const putarticle = (id,data) => {
    return http.puts("/admin/article/"+id, data);
};
const putarticles = (data) => {
    return http.posts("/admin/article", data);
};
const putstatus = (id,data) => {
    return http.puts("/admin/article/status/"+id, data);
};
const putvideostatus = (id,data) => {
    return http.puts("/admin/video/status/"+id, data);
};
const getvote = (data) => {
    return http.get("/admin/article/vote/page", data);
};
const getvideovote = (data) => {
    return http.get("/admin/video/vote/page", data);
};
const putavideo = (id,data) => {
    return http.puts("/admin/video/"+id, data);
};
const putavideos = (data) => {
    return http.posts("/admin/video", data);
};
const UEDITOR_SERVERURL = import.meta.env.VITE_APP_UEDITOR_SERVERURL
const editorConfig = {
  // 后端服务地址，后端处理参考
  // https://open-doc.modstart.com/ueditor-plus/backend.html
  // serverUrl: '/api/path/to/server',
  serverUrl: UEDITOR_SERVERURL,
  // UEDITOR_HOME_URL: '/static/UEditorPlus/',
  // UEDITOR_CORS_URL: '/static/UEditorPlus/',
  loadConfigFromServer: true,
  UEDITOR_HOME_URL: import.meta.env.MODE=="development"?'/static/UEditorPlus/':'/admin/web/v/static/UEditorPlus/',
  UEDITOR_CORS_URL: import.meta.env.MODE=="development"?'/static/UEditorPlus/':'/admin/web/v/static/UEditorPlus/',
  initialFrameHeight: 500, // 高度
  initialFrameWidth: '100%',
  autoHeightEnabled: false,
}

export default {
    indexdata, getindex,agreement,updateagreement,gettime,updatetime,getarticle,gethospital,putarticles
    ,putarticle,putstatus,getvote,getavideo,getvideovote,putvideostatus,putavideo,putavideos,editorConfig
}