Commit 046c2912 authored by 黄奎's avatar 黄奎
parents 8d387724 d1d12806
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
}, },
methods:{ methods:{
getDateList(){ getDateList(){
console.log('进入方法')
if(this.value!=''){ if(this.value!=''){
this.msg.StartDate = this.value[0]; this.msg.StartDate = this.value[0];
this.msg.EndDate = this.value[1]; this.msg.EndDate = this.value[1];
...@@ -141,7 +142,7 @@ ...@@ -141,7 +142,7 @@
this.msg.SupplierId= 0 this.msg.SupplierId= 0
} }
this.loading=true; this.loading=true;
this.apipost("/api/Statistics/GetOrderProfitLossList", this.msg, res => { this.mallapipost("/api/Statistics/GetOrderProfitLossList", this.msg, res => {
this.loading=false; this.loading=false;
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.tableData = res.data.data.pageData; this.tableData = res.data.data.pageData;
...@@ -153,7 +154,7 @@ ...@@ -153,7 +154,7 @@
}) })
}, },
getSupplierList(){//获取供应商接口 getSupplierList(){//获取供应商接口
this.apipost("/api/Supplier/GetSupplierAllList", {}, res => { this.mallapipost("/api/Supplier/GetSupplierAllList", {}, res => {
this.loading = false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.options = res.data.data; this.options = res.data.data;
......
...@@ -114,7 +114,9 @@ export default { ...@@ -114,7 +114,9 @@ export default {
//域名管理对象 //域名管理对象
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = '';
domainUrl = "http://192.168.2.214:8082"; // domainUrl = "http://192.168.2.214:8082";
domainUrl = "http://192.168.2.65:8025";
let locationName = window.location.hostname; let locationName = window.location.hostname;
let javaUrldo = ""; let javaUrldo = "";
...@@ -156,7 +158,7 @@ export default { ...@@ -156,7 +158,7 @@ export default {
// javaUrl:"http://192.168.2.215:9000", // javaUrl:"http://192.168.2.215:9000",
//Java接口本站文件流下载地址 //Java接口本站文件流下载地址
JavaLocalFileStreamDownLoadUrl: javaUrldo, JavaLocalFileStreamDownLoadUrl: javaUrldo,
mallUrl:"http://192.168.2.65",
}; };
return obj; return obj;
}, },
...@@ -331,6 +333,89 @@ export default { ...@@ -331,6 +333,89 @@ export default {
}, faildCall) }, faildCall)
}, },
//HTTP提交数据
Vue.prototype.mallapipost = function(cmd, msg, successCall, faildCall, isOnline) {
console.log('进入方法1')
var apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
}
//获取请求参数
Vue.prototype.GetPostData = function(cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
console.log('进入方2')
var timestamp = (new Date()).valueOf();
// if (!localStorage.mall_userInfo && localStorage.mall_userInfo != "" &&
// this.$route.path.toLowerCase() != "/login" &&
// this.$route.path.toLowerCase() != "/register" &&
// this.$route.path.toLowerCase() != "/forgetpassword"
// ) {
// this.$router.push({
// path: '/login'
// })
// }
var token = "";
var key = "";
var MallBaseId = 1; //小程序ID
var TenantId =1; //商户Id
// var EmpId = 0; //员工编号【员工登录时使用】
// if (this.getLocalStorage() != null) {
// token = this.getLocalStorage().Token;
// key = this.getLocalStorage().SecretKey;
// MallBaseId = this.getLocalStorage().MallBaseId;
// TenantId = this.getLocalStorage().TenantId;
// EmpId = this.getLocalStorage().EmpId;
// }
console.log('进入方法3')
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var cmdStr = "";
if (newCmd) {
cmdStr = newCmd;
}
var postData = {
msg: msg,
timestamp: timestamp,
token: token,
sign: md5Str,
languageId: tempLanguage,
cmd: cmdStr,
MallBaseId: MallBaseId,
TenantId: TenantId,
// EmpId: EmpId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
}
return postData
},
//用户权限验证 //用户权限验证
Vue.prototype.CheckUserAuth = function (authCode, successCall, faildCall) { Vue.prototype.CheckUserAuth = function (authCode, successCall, faildCall) {
let localStorageJson = this.getLocalStorage(); let localStorageJson = this.getLocalStorage();
......
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