上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页
摘要: 呈现效果: 第一步:引入vue与bootstrap的CDN <script src="./js/vue.js"></script> <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4 阅读全文
posted @ 2024-01-09 15:51 wellplayed 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 呈现效果: 第一步:定义一个id为app的div <div id="app"> <h1>过滤案例</h1> // 绑定input事件、记录用户输入数据search <input type="text" v-model="search" @input="handleSearch"> <ul> // 循 阅读全文
posted @ 2024-01-08 18:55 wellplayed 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 视图函数内书写如下代码: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.request_action = None def initialize_request(self, request, * 阅读全文
posted @ 2024-01-04 21:11 wellplayed 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 自定义表签发token 不通过auth_user表,而是通过自定义表实现签发token 代码如下: 表模型: class UserInfo(models.Model): username = models.CharField(max_length=32) password = models.Char 阅读全文
posted @ 2024-01-04 16:35 wellplayed 阅读(20) 评论(0) 推荐(0) 编辑
摘要: restful规范(10条) 1 数据的安全保障:url链接一般都采用https协议进行传输 -https是:http+ssl 安全的超文本传输协议 2 接口特征表现:在API地址中带接口标识,咱们一般放在地址栏中(放在域名中) https://api.baidu.com https://www.b 阅读全文
posted @ 2024-01-04 09:23 wellplayed 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 需求如下: 用户输入:用户名或手机号或邮箱 +密码都能登录,并签发token 代码书写: model层配置(需要扩写auth_user表): from django.contrib.auth.models import AbstractUser class User(AbstractUser): m 阅读全文
posted @ 2024-01-03 21:12 wellplayed 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 定制返回格式 目标如下: 想要返回如下格式数据: { code:100, msg:'登录成功', username:'登录用户名字', access:asdfasdf.asdfasdf.asdfasdf refresh:asdfas.ere.we } 第一步:新建一个序列化类文件,以serializ 阅读全文
posted @ 2024-01-03 20:42 wellplayed 阅读(18) 评论(0) 推荐(0) 编辑
摘要: jwt的使用步骤 第一步:安装模块 pip install djangorestframework-simplejwt 第二步:注册app # settings文件配置 INSTALLED_APPS = [ ... 'rest_framework_simplejwt', ... ] 第三步:sett 阅读全文
posted @ 2024-01-03 20:35 wellplayed 阅读(9) 评论(1) 推荐(1) 编辑
摘要: access:真正使用的token refresh:用来更新access access过期时间很短,过期后,需要使用refresh重新生成access的token以保证token的安全 阅读全文
posted @ 2024-01-03 20:33 wellplayed 阅读(12) 评论(0) 推荐(0) 编辑
摘要: base64介绍 base64是编码解码方式,而不是加密方式 使用方法 首先需要导入base64模块 import base64 base64编码: 只能转换bytes格式数据 base64.b64encode(转换数据.encode('utf-8')) base64解码: base64编码可能需要 阅读全文
posted @ 2024-01-03 20:04 wellplayed 阅读(147) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页