Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-merchant-data
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 27e6038a
authored
Sep 25, 2024
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
前端配置服务变更
1 parent
f11b8875
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
package.json
src/base.js
package.json
View file @
27e6038
...
...
@@ -12,6 +12,7 @@
"glsx-vue-common"
:
"^1.2.4"
,
"glsx-vue-components"
:
"^1.0.13"
,
"js-md5"
:
"^0.7.3"
,
"glsx-common"
:
"^2.10.1"
,
"node-sass"
:
"^4.9.3"
,
"sass-loader"
:
"^7.1.0"
,
"vee-validate"
:
"^2.1.7"
,
...
...
src/base.js
View file @
27e6038
...
...
@@ -8,6 +8,7 @@ import './styles/common.scss'
// import axios from 'axios'
import
VeeValidate
from
'vee-validate'
import
'./date.js'
import
{
utils
}
from
'glsx-common'
Vue
.
use
(
GlsxVueComponents
)
Vue
.
use
(
VeeValidate
,
{
...
...
@@ -16,7 +17,7 @@ Vue.use(VeeValidate, {
dictionary
:
{
en
:
{
messages
:
{
required
:
(
field
)
=>
`
${
field
}
不能为空`
,
required
:
field
=>
`
${
field
}
不能为空`
,
between
:
(
field
,
data
)
=>
`
${
field
}
必须在
${
data
[
0
]}
~
${
data
[
1
]}
之间`
,
confirmed
:
(
field
,
data
)
=>
`
${
field
}
必须与
${
data
[
0
]}
相匹配`
,
max
:
(
field
,
data
)
=>
`
${
field
}
最大长度不能超过
${
data
[
0
]}
`
,
...
...
@@ -105,17 +106,33 @@ var mixin = {
// }
}
}
const
URL
=
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/business_data_config'
)
=>
{
return
new
Promise
(
resolve
=>
{
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
resolve
({
'vue'
:
Vue
,
'config'
:
JSON
.
parse
(
xhr
.
responseText
)
})
}
// const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
// const getConfig = (url = URL + '/business_data_config') => {
// return new Promise(resolve => {
// const xhr = new XMLHttpRequest()
// xhr.onreadystatechange = () => {
// if (xhr.readyState === 4 && xhr.status === 200) {
// resolve({ 'vue': Vue, 'config': JSON.parse(xhr.responseText) })
// }
// }
// xhr.open('GET', url)
// xhr.send()
// })
// }
const
getConfig
=
()
=>
{
let
params
=
{
moduleName
:
'glsx-oss-business-data'
,
mockUrl
:
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/business_data_config'
,
httpOptions
:
{
Headers
:
{
refererurl
:
location
.
href
},
request
:
{
timeout
:
30000
}
}
xhr
.
open
(
'GET'
,
url
)
xhr
.
send
()
}
return
new
Promise
((
resolve
,
reject
)
=>
{
utils
.
getConfig
(
params
).
then
(
res
=>
{
resolve
({
vue
:
Vue
,
config
:
res
})
})
})
}
/* eslint-disable no-new */
...
...
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