Commit 95f052bc by 前端

appkey

1 parent 8176f0f7
......@@ -3,12 +3,15 @@ import axios from 'axios'
import qs from 'qs'
// import GlsxVueCommon from 'glsx-vue-common'
import sign from './sign'
import {
GlAxios
} from 'glsx-vue-common'
const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], url = '') => {
import { GlAxios } from 'glsx-vue-common'
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
url = ''
) => {
params.source = 'glsx-oss-merchant-data'
params.appKey = '48e5e13229b82c1b4e6e8c96151f0637'
params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
......@@ -17,8 +20,10 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = [], url
if (url) {
return axios.post(`${url}/router?method=${method}`, qs.stringify(data))
}
return method === RequestMethods.GET ? GlAxios.get('router', {
params: sign(params, noSignAttr)
}) : GlAxios.post('router', data)
return method === RequestMethods.GET
? GlAxios.get('router', {
params: sign(params, noSignAttr),
})
: GlAxios.post('router', data)
}
export default request
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!