Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-configuration
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 95f052bc
authored
Jul 18, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
appkey
1 parent
8176f0f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
src/api/request.js
src/api/request.js
View file @
95f052b
...
@@ -3,12 +3,15 @@ import axios from 'axios'
...
@@ -3,12 +3,15 @@ import axios from 'axios'
import
qs
from
'qs'
import
qs
from
'qs'
// import GlsxVueCommon from 'glsx-vue-common'
// import GlsxVueCommon from 'glsx-vue-common'
import
sign
from
'./sign'
import
sign
from
'./sign'
import
{
import
{
GlAxios
}
from
'glsx-vue-common'
GlAxios
const
request
=
(
}
from
'glsx-vue-common'
params
=
{},
const
request
=
(
params
=
{},
method
=
RequestMethods
.
GET
,
noSignAttr
=
[],
url
=
''
)
=>
{
method
=
RequestMethods
.
GET
,
noSignAttr
=
[],
url
=
''
)
=>
{
params
.
source
=
'glsx-oss-merchant-data'
params
.
source
=
'glsx-oss-merchant-data'
params
.
appKey
=
'
48e5e13229b82c1b4e6e8c96151f0637
'
params
.
appKey
=
'
d7ffc3346fc9a45bccaaa35300d59022
'
params
.
timestamp
=
new
Date
().
getTime
()
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
'1.0.0'
params
.
v
=
'1.0.0'
params
.
format
=
'json'
params
.
format
=
'json'
...
@@ -17,8 +20,10 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], url
...
@@ -17,8 +20,10 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], url
if
(
url
)
{
if
(
url
)
{
return
axios
.
post
(
`
${
url
}
/router?method=
${
method
}
`
,
qs
.
stringify
(
data
))
return
axios
.
post
(
`
${
url
}
/router?method=
${
method
}
`
,
qs
.
stringify
(
data
))
}
}
return
method
===
RequestMethods
.
GET
?
GlAxios
.
get
(
'router'
,
{
return
method
===
RequestMethods
.
GET
params
:
sign
(
params
,
noSignAttr
)
?
GlAxios
.
get
(
'router'
,
{
})
:
GlAxios
.
post
(
'router'
,
data
)
params
:
sign
(
params
,
noSignAttr
),
})
:
GlAxios
.
post
(
'router'
,
data
)
}
}
export
default
request
export
default
request
Write
Preview
Markdown
is supported
Attach a file
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 post a comment