Commit 37bfab8e authored by zhengke's avatar zhengke

no message

parent 194fcaa8
......@@ -128,7 +128,45 @@
},
customUpload(event){
let host = ''
if (process.env.NODE_ENV === "development") {
host = 'http://192.168.10.36:8082/api'
// host = 'http://192.168.10.65:8085/api'
} else {
host = 'https://eduapi.oytour.com/api'
}
const { file } = event.detail;
let params = {
Uid: 1,
CourseId: null,
ExamName: ''
}
uni.uploadFile({
url: host + '/Upload/UploadStuExamScore?Files='+file+'&params='+JSON.stringify(params),
filePath: file[0].url,
name: 'file',
formData: {
'myfile': file[0]
},
success(res) {
uni.hideLoading();
let jsonObj = JSON.parse(res.data)
let index = jsonObj.FilePath.indexOf(".")
let suffix = jsonObj.FilePath.slice(index + 1)
let uploadResult = {
name: fileObj.name,
url: uploadConfig.CustomDomain + '/' + jsonObj.FilePath,
type: fileObj.type,
suffix: suffix,
// VideoCoverImg: uploadConfig.CustomDomain + jsonObj.VideoCoverImg,
}
successCall(uploadResult);
},
fail(err) {
console.log("uploadErr", err)
}
});
return
uploadFile("stueave", file, (res) => {
console.log(res,'----')
});
......
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