新增角色

This commit is contained in:
jiutianzhiyu 2021-03-30 04:05:48 +08:00
parent 9aa1425cfe
commit f29085ce45
3 changed files with 14 additions and 4 deletions

View File

@ -47,3 +47,14 @@ export function getRoleDetail(id) {
url: `/sys/role/${id}`
})
}
/** *
* 新增角色
* ***/
export function addRole(data) {
return request({
url: '/sys/role',
data,
method: 'post'
})
}

View File

@ -19,7 +19,7 @@
</template>
<script>
import { updateRole, getRoleDetail } from '@/api/setting'
import { updateRole, getRoleDetail, addRole } from '@/api/setting'
export default {
components: {},
props: {
@ -65,8 +65,7 @@ export default {
await updateRole(this.roleForm)
} else {
//
// pid
// await addDepartments({ ...this.formData, pid: this.treeNode.id })
await addRole(this.roleForm)
}
//
this.$emit('editRoleOK')

View File

@ -11,6 +11,7 @@
icon="el-icon-plus"
size="small"
type="primary"
@click="showDialog = true"
>新增角色</el-button>
</el-row>
<!-- 表格 -->
@ -87,7 +88,6 @@ export default {
},
//
showDialog: false
}
},
computed: {