0%

bootshiro-学习

学习搭建后端脚手架。

bootshiro-学习

介绍

此脚手架的功能:前后端分离,后端接口开发。

  • 支持RESTful风格。
  • 用户-角色-接口功能。
  • 用户登录日志、操作日志
  • 封装后端返回结果,code,msg+data

使用的技术:

  • springboot
  • mybatis
  • shiro 权限管理,用户-角色-接口
  • jwt token,每次访问后端使用jwt做验证
  • redis 存jwt
  • jasypt 数据库密码密文配置在yum中

学习流程:

  1. down
  2. 等待下载jar包
  3. 启动
  4. postman测试
  5. 本地mysql导入usthe.sql
  6. 修改yum中的SQL配置和jasypt配置
  7. 启动
  8. postman测试,导入测试数据postman_test_example.json
    1. 注册

      问题:bootshiro-register-no-encrpty http://localhost:8080/account/register 注册时ase秘钥为空

      解决:

      1
      2
      bootshiro:
      enableEncryptPassword: false

      注册为访客角色,在数据库改为了role_admin

    2. 登录

      bootshiro-login http://localhost:8080/account/login

      修改body中的”appId”: “tom33”,”password”: “1234”,

      拿到jwt:eyJhbGciOiJIUzUx…

    3. 获取角色

      bootshiro-jwt http://localhost:8080/user/role/tom33

      修改jwt,修改restful风格tom33

      结果:拿到角色role_admin

具体内容:

  • yum文件设置了开发、测试、生产三种环境

  • jasypt