Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-common
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 c1162586
authored
Mar 23, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v2.8.0
1 parent
b18deae5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletions
dist/glsx-common.js
package.json
src/util.js
dist/glsx-common.js
View file @
c116258
This diff is collapsed.
Click to expand it.
package.json
View file @
c116258
{
{
"name"
:
"glsx-common"
,
"name"
:
"glsx-common"
,
"version"
:
"2.0.
5
"
,
"version"
:
"2.0.
8
"
,
"description"
:
"glsx common"
,
"description"
:
"glsx common"
,
"main"
:
"./dist/glsx-common.js"
,
"main"
:
"./dist/glsx-common.js"
,
"private"
:
false
,
"private"
:
false
,
...
...
src/util.js
View file @
c116258
import
md5
from
'md5'
import
md5
from
'md5'
import
sha1
from
'sha1'
import
sha1
from
'sha1'
import
qs
from
'qs'
import
qs
from
'qs'
import
Http
from
'./http'
export
const
Util
=
{
export
const
Util
=
{
/**
/**
* 校验手机号码格式
* 校验手机号码格式
...
@@ -184,6 +185,29 @@ export const Util = {
...
@@ -184,6 +185,29 @@ export const Util = {
}
}
}
}
return
formData
return
formData
},
getConfig
({
moduleName
,
mockUrl
,
env
=
''
,
httpOptions
=
{}
})
{
if
(
!
mockUrl
)
{
throw
new
Error
(
'mockUrl应为必填'
)
}
let
url
=
''
if
(
env
==
'test'
)
{
url
=
'http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl='
}
else
{
url
=
'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl='
}
const
http
=
new
Http
(
httpOptions
)
return
http
.
get
(
`
${
url
}${
moduleName
}
`
)
.
then
(
res
=>
{
if
(
res
.
code
==
'-1'
)
{
throw
new
Error
()
}
return
res
.
data
?
res
.
data
:
res
})
.
catch
(
err
=>
{
return
http
.
get
(
mockUrl
)
})
}
}
}
}
export
const
createSign
=
Util
.
createSign
export
const
createSign
=
Util
.
createSign
...
...
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