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 a6e6451e
authored
Sep 30, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
角色新增和编辑接口
1 parent
a06ceffb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
src/api/roleApi.js
src/views/customer/role/index.vue
src/api/roleApi.js
View file @
a6e6451
...
...
@@ -39,10 +39,7 @@ const getRoleList = {
const
saveRoleList
=
{
p
:
[
__sSaveRoleList
],
// req: params => GlAxios.get(__sSaveRoleList, params)
req
:
params
=>
GlAxios
.
post
(
__sSaveRoleList
,
params
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}})
// req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }})
// req: params => GlAxios.post(__sSaveRoleList, params)
req
:
params
=>
GlAxios
.
post
(
__sSaveRoleList
,
params
,
{
headers
:
{
'Content-Type'
:
'application/json; charset=utf-8'
}})
}
const
selectMenuTreeRoleId
=
{
...
...
@@ -57,7 +54,7 @@ const selectUserRoleByRoleId = {
const
updateRole
=
{
p
:
[
__sUpdateRole
],
req
:
params
=>
GlAxios
.
post
(
__sUpdateRole
,
params
)
req
:
params
=>
GlAxios
.
post
(
__sUpdateRole
,
params
,
{
headers
:
{
'Content-Type'
:
'application/json; charset=utf-8'
}}
)
}
export
{
...
...
src/views/customer/role/index.vue
View file @
a6e6451
...
...
@@ -176,15 +176,15 @@ export default {
// const cc = { roleName: 'ggg' }
// ----------------------
// delete params.roleName
delete
params
.
description
delete
params
.
departId
delete
params
.
departName
delete
params
.
departPath
delete
params
.
rights
delete
params
.
state
const
paramsJS
=
JSON
.
stringify
(
params
)
console
.
log
(
paramsJS
)
saveRoleList
.
req
(
params
JS
).
then
((
data
)
=>
{
//
delete params.description
//
delete params.departId
//
delete params.departName
//
delete params.departPath
//
delete params.rights
//
delete params.state
//
const paramsJS = JSON.stringify(params)
//
console.log(paramsJS)
saveRoleList
.
req
(
params
).
then
((
data
)
=>
{
console
.
log
(
data
)
this
.
createOrEditSuccess
()
}).
catch
(
err
=>
{
...
...
@@ -194,7 +194,9 @@ export default {
// 编辑角色
updateRoleInfo
(
params
)
{
console
.
log
(
params
)
this
.
createOrEditSuccess
()
delete
params
.
createTime
delete
params
.
updateTime
// this.createOrEditSuccess()
updateRole
.
req
(
params
).
then
((
data
)
=>
{
console
.
log
(
data
)
this
.
createOrEditSuccess
()
...
...
@@ -257,7 +259,7 @@ export default {
},
// 关闭新增用户组件
handleCreateClose
(
data
)
{
this
.
roleParam
=
this
.
$deep_clone
(
roleCreateStructure
)
//
this.roleParam = this.$deep_clone(roleCreateStructure)
if
(
!
data
)
{
this
.
createDialogVisible
()
this
.
message
(
this
.
flagCOrE
?
'取消创建角色'
:
'取消编辑角色'
,
'info'
)
...
...
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