Commit 36b794e4 authored by 罗超's avatar 罗超

修改文件上传接口调用

parent 52027cf3
......@@ -203,6 +203,7 @@ const uploadFontHandler = async (uploadFile:any, uploadFiles:any, fontName:strin
}
const url = await FileService.uploadToFontServerAsync(uploadFile?.raw)
if(url && url!=''){
if(url.indexOf('"')!=-1) url = url.replaceAll('"','')
let label=uploadFile.name.split('.')[0],reduceName='',reduceUrl=''
try {
if(info.file){
......@@ -231,6 +232,11 @@ const uploadFontHandler = async (uploadFile:any, uploadFiles:any, fontName:strin
type:'error'
})
}
}else{
ElMessage({
message:'上传失败,请重试',
type:'error'
})
}
} catch (error) {
console.log("上传异常",error)
......
......@@ -21,7 +21,7 @@ const fetchWithTimeout = (url:string, timeout:number)=>{
}
class FileService {
static downloadLinePdfAsync = async (id: any) => {
let url = `http://fileservice.oytour.com/api/pdf/${id}`
let url = `https://fileservice.oytour.com/api/pdf/${id}`
try {
const response = await fetchWithTimeout(url, 60*1000);
// 处理响应
......@@ -104,7 +104,7 @@ class FileService {
}
static notifyFontUpdateAsync = async (fileName:string)=>{
await fetch('http://fileservice.oytour.com/api/file/downfont/'+fileName)
await fetch('https://fileservice.oytour.com/api/file/downfont/'+fileName)
}
static uploadToFontServerAsync = async (file:File)=>{
......@@ -112,13 +112,14 @@ class FileService {
const formData = new FormData();
formData.append('file', file);
const response = await fetch('http://localhost:5164/api/file/uploadfont', {
const response = await fetch('https://fileservice.oytour.com/api/file/uploadfont', {
method: 'POST',
body: formData,
});
if(response.ok){
let r = await response.text()
return r
if(r.indexOf('https://im.oytour.com')!=-1) return r
return ''
}
return ''
} catch (error) {
......
......@@ -143,7 +143,7 @@ const beginDownload = async ()=>{
}
}
fileUrl.value = `http://fileservice.oytour.com/api/img/${searchData.value.sellId}/${rangeArray.join(',')}/${format.value=='png'?'png':'jpg'}/${quality.value}/${useSellTemplateStore().SaleHashCode}` //http://fileservice.oytour.com
fileUrl.value = `https://fileservice.oytour.com/api/img/${searchData.value.sellId}/${rangeArray.join(',')}/${format.value=='png'?'png':'jpg'}/${quality.value}/${useSellTemplateStore().SaleHashCode}` //https://fileservice.oytour.com
console.log(fileUrl.value)
nextTick(()=>{
downloadLink.value.click()
......
......@@ -127,7 +127,7 @@ const exportOnlinePdf=()=>{
autoSave.value=1
}
const beginDownload = async ()=>{
fileUrl.value = `http://fileservice.oytour.com/api/pdf/${searchData.value.sellId}/${useSellTemplateStore().SaleHashCode}`
fileUrl.value = `https://fileservice.oytour.com/api/pdf/${searchData.value.sellId}/${useSellTemplateStore().SaleHashCode}`
nextTick(()=>{
downloadLink.value.click()
})
......
......@@ -216,8 +216,8 @@ const openFileDocument = (item:any) => {
window.open(url);
}
const exportDocument = (item:any) => {
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
let url = `https://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `https://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
window.open(url);
}
const changeFolderHandler = async (item:any) =>{
......
......@@ -340,8 +340,8 @@ import CopyFile from "./CopyFile.vue";
}
const exportDocument = (item:any) => {
let url = `http://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `http://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
let url = `https://fileservice.oytour.com/api/img/${item.FileId}/1/png/1/${item.HashInfo}`
if(item.FileType==1) url = `https://fileservice.oytour.com/api/pdf/${item.FileId}/${item.HashInfo}`
window.open(url);
}
const viewTemplate = (row:any) => {
......
......@@ -34,9 +34,6 @@ module.exports = {
})
],
},
devServer:{
https:true
},
pwa: {
name: 'PPTist',
themeColor: '#d14424',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment