# drf-react-jwt-auth **Repository Path**: yazutang/drf-react-jwt-auth ## Basic Information - **Project Name**: drf-react-jwt-auth - **Description**: 使用django rest framework和react实现JWT登录认证功能 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-01 - **Last Updated**: 2021-08-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用django rest framework和react实现JWT登录认证功能 ## 技术栈 - [Djsoer](https://djoser.readthedocs.io/en/latest/sample_usage.html) JSON Web Token登录认证 - [React](https://reactjs.org/) - [Material-UI](https://material-ui.com/) - [axios](https://github.com/axios/axios#creating-an-instance) ## 使用 ```bash git clone https://gitee.com/yazutang/drf-react-jwt-auth.git cd drf-react-jwt-auth pipenv install # 启动虚拟环境并安装依赖包 cd myproject python manage.py createsuperuser # 创建管理员账号 python manage.py runserver cd ../reactapp npm i # 安装react依赖包 npm start # 使用后端创建的管理员账号登录即可 ``` ## 后端接口 | 功能 | 入口URL | 请求方法 | 请求体字段 | | --- | ---------------- | ---- | ---------------- | | 登录 | /auth/jwt/create/ | POST | email, password | | 注册 | /auth/users/ | POST | username, email, password, re_password | | 重置密码 | /auth/users/reset_password/ | POST | email | | 确认重置密码 | /auth/users/reset_password_confirm/ | POST | new_password, re_new_password | | 更改密码 | /auth/users/set_password/ | POST | uid, token, current_password, new_password, re_new_password | | 个人中心页面 | /auth/users/me/ | GET | | | 用户激活 | /auth/users/activation/ | POST | uid, token | | 用户重新激活(注册后忘记激活)| /auth/users/resend_activation/ | POST | email | 详细请查看官方文档: [Djoser](https://djoser.readthedocs.io/en/latest/jwt_endpoints.html) [django-rest-framework-simplejwt](https://django-rest-framework-simplejwt.readthedocs.io/en/latest/) ## 页面效果图 ![](./display.png)