04 2023 档案

摘要:用户\权限\菜单关系 前端逻辑与实现 vuex内 import {createStore} from 'vuex' export default createStore({ state: { token: localStorage.getItem('username') || '', routers 阅读全文
posted @ 2023-04-09 18:32 Sherwin_szw 阅读(20) 评论(0) 推荐(0) 编辑
摘要:基于角色+权限配置模式 可以将权限粒度设置的更细致一些。 具体参考 前端:登录成功后,再获取权限列表,在页面上进行权限判断。 后端:不变 登录 当用户登录时,将用户角色写入到vuex,保存当前用户角色信息。 vuex中 import {createStore} from 'vuex' export 阅读全文
posted @ 2023-04-09 16:30 Sherwin_szw 阅读(33) 评论(0) 推荐(0) 编辑
摘要:directives/permission.js import store from "@/store"; export default { // el 是指令绑定的元素,bindings是入参 mounted(el, bindings) { let allowRoleList = bindings 阅读全文
posted @ 2023-04-09 10:28 Sherwin_szw 阅读(22) 评论(0) 推荐(0) 编辑
摘要:绝大多数,用户角色和功能固定时,推荐在这种方式。 开发简单,工作量少,可以快速交付。 1 前端 1. 登录 当用户登录时,将用户角色写入到vuex,保存当前用户角色信息。 # store/index.js import {createStore} from 'vuex' export default 阅读全文
posted @ 2023-04-08 18:09 Sherwin_szw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:auth auth组件在django中提供:admin登录、权限的配置等功能。 创建用户 命令 python manange.py createsuperuser 函数 from django.contrib import admin from django.urls import path fro 阅读全文
posted @ 2023-04-02 11:53 Sherwin_szw 阅读(173) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.