Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
03ae6b51
Commit
03ae6b51
authored
Oct 12, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
db24da2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
6 deletions
+45
-6
api.js
plugin/api.js
+45
-6
No files found.
plugin/api.js
View file @
03ae6b51
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment