Commit bc9fb94e authored by 黄奎's avatar 黄奎

页面修改

parent a13da573
......@@ -60,6 +60,37 @@ export function UploadSelfFile(path, file, callback, configObj) {
}
}
//上传视频文件到本地服务器
export function UploadViittoFile(path, file, callback) {
var uploadLoadding = Loading;
uploadLoadding.show({
message: '正在上传文件,请稍后...'
})
let viewFileUrl = 'http://192.168.20.214:8130';
let vtUploadUrl = "http://192.168.20.214:8120";
let locationName = window.location.hostname;
if (locationName.indexOf('testerp.oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
} else if (locationName.indexOf('oytour') !== -1) {
vtUploadUrl = "http://upload.oytour.com";
viewFileUrl = "https://imgfile.oytour.com";
}
var UploadConfig = {
Bucket: "系统",
CustomDomain: viewFileUrl,
Region: "成都",
SecretId: "SecreId",
SecretKey: "SecreKey",
StoreType: 3,
UploadDomain: vtUploadUrl,
};
var configObj = {
isCreateCover: 1
}
UploadFileToSystem(UploadConfig, path, file, uploadLoadding, callback, configObj)
}
/**
* 上传到当前站点
*/
......@@ -115,6 +146,9 @@ export function UploadFileToSystem(uploadConfig, fileFullPath, fileObj, uploadLo
if (configObj.isTrans && configObj.isTrans == 1) {
url += "&isTrans=1"
}
if (configObj.isCreateCover && configObj.isCreateCover == 1) {
url += "&isCreateCover=1"
}
}
let formData = new FormData()
formData.append('myfile', fileObj)
......
This diff is collapsed.
......@@ -83,9 +83,9 @@ export default {
let domainUrl = 'http://192.168.20.24';
let viewFileUrl = 'http://192.168.20.214:8120';
let mallUrl = "http://192.168.20.17:8014";
let vtUploadUrl = "http://192.168.20.214:8120";
let vtUploadUrl = "http://192.168.20.24:8120";
// let vtUploadUrl = "http://upload.oytour.com";
let vtViewUrl = "http://192.168.20.214:8130";
let vtViewUrl = "http://192.168.20.24:8130";
let locationName = window.location.hostname;
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
......@@ -533,31 +533,6 @@ export default {
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFile = function (path, file, callback) {
var that = this;
that.Info('上传中...')
var newPath = '/Upload/' + path + "/";
var formData = new FormData();
var uploadUrl = that.domainManager().VTUploadUrl + "/Upload?filePath=" + newPath + "&isCreateCover=1";
formData.append("myfile", file);
that.$http.post(uploadUrl, formData, {})
.then(res => {
if (res && res.status == 200 && res.data && res.data.FilePath) {
var uploadResult = {
resultCode: 1,
FileName: file.name,
FileUrl: that.domainManager().VTViewUrl + res.data.FilePath,
VideoCoverImg: that.domainManager().VTViewUrl + res.data.VideoCoverImg
}
if (callback) {
callback(uploadResult);
}
}
}).catch(function (reason) {
console.log(reason)
});
}
}
}
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