Commit 7d300bd0 authored by 黄奎's avatar 黄奎

文件上传修改

parent 4cbf4509
......@@ -51,14 +51,12 @@ export default {
this.Info("已取消操作");
});
},
//域名管理对象
Vue.prototype.domainManager = function () {
let domainUrl = "http://192.168.10.68:5000";
domainUrl = "https://mallapi.oytour.com";
let javaUrl = 'http://192.168.10.214:8018';
let vtUploadUrl = "http://192.168.5.46:8120";
let vtViewUrl = "http://192.168.5.46:8130";
let domainUrl = "http://192.168.5.46:8200";
let javaUrl = 'http://192.168.5.214:8018';
let vtUploadUrl = "http://192.168.5.214:8120";
let vtViewUrl = "http://192.168.5.214:8130";
let locationName = window.location.hostname;
if (locationName.indexOf('testmall.oytour') !== -1) {
......@@ -254,7 +252,7 @@ export default {
var uploadResult = {
resultCode: 1,
FileName: fileObj.name,
FileUrl:res.data.FilePath,
FileUrl: res.data.FilePath,
VideoCoverImg: that.domainManager().VTViewUrl + res.data.VideoCoverImg
}
if (callback) {
......@@ -282,7 +280,7 @@ export default {
var uploadResult = {
resultCode: 1,
FileName: fileObj.name,
FileUrl:res.data.FilePath,
FileUrl: res.data.FilePath,
VideoCoverImg: that.domainManager().VTViewUrl + res.data.VideoCoverImg
}
if (successCall) {
......@@ -314,8 +312,6 @@ export default {
}
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().DomainUrl + cmd;
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
......@@ -581,41 +577,41 @@ export default {
successCall(res);
}
}, faildCall)
},
Vue.prototype.Get_i_Data = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
let apiData = {}
if (localStorage.getItem('iframeData')) {
apiData = JSON.parse(localStorage.getItem('iframeData'))
}
var token = apiData.token;
var key = "";
var TenantId = "0"; //商户Id
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: 0,
cmd: cmdStr,
MallBaseId: 5,
TenantId: TenantId,
EmpId: 0, //员工编号【员工登录时使用】
SmallShopsId: 0,
MiniAppId: "wxbb033190e0ffa5db",
OpenId: "ow_7I5cKHQJeQlNJOKoeERRhe6SA",
UserId: 21382,
}
return postData
}
Vue.prototype.Get_i_Data = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
var timestamp = (new Date()).valueOf();
let apiData = {}
if (localStorage.getItem('iframeData')) {
apiData = JSON.parse(localStorage.getItem('iframeData'))
}
var token = apiData.token;
var key = "";
var TenantId = "0"; //商户Id
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: 0,
cmd: cmdStr,
MallBaseId: 5,
TenantId: TenantId,
EmpId: 0, //员工编号【员工登录时使用】
SmallShopsId: 0,
MiniAppId: "wxbb033190e0ffa5db",
OpenId: "ow_7I5cKHQJeQlNJOKoeERRhe6SA",
UserId: 21382,
}
return postData
}
}
}
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