如何解决如何基于安装的Vue中的角色来阻止触发请求-Laravel Vue API令牌认证用户
我有一个方法,当在我的已装载的Vue页面中加载时,会调用并返回经过身份验证的用户。
mounted() {
User.auth()
.then(response => {
this.user = response.data;
this.role = response.data.roles[0];
console.log(response.data);
})
.catch(error => (this.user = ""));
},
User.allUser().then(response => {
this.users = response.data;
console.log(response.data);
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。