Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 91b844a0
authored
Nov 01, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V4.45' into 'master'
上线合并 See merge request !1
2 parents
80bf9c29
f37b538e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
package.json
src/base.js
package.json
View file @
91b844a
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
"dependencies"
:
{
"dependencies"
:
{
"glsx-vue-common"
:
"^1.1.20"
,
"glsx-vue-common"
:
"^1.1.20"
,
"glsx-vue-components"
:
"^1.0.15"
,
"glsx-vue-components"
:
"^1.0.15"
,
"glsx-common"
:
"^2.10.1"
,
"node-sass"
:
"^4.9.3"
,
"node-sass"
:
"^4.9.3"
,
"sass-loader"
:
"^7.1.0"
,
"sass-loader"
:
"^7.1.0"
,
"vee-validate"
:
"^2.1.0-beta.11"
,
"vee-validate"
:
"^2.1.0-beta.11"
,
...
...
src/base.js
View file @
91b844a
...
@@ -7,6 +7,7 @@ import 'glsx-vue-components/dist/glsx-vue-components.css'
...
@@ -7,6 +7,7 @@ import 'glsx-vue-components/dist/glsx-vue-components.css'
import
'./styles/role-user-common.scss'
import
'./styles/role-user-common.scss'
import
'./styles/index.scss'
import
'./styles/index.scss'
import
'./date.js'
import
'./date.js'
import
{
utils
}
from
'glsx-common'
import
zh_CN
from
'vee-validate/dist/locale/zh_CN'
import
zh_CN
from
'vee-validate/dist/locale/zh_CN'
import
VeeValidate
,
{
Validator
}
from
'vee-validate'
import
VeeValidate
,
{
Validator
}
from
'vee-validate'
// import VeeValidate from 'vee-validate'
// import VeeValidate from 'vee-validate'
...
@@ -17,7 +18,7 @@ Vue.component('tree', Tree)
...
@@ -17,7 +18,7 @@ Vue.component('tree', Tree)
const
config
=
{
const
config
=
{
errorBagName
:
'errorBags'
,
errorBagName
:
'errorBags'
,
fieldsBagName
:
'fieldBags'
fieldsBagName
:
'fieldBags'
,
}
}
Vue
.
use
(
VeeValidate
,
config
)
Vue
.
use
(
VeeValidate
,
config
)
Validator
.
localize
(
'zh_CN'
,
zh_CN
)
Validator
.
localize
(
'zh_CN'
,
zh_CN
)
...
@@ -26,7 +27,7 @@ var mixin = {
...
@@ -26,7 +27,7 @@ var mixin = {
data
()
{
data
()
{
return
{
return
{
connection
:
null
,
connection
:
null
,
eventBus
:
null
eventBus
:
null
,
}
}
},
},
beforeMount
()
{
beforeMount
()
{
...
@@ -45,36 +46,52 @@ var mixin = {
...
@@ -45,36 +46,52 @@ var mixin = {
},
},
$$on
(
e
)
{
$$on
(
e
)
{
_this
.
eventBus
.
$emit
(
'event'
,
e
)
_this
.
eventBus
.
$emit
(
'event'
,
e
)
}
}
,
}
}
,
})
})
this
.
connection
.
promise
.
then
(
parent
=>
{
this
.
connection
.
promise
.
then
(
(
parent
)
=>
{
const
cfg
=
_this
.
$get_session_config
()
const
cfg
=
_this
.
$get_session_config
()
if
(
cfg
)
return
if
(
cfg
)
return
parent
.
getResources
().
then
(
config
=>
{
parent
.
getResources
().
then
(
(
config
)
=>
{
_this
.
$set_session_config
(
config
)
_this
.
$set_session_config
(
config
)
})
})
})
})
},
},
methods
:
{
methods
:
{
C2P
(
_event
)
{
C2P
(
_event
)
{
this
.
connection
.
promise
.
then
(
parent
=>
{
this
.
connection
.
promise
.
then
(
(
parent
)
=>
{
parent
.
$$emit
(
_event
)
parent
.
$$emit
(
_event
)
})
})
}
}
,
}
}
,
}
}
const
URL
=
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
// const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/authority_common'
)
=>
{
// const getConfig = (url = URL + '/authority_common') => {
return
new
Promise
(
resolve
=>
{
// return new Promise(resolve => {
const
xhr
=
new
XMLHttpRequest
()
// const xhr = new XMLHttpRequest()
xhr
.
onreadystatechange
=
()
=>
{
// xhr.onreadystatechange = () => {
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
// if (xhr.readyState === 4 && xhr.status === 200) {
resolve
({
'vue'
:
Vue
,
'config'
:
JSON
.
parse
(
xhr
.
responseText
)
})
// resolve({ 'vue': Vue, 'config': JSON.parse(xhr.responseText) })
}
// }
}
// }
xhr
.
open
(
'GET'
,
url
)
// xhr.open('GET', url)
xhr
.
send
()
// xhr.send()
// })
// }
const
getConfig
=
()
=>
{
let
params
=
{
moduleName
:
'glsx-oss-authority'
,
mockUrl
:
'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/authority_common'
,
httpOptions
:
{
Headers
:
{
refererurl
:
location
.
href
},
request
:
{
timeout
:
30000
},
},
}
return
new
Promise
((
resolve
,
reject
)
=>
{
utils
.
getConfig
(
params
).
then
((
res
)
=>
{
resolve
({
vue
:
Vue
,
config
:
res
})
})
})
})
}
}
/* eslint-disable no-new */
/* 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