上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 1.项目相关 新项目 开发时,可能遇到使用其他的版本。 虚拟环境 老项目 打开项目 虚拟环境 1.1 关于新项目 1.系统解释器+命令行【学习】 C:/python38 - python.exe - Scripts - pip.exe - pip3.8.exe - django-admin.exe 阅读全文
posted @ 2024-09-09 17:05 Sherwin_szw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: # day22 并发编程(上) **网络编程**,了解网络相关的**知识点**并且要知道几乎所有网络的通信本质上都是通过socket模块实现。例如:网站、网络爬虫。 **并发编程**,提升代码执行的效率。原来代码执行需要20分钟,学习并发编程后可以加快到1分钟执行完毕。 今日课程目标:初步了解进程和 阅读全文
posted @ 2023-05-23 13:09 Sherwin_szw 阅读(10) 评论(0) 推荐(0) 编辑
摘要: settings.py # url显示的路径 STATIC_URL = '/static/' # 查找静态文件的路径,在根目录创建static文件夹 STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] # 静态收集的路径 STATIC_R 阅读全文
posted @ 2023-05-15 17:10 Sherwin_szw 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 路由系统 本质上:URL和函数的对应关系。 传统的路由 from django.contrib import admin from django.urls import path from apps.web import views urlpatterns = [ path('home/', vie 阅读全文
posted @ 2023-05-15 15:14 Sherwin_szw 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 引用处 <template> <!-- 利用obj传递参数--> <Dialog :obj="data.permissionDialog" ref="permissionDialog"/> </template> <script setup> import Dialog from "@/compon 阅读全文
posted @ 2023-05-01 17:34 Sherwin_szw 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 用户\权限\菜单关系 前端逻辑与实现 vuex内 import {createStore} from 'vuex' export default createStore({ state: { token: localStorage.getItem('username') || '', routers 阅读全文
posted @ 2023-04-09 18:32 Sherwin_szw 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 基于角色+权限配置模式 可以将权限粒度设置的更细致一些。 具体参考 前端:登录成功后,再获取权限列表,在页面上进行权限判断。 后端:不变 登录 当用户登录时,将用户角色写入到vuex,保存当前用户角色信息。 vuex中 import {createStore} from 'vuex' export 阅读全文
posted @ 2023-04-09 16:30 Sherwin_szw 阅读(27) 评论(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 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 绝大多数,用户角色和功能固定时,推荐在这种方式。 开发简单,工作量少,可以快速交付。 1 前端 1. 登录 当用户登录时,将用户角色写入到vuex,保存当前用户角色信息。 # store/index.js import {createStore} from 'vuex' export default 阅读全文
posted @ 2023-04-08 18:09 Sherwin_szw 阅读(12) 评论(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 阅读(171) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页