学习搭建后端脚手架。
bootshiro-学习
介绍
此脚手架的功能:前后端分离,后端接口开发。
- 支持RESTful风格。
- 用户-角色-接口功能。
- 用户登录日志、操作日志
- 封装后端返回结果,code,msg+data
使用的技术:
- springboot
- mybatis
- shiro 权限管理,用户-角色-接口
- jwt token,每次访问后端使用jwt做验证
- redis 存jwt
- jasypt 数据库密码密文配置在yum中
学习流程:
- down
- 等待下载jar包
- 启动
- postman测试
- 本地mysql导入usthe.sql
- 修改yum中的SQL配置和jasypt配置
- 启动
- postman测试,导入测试数据postman_test_example.json
注册
问题:bootshiro-register-no-encrpty http://localhost:8080/account/register 注册时ase秘钥为空
解决:
1
2bootshiro:
enableEncryptPassword: false注册为访客角色,在数据库改为了role_admin
登录
bootshiro-login http://localhost:8080/account/login
修改body中的”appId”: “tom33”,”password”: “1234”,
拿到jwt:eyJhbGciOiJIUzUx…
获取角色
bootshiro-jwt http://localhost:8080/user/role/tom33
修改jwt,修改restful风格tom33
结果:拿到角色role_admin
具体内容:
yum文件设置了开发、测试、生产三种环境
jasypt