登录控制器

This commit is contained in:
橙子
2021-10-16 14:48:55 +08:00
parent 6a492168ed
commit b2e8441194
10 changed files with 275 additions and 51 deletions

View File

@@ -1,7 +1,7 @@
<template>
<v-row>
<v-col cols="12">
<v-card class="mx-auto" width="100%"><v-btn color="primary">确定分配</v-btn></v-card>
<v-card class="mx-auto" width="100%"><app-btn @click="setMenu">确定分配</app-btn></v-card>
</v-col>
<v-col cols="12" md="4" lg="4">
<v-card class="mx-auto" width="100%">
@@ -41,12 +41,28 @@
</template>
<script>
import roleApi from "../api/roleApi";
import menuApi from "../api/MenuApi";
import menuApi from "../api/menuApi";
export default {
created() {
this.init();
},
methods: {
setMenu(){
var roleIds=[];
var menuIds=[];
this.selectionRole.forEach((ele)=>{
roleIds.push(ele.id)
})
this.selectionMenu.forEach((ele)=>{
menuIds.push(ele.id)
})
roleApi.setMenuByRole(roleIds,menuIds).then(resp=>{
this.$dialog.notify.info(resp.msg, {
position: "top-right",
timeout: 5000,
});
})
},
init() {
roleApi.getRole().then((resp) => {
this.RoleItems = resp.data;