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 e979cff7
authored
Nov 07, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提取配置信息到easy mock
1 parent
8fe5851c
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
47 additions
and
36 deletions
package.json
src/api/departApi.js
src/api/menuApi.js
src/api/roleApi.js
src/api/userApi.js
src/base.js
src/config/common.conf.js
src/config/index.js
src/views/customer/department/app.js
src/views/customer/menu/app.js
src/views/customer/role/app.js
src/views/customer/user/app.js
package.json
View file @
e979cff
...
@@ -8,9 +8,8 @@
...
@@ -8,9 +8,8 @@
"lint"
:
"vue-cli-service lint"
"lint"
:
"vue-cli-service lint"
},
},
"dependencies"
:
{
"dependencies"
:
{
"glsx-vue-common"
:
"^1.1.1
4
"
,
"glsx-vue-common"
:
"^1.1.1
5
"
,
"glsx-vue-components"
:
"^1.0.12"
,
"glsx-vue-components"
:
"^1.0.12"
,
"lodash"
:
"^4.17.10"
,
"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/api/departApi.js
View file @
e979cff
...
@@ -2,7 +2,7 @@ import {
...
@@ -2,7 +2,7 @@ import {
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'department'
const
path
=
'
/admin-operating-auth/
department'
const
__sDel
=
`
${
path
}
/del`
const
__sDel
=
`
${
path
}
/del`
const
__sFindTree
=
`
${
path
}
/findTree`
const
__sFindTree
=
`
${
path
}
/findTree`
const
__sGetPName
=
`
${
path
}
/getPName`
const
__sGetPName
=
`
${
path
}
/getPName`
...
...
src/api/menuApi.js
View file @
e979cff
...
@@ -2,7 +2,7 @@ import {
...
@@ -2,7 +2,7 @@ import {
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'menu'
const
path
=
'
/admin-operating-auth/
menu'
const
__sAdd
=
`
${
path
}
/add`
const
__sAdd
=
`
${
path
}
/add`
const
__sDel
=
`
${
path
}
/del`
const
__sDel
=
`
${
path
}
/del`
const
__sEdit
=
`
${
path
}
/edit`
const
__sEdit
=
`
${
path
}
/edit`
...
...
src/api/roleApi.js
View file @
e979cff
import
{
import
{
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'role'
const
path
=
'
/admin-operating-auth/
role'
const
__sDeleteRole
=
`
${
path
}
/deleteRoleById`
const
__sDeleteRole
=
`
${
path
}
/deleteRoleById`
const
__sDeleteUserRole
=
`
${
path
}
/deleteUserRoleById`
const
__sDeleteUserRole
=
`
${
path
}
/deleteUserRoleById`
const
__sGetRoleDetail
=
`
${
path
}
/getRoleDetail`
const
__sGetRoleDetail
=
`
${
path
}
/getRoleDetail`
...
...
src/api/userApi.js
View file @
e979cff
import
{
import
{
GlAxios
GlAxios
}
from
'glsx-vue-common'
}
from
'glsx-vue-common'
const
path
=
'user'
const
path
=
'
/admin-operating-auth/
user'
const
__sBatcheDel
=
`
${
path
}
/batcheDel`
const
__sBatcheDel
=
`
${
path
}
/batcheDel`
const
__sFindAll
=
`
${
path
}
/findAll`
const
__sFindAll
=
`
${
path
}
/findAll`
const
__sGet
=
`
${
path
}
/get`
const
__sGet
=
`
${
path
}
/get`
...
...
src/base.js
View file @
e979cff
...
@@ -3,19 +3,17 @@
...
@@ -3,19 +3,17 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
GlsxVueComponents
from
'glsx-vue-components'
import
GlsxVueComponents
from
'glsx-vue-components'
import
'glsx-vue-components/dist/glsx-vue-components.css'
import
'glsx-vue-components/dist/glsx-vue-components.css'
import
GlsxVueCommon
from
'glsx-vue-common'
// import { common } from '@/config'
import
{
common
}
from
'@/config'
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
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'
// import _ from 'lodash'
import
{
Tree
}
from
'@/components'
import
{
Tree
}
from
'@/components'
Vue
.
use
(
GlsxVueComponents
)
Vue
.
use
(
GlsxVueComponents
)
Vue
.
component
(
'tree'
,
Tree
)
Vue
.
component
(
'tree'
,
Tree
)
Vue
.
use
(
GlsxVueCommon
,
common
)
const
config
=
{
const
config
=
{
errorBagName
:
'errorBags'
,
errorBagName
:
'errorBags'
,
fieldsBagName
:
'fieldBags'
fieldsBagName
:
'fieldBags'
...
@@ -46,7 +44,19 @@ var mixin = {
...
@@ -46,7 +44,19 @@ var mixin = {
})
})
}
}
}
}
const
URL
=
' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/authority_common'
)
=>
{
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
()
})
}
/* eslint-disable no-new */
/* eslint-disable no-new */
const
render
=
App
=>
{
const
render
=
App
=>
{
new
Vue
({
new
Vue
({
...
@@ -55,4 +65,5 @@ const render = App => {
...
@@ -55,4 +65,5 @@ const render = App => {
render
:
h
=>
h
(
App
)
render
:
h
=>
h
(
App
)
})
})
}
}
export
default
{
render
}
export
default
{
render
,
getConfig
}
src/config/common.conf.js
deleted
100644 → 0
View file @
8fe5851
export
default
{
axios
:
{
baseURL
:
'http://cas.dev.glsx.net/admin-operating-auth/'
,
// baseURL: 'http://192.168.3.171:7300/mock/5b91805391b67469b43e2921/subsystem/',
whiteList
:
[
'role/deleteRoleById'
,
'role/deleteUserRoleById'
,
'role/getRoleDetail'
,
'role/getRoleDetail'
,
'role/getRoleList'
,
'role/isRoleNameExit'
,
'role/saveRoleList'
,
'role/selectMenuTreeRoleId'
,
'role/selectUserRoleByRoleId'
,
'role/updateRole'
,
'user/batcheDel'
,
'user/findAll'
,
'user/get'
,
'user/getWithRoles'
,
'user/existsByName'
,
'user/operatUser'
,
'user/updateUser'
,
'department/del'
,
'department/findTree'
,
'department/getPName'
,
'department/getTreeNode'
,
'department/updateDepartment'
,
'menu/add'
,
'menu/del'
,
'menu/edit'
,
'menu/findById'
,
'menu/findTree'
,
'menu/getByUserId'
,
'menu/getPName'
],
timeout
:
15000
,
result
:
{
data_key
:
'data'
,
// 返回值数据实体存放对象
message_key
:
'message'
,
// 返回信息字段名
code_key
:
'returnCode'
,
// 返回结果字段名
code_success_value
:
'0'
,
// 返回成功值 注意类型 (字符串与数字)
code_message_map
:
{
// 错误码 错误信息 映射表
}
}
}
}
src/config/index.js
deleted
100644 → 0
View file @
8fe5851
import
common
from
'./common.conf'
export
{
common
}
src/views/customer/department/app.js
View file @
e979cff
import
App
from
'./index.vue'
import
App
from
'./index.vue'
import
base
from
'@/base'
import
base
from
'@/base'
base
.
render
(
App
)
import
GlsxVueCommon
from
'glsx-vue-common'
base
.
getConfig
().
then
(
data
=>
{
const
{
vue
,
config
}
=
data
vue
.
use
(
GlsxVueCommon
,
config
)
base
.
render
(
App
)
})
src/views/customer/menu/app.js
View file @
e979cff
import
App
from
'./index.vue'
import
App
from
'./index.vue'
import
base
from
'@/base'
import
base
from
'@/base'
base
.
render
(
App
)
import
GlsxVueCommon
from
'glsx-vue-common'
base
.
getConfig
().
then
(
data
=>
{
const
{
vue
,
config
}
=
data
vue
.
use
(
GlsxVueCommon
,
config
)
base
.
render
(
App
)
})
src/views/customer/role/app.js
View file @
e979cff
import
App
from
'./index.vue'
import
App
from
'./index.vue'
import
base
from
'@/base'
import
base
from
'@/base'
base
.
render
(
App
)
import
GlsxVueCommon
from
'glsx-vue-common'
base
.
getConfig
().
then
(
data
=>
{
const
{
vue
,
config
}
=
data
vue
.
use
(
GlsxVueCommon
,
config
)
base
.
render
(
App
)
})
src/views/customer/user/app.js
View file @
e979cff
import
App
from
'./index.vue'
import
App
from
'./index.vue'
import
base
from
'@/base'
import
base
from
'@/base'
base
.
render
(
App
)
import
GlsxVueCommon
from
'glsx-vue-common'
base
.
getConfig
().
then
(
data
=>
{
const
{
vue
,
config
}
=
data
vue
.
use
(
GlsxVueCommon
,
config
)
base
.
render
(
App
)
})
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