ApiPost 若依安全认证

  • CaptchaController(com.ruoyi.web.controller.common)中打上断点,用于获取验证码code,uuid的值

    也可以直接在代码中通过打印输出

  • 调用接口获取uuid:http://localhost/dev-api/captchaImage (/dev-api启动前端时)

    1
    2
    3
    4
    5
    6
    7
    {
    "msg": "操作成功",
    "img": "xxxxx",
    "code": 200,
    "captchaEnabled": true,
    "uuid": "1d0cb05ed96544c895c74203df6da216"
    }
  • 输入用户名密码,登陆参数

    调用接口获取 Token:http://localhost/dev-api/login

    1
    2
    3
    4
    5
    6
    {
    "username":"admin",
    "password":"admin123",
    "code":"4", // 验证码code
    "uuid":"1d0cb05ed96544c895c74203df6da216"
    }
  • 设置 Token 认证,测试接口