Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-dj-oss-equity
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 3bf269ed
authored
Jul 16, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
c5f9904d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
80 deletions
package-lock.json
package.json
src/api/request.js
src/api/sign.js
src/base.js
package-lock.json
View file @
3bf269e
...
...
@@ -5469,9 +5469,9 @@
}
},
"glsx-vue-common"
:
{
"version"
:
"1.2.
8
"
,
"resolved"
:
"https://registry.npm
.taobao.org/glsx-vue-common/download/glsx-vue-common-1.2.8
.tgz"
,
"integrity"
:
"sha
1-tEcsGvWHZSKlYwqPAhhT8RroMbw
="
,
"version"
:
"1.2.
9
"
,
"resolved"
:
"https://registry.npm
js.org/glsx-vue-common/-/glsx-vue-common-1.2.9
.tgz"
,
"integrity"
:
"sha
512-oG7tbd5ex0xmcmrBzmYYrRj8aXjFpfBl2/etUqzwHhuSswNl7hAxuhmJxF1JhnOoOcOjgq/HqIFYtnv3eGt1jw=
="
,
"requires"
:
{
"vue"
:
"^2.5.10"
}
...
...
package.json
View file @
3bf269e
...
...
@@ -11,7 +11,7 @@
"axios"
:
"^0.18.0"
,
"element-ui"
:
"^2.15.1"
,
"file-saver"
:
"^2.0.5"
,
"glsx-vue-common"
:
"^1.2.
8
"
,
"glsx-vue-common"
:
"^1.2.
9
"
,
"glsx-vue-components"
:
"^1.0.13"
,
"sha1"
:
"^1.1.1"
,
"vee-validate"
:
"^2.1.7"
,
...
...
src/api/request.js
View file @
3bf269e
// /*
// * @Author: limin
// * @Date: 2019-08-26 18:02:41
// * @Last Modified by: chenwq
// * @Last Modified time: 2020-12-22 11:54:03
// */
// // import sign from './sign'
// import RequestMethods from './request.methods'
// // import util from '@/libs/util.js'
// const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
// // params.source = 'glsx'
// // params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637'
// // params.timestamp = new Date().getTime()
// // params.v = '1.0.0'
// // params.format = 'json'
// // params.locale = 'zh_CN'
// // if (params.method !== 'dj.api.user.login') {
// // params.sessionId = util.cookies.get('token')
// // }
// /**
// * mock - url = params.method
// * 调后端接口 - url = ''
// */
// const url = baseConfig.axios.baseURL + params.method
// /**
// * 调后端接口,请使用以下代码。
// */
// var reqData = (method === RequestMethods.POST) ? {
// // baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// // baseURL: process.env.VUE_APP_API,
// // data: sign(params, noSignAttr)
// data: params
// } : {
// // params: sign(params, noSignAttr)
// params: params
// }
// return axios({
// url,
// method,
// ...reqData
// })
// /**
// * mock,请使用以下代码。
// */
// // return axios({
// // url,
// // method,
// // params: sign(params, noSignAttr)
// // })
// }
// export default request
import
axios
from
'./axios'
// import axios from './axios'
import
sign
from
'./sign'
import
RequestMethods
from
'./request.methods'
import
{
GlAxios
}
from
'glsx-vue-common'
let
config
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'GLSX_OSS_EQUITY_CONFIG'
))
const
request
=
(
params
=
{},
url
,
method
=
RequestMethods
.
POST
,
noSignAttr
=
[])
=>
{
params
.
method
=
url
.
trimStart
().
trimEnd
()
//
params.source = 'glsx'
params
.
appKey
=
config
.
axios
.
sys
.
appKey
//
this.$get_session_common_config().axios.sys.appKey
params
.
appKey
=
'48e5e13229b82c1b4e6e8c96151f0637'
// params.timestamp = new Date().getTime()
// params.timestamp = new Date().format('yyyy-MM-dd hh:mm:ss')
params
.
v
=
'1.0.0'
params
.
format
=
'json'
params
.
locale
=
'zh_CN'
// let data = sign(params, noSignAttr)
// console.log(GlAxios.post('', data))
// return GlAxios.post('', data)
if
(
method
==
'post'
)
{
return
axios
({
method
,
data
:
sign
(
params
,
noSignAttr
)
})
}
else
{
return
axios
({
method
,
params
:
sign
(
params
,
noSignAttr
)
})
}
let
data
=
sign
(
params
,
noSignAttr
)
return
GlAxios
.
post
(
'router'
,
data
)
}
export
default
request
\ No newline at end of file
src/api/sign.js
View file @
3bf269e
import
sha1
from
'sha1'
import
qs
from
'qs'
let
config
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'GLSX_OSS_EQUITY_CONFIG'
))
const
{
secret
}
=
config
.
axios
.
sys
const
secret
=
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const
sign
=
(
params
,
noSignAttr
=
[])
=>
{
delete
params
.
sign
var
objStr
=
qs
.
stringify
(
params
,
{
arrayFormat
:
'indices'
,
encode
:
false
,
allowDots
:
true
})
...
...
src/base.js
View file @
3bf269e
...
...
@@ -60,7 +60,7 @@ var mixin = {
}
const
URL
=
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/oss_
rightsAndInterests
'
)
=>
{
const
getConfig
=
(
url
=
URL
+
'/oss_
dj_equity_config
'
)
=>
{
return
new
Promise
(
resolve
=>
{
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
...
...
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