|
|
@@ -125,6 +125,7 @@ import { togglePasswordVisibility } from '@core/mixins/ui/forms'
|
|
|
import store from '@/store/index'
|
|
|
import ToastificationContent from '@core/components/toastification/ToastificationContent.vue'
|
|
|
import useJwt from '@/auth/jwt/useJwt'
|
|
|
+import { getExistingAbility } from '../libs/acl/ability'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -187,36 +188,7 @@ export default {
|
|
|
.then(res => {
|
|
|
useJwt.setToken(res.data.token)
|
|
|
localStorage.setItem('userData', res.data.userData)
|
|
|
-
|
|
|
- // let existingAbility = []
|
|
|
- // if (res.data.userData.ability === 'manager') {
|
|
|
- // existingAbility = [
|
|
|
- // {
|
|
|
- // action: 'read',
|
|
|
- // subject: 'home',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // action: 'read',
|
|
|
- // subject: 'second-page',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // action: 'read',
|
|
|
- // subject: 'permission',
|
|
|
- // },
|
|
|
- // ]
|
|
|
- // } else {
|
|
|
- // existingAbility = [
|
|
|
- // {
|
|
|
- // action: 'read',
|
|
|
- // subject: 'home',
|
|
|
- // },
|
|
|
- // {
|
|
|
- // action: 'read',
|
|
|
- // subject: 'second-page',
|
|
|
- // },
|
|
|
- // ]
|
|
|
- // }
|
|
|
- // this.$ability.update(existingAbility)
|
|
|
+ this.$ability.update(getExistingAbility(JSON.parse(res.data.userData).ability))
|
|
|
|
|
|
if (this.$route.query.redirect) {
|
|
|
this.$router.push(this.$route.query.redirect)
|