Commit 03ae6b51 authored by 罗超's avatar 罗超

1

parent db24da2f
...@@ -2,10 +2,10 @@ export default { ...@@ -2,10 +2,10 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.20.17:8020" Vue.prototype.host2 = "http://192.168.20.17:8020"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" // Vue.prototype.host2 = "https://erpmallapi.oytour.com"
//Vue.prototype.host3 = "http://192.168.20.24" Vue.prototype.host3 = "http://192.168.20.17:8015"
Vue.prototype.host3 = "https://reborn.oytour.com" // Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function (param, success, failed) { Vue.prototype.request = function (param, success, failed) {
//网络请求 //网络请求
...@@ -114,6 +114,44 @@ export default { ...@@ -114,6 +114,44 @@ export default {
} }
}) })
}, },
Vue.prototype.apipostDownload = function (cmd, msg, success, failed) {
var postData = this.GetPostData(cmd, msg, "");
uni.request({
url: this.host3 + '/api/file/' + cmd,
method: "Post",
header: {
'Content-Type': 'application/json'
//'Referer-Viitto': this.$route.path
},
data: postData,
success: res => {
if (res.data.resultCode == 10000) {
let u = uni.getStorageSync("mall_UserInfo");
if (u) {
this.getLogin_t(u)
typeof failed == "function" && failed(res.data);
}
} else if (res.data.resultCode != 1) {
if (res.data.message != '') {
uni.showToast({
title: res.data.message,
icon: "none",
});
}
typeof failed == "function" && failed(res.data);
} else {
typeof success == "function" && success(res.data);
}
},
fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e));
uni.showModal({
content: "" + res.errMsg
});
typeof failed == "function" && failed(res.data);
}
})
},
//获取请求参数 //获取请求参数
Vue.prototype.GetPostData = function (cmd, msg) { Vue.prototype.GetPostData = function (cmd, msg) {
...@@ -136,7 +174,7 @@ export default { ...@@ -136,7 +174,7 @@ export default {
cmd: cmd, cmd: cmd,
MallBaseId: MallBaseId, MallBaseId: MallBaseId,
TenantId: TenantId, TenantId: TenantId,
version: '' version: 'MiniProgram'
} }
return postData return postData
}, },
...@@ -144,6 +182,7 @@ export default { ...@@ -144,6 +182,7 @@ export default {
// token失效再次登录接口 // token失效再次登录接口
Vue.prototype.getLogin_t = function (obj) { Vue.prototype.getLogin_t = function (obj) {
console.log('apijs', obj)
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0; let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0;
...@@ -153,7 +192,7 @@ export default { ...@@ -153,7 +192,7 @@ export default {
this.request2({ this.request2({
url: '/api/AppletLogin/Login', url: '/api/AppletLogin/Login',
data: { data: {
Source: 1, Source: obj.Source,
OpenId: obj.OpenId, OpenId: obj.OpenId,
Name: obj.Name, Name: obj.Name,
Photo: obj.Photo, Photo: obj.Photo,
......
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