rt-sim-training-client/src/api/jlmap3d/assets3d.js

73 lines
1.6 KiB
JavaScript

import request from '@/utils/request';
import { getBaseUrl } from '@/utils/baseUrl';
const BASE_API = getBaseUrl();
let uploadurl = null;
let asseturl = null;
if(BASE_API == "https://test.joylink.club/jlcloud"){
uploadurl = "https://test.joylink.club/jlfile";
asseturl = "https://test.joylink.club/oss/joylink"
}else if(BASE_API == "https://joylink.club/jlcloud"){
uploadurl = "https://joylink.club/jlfile";
asseturl = "https://joylink.club/oss/joylink"
}else{
uploadurl = "../static";
asseturl = "../static"
}
const BASE_UPLOAD_API = uploadurl;
export const BASE_ASSET_API = asseturl;
export function getUploadModelUrl() {
return (BASE_UPLOAD_API+"/api/upload/MODEL?appId=00001&appSecret=joylink00001");
}
export function getUploadPicUrl() {
return (BASE_UPLOAD_API+"/api/upload/PICTURE?appId=00001&appSecret=joylink00001");
}
export function deleteAsset(url) {
return request({
url: BASE_UPLOAD_API+`/api/upload/delete?url=${url}&appId=00001&appSecret=joylink00001`,
method: 'delete',
});
}
//按id删除文件信息
export function deleteAssetData(id) {
return request({
url: `/api/map3dModel/${id}/delete`,
method: 'delete',
});
}
export function saveMap3dModelData(data) {
return request({
url: `/api/map3dModel`,
method: 'post',
data: data
});
}
export function getMap3dModelDataAll() {
return request({
url: `/api/map3dModel/all`,
method: 'get'
});
}
export function updateMap3dModelData(data) {
return request({
url: `/api/map3dModel`,
method: 'put',
data: data
});
}
export function getMap3dModelData(data) {
return request({
url: `/api/map3dModel?resourceType=`+data,
method: 'get'
});
}