项目实战-RuoYi后台管理系统-登录功能Postman接口自动化脚本分享

这篇具有很好参考价值的文章主要介绍了项目实战-RuoYi后台管理系统-登录功能Postman接口自动化脚本分享。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

    先来回顾一下之前写过的关于RuoYi后台管理系统项目实战相关的几篇文章:

测试项目实战----RuoYi后台管理系统

项目实战-RuoYi后台管理系统-用户管理测试点设计

项目实战-RuoYi后台管理系统-登录相关接口分析

Docker搭建webdis用于提供api查询redis中的数据

项目实战-RuoYi后台管理系统-用Postman实现登录接口的自动化

项目实战-RuoYi后台管理系统-用Python基于图像识别技术处理登录页面的验证码

    由于经常看到大家苦于没有实战的项目用来练习,因此才找了这么个开源的项目搭建给大家练练手,在以前的文章中,我有教大家怎么去简单的分析用户管理模块的测试点设计,以及从获取验证码到登录的接口用例的设计。但是之前并没有直接提供完整的postman的脚本,因为考虑到很多小伙伴平常在群里白嫖资料惯了,没有养成一个良好的学习方式,我如果直接就将脚本给出来,看之前自己没有动手去实操过一遍的话,理解的没有这么深刻。

    最近,也看到不少小伙伴自己用postman实现了这些功能,并且有的还在jmeter上进行了实现,看到这里还是挺欣慰的,现在的话呢,将脚本直接分享出来,有需要的直接保存成json文件再导入到postman工具中去即可:

collection脚本内容如下:(包含前后置脚本)

{
  "info": {
    "_postman_id": "8a604670-781b-4f48-ac71-4c06abd13b17",
    "name": "ruoyi",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "1067488"
  },
  "item": [
    {
      "name": "获取验证码接口",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"操作成功\");\r",
              "    pm.expect(jsonData.code).to.eql(200);\r",
              "     \r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{apiurl}}/captchaImage",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "captchaImage"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-验证码失效的场景",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"验证码已失效\");\r",
              "    pm.expect(jsonData.code).to.eql(500);\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"1222\",\r\n    \"uuid\": \"096e79dad5ca44109cb9ac7421b5ef53\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-正常登录的场景(用真实验证码登录)",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "//清理环境变量\r",
              "pm.environment.unset(\"loginuuid\")\r",
              "pm.environment.unset(\"logincode\")\r",
              "\r",
              "// 开始断言\r",
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"操作成功\");\r",
              "    pm.expect(jsonData.code).to.eql(200);\r",
              "    pm.expect(jsonData.token).to.not.eql(null)\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        },
        {
          "listen": "prerequest",
          "script": {
            "exec": [
              "// 调接口获取验证码\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "\r",
              "pm.sendRequest(apiurl + \"/captchaImage\", function (err, response) {\r",
              "    var loginuuid = response.json().uuid\r",
              "    pm.environment.set(\"loginuuid\", loginuuid)\r",
              "    console.log(\"uuid:\", loginuuid);\r",
              "    // 拿到验证码生成的uuid,用于查redis中的验证码\r",
              "\r",
              "    // 调接口查redis中的验证码的值 (验证码存储的key格式:captcha_codes:63fb9e2dc58448df973efb97c62a20c1,后面这一截为uuid)\r",
              "\r",
              "    pm.sendRequest(\"http://8.129.162.225:7379/get/captcha_codes:\" + loginuuid, function (err, response) {\r",
              "        var logincode = response.json().get.match(/\"(\\S*)\"/)[1] \r",
              "        console.log(\"验证码:\",logincode);\r",
              "        pm.environment.set(\"logincode\", logincode)\r",
              "    });\r",
              "});\r",
              "\r",
              ""
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"{{logincode}}\",\r\n    \"uuid\": \"{{loginuuid}}\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-输入错误验证码登录",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "//清理环境变量\r",
              "pm.environment.unset(\"loginuuid\")\r",
              "\r",
              "// 开始断言\r",
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"验证码错误\");\r",
              "    pm.expect(jsonData.code).to.eql(500);\r",
              "     \r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        },
        {
          "listen": "prerequest",
          "script": {
            "exec": [
              "// 调接口获取验证码\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "\r",
              "pm.sendRequest(apiurl + \"/captchaImage\", function (err, response) {\r",
              "    var loginuuid = response.json().uuid\r",
              "    pm.environment.set(\"loginuuid\", loginuuid)\r",
              "    console.log(\"uuid:\", loginuuid);\r",
              "});\r",
              "\r",
              ""
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"错误验证码\",\r\n    \"uuid\": \"{{loginuuid}}\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-输错密码登录(用真实验证码登录)",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "//清理环境变量\r",
              "pm.environment.unset(\"loginuuid\")\r",
              "pm.environment.unset(\"logincode\")\r",
              "\r",
              "// 开始断言\r",
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"用户不存在/密码错误\");\r",
              "    pm.expect(jsonData.code).to.eql(500);\r",
              "    pm.expect(jsonData.token).to.not.eql(null)\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        },
        {
          "listen": "prerequest",
          "script": {
            "exec": [
              "// 调接口获取验证码\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "\r",
              "pm.sendRequest(apiurl + \"/captchaImage\", function (err, response) {\r",
              "    var loginuuid = response.json().uuid\r",
              "    pm.environment.set(\"loginuuid\", loginuuid)\r",
              "    console.log(\"uuid:\", loginuuid);\r",
              "    // 拿到验证码生成的uuid,用于查redis中的验证码\r",
              "\r",
              "    // 调接口查redis中的验证码的值 (验证码存储的key格式:captcha_codes:63fb9e2dc58448df973efb97c62a20c1,后面这一截为uuid)\r",
              "\r",
              "    pm.sendRequest(\"http://8.129.162.225:7379/get/captcha_codes:\" + loginuuid, function (err, response) {\r",
              "        var logincode = response.json().get.match(/\"(\\S*)\"/)[1] \r",
              "        console.log(\"验证码:\",logincode);\r",
              "        pm.environment.set(\"logincode\", logincode)\r",
              "    });\r",
              "});\r",
              "\r",
              ""
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"1234561111\",\r\n    \"code\": \"{{logincode}}\",\r\n    \"uuid\": \"{{loginuuid}}\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-输错用户名登录(用真实验证码登录)",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "//清理环境变量\r",
              "pm.environment.unset(\"loginuuid\")\r",
              "pm.environment.unset(\"logincode\")\r",
              "\r",
              "// 开始断言\r",
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"登录用户:yanshi111111 不存在\");\r",
              "    pm.expect(jsonData.code).to.eql(500);\r",
              "    pm.expect(jsonData.token).to.not.eql(null)\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        },
        {
          "listen": "prerequest",
          "script": {
            "exec": [
              "// 调接口获取验证码\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "\r",
              "pm.sendRequest(apiurl + \"/captchaImage\", function (err, response) {\r",
              "    var loginuuid = response.json().uuid\r",
              "    pm.environment.set(\"loginuuid\", loginuuid)\r",
              "    console.log(\"uuid:\", loginuuid);\r",
              "    // 拿到验证码生成的uuid,用于查redis中的验证码\r",
              "\r",
              "    // 调接口查redis中的验证码的值 (验证码存储的key格式:captcha_codes:63fb9e2dc58448df973efb97c62a20c1,后面这一截为uuid)\r",
              "\r",
              "    pm.sendRequest(\"http://8.129.162.225:7379/get/captcha_codes:\" + loginuuid, function (err, response) {\r",
              "        var logincode = response.json().get.match(/\"(\\S*)\"/)[1] \r",
              "        console.log(\"验证码:\",logincode);\r",
              "        pm.environment.set(\"logincode\", logincode)\r",
              "    });\r",
              "});\r",
              "\r",
              ""
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi111111\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"{{logincode}}\",\r\n    \"uuid\": \"{{loginuuid}}\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-用万能验证码登录",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"操作成功\");\r",
              "    pm.expect(jsonData.code).to.eql(200);\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"1234\",\r\n    \"uuid\": \"xxxxxxxxxxx\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "登录-正常登录后检查验证码是否失效",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "\r",
              "// 开始断言\r",
              "pm.test(\"断言返回结果\", function () {\r",
              "    var jsonData = pm.response.json();\r",
              "    pm.expect(jsonData.msg).to.eql(\"操作成功\");\r",
              "    pm.expect(jsonData.code).to.eql(200);\r",
              "    pm.expect(jsonData.token).to.not.eql(null)\r",
              "})\r",
              "\r",
              "pm.test(\"Status code is 200\", function () {\r",
              "    pm.response.to.have.status(200);\r",
              "});\r",
              "\r",
              "\r",
              "\r",
              "// 开始用相同的验证码再次登录\r",
              "//构造一个登录请求\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "var logincode = pm.environment.get(\"logincode\")\r",
              "var loginuuid = pm.environment.get(\"loginuuid\")\r",
              "\r",
              "//清理环境变量\r",
              "pm.environment.unset(\"loginuuid\")\r",
              "pm.environment.unset(\"logincode\")\r",
              "\r",
              "const loginRequest = {\r",
              "    url: apiurl + '/login',\r",
              "    method: \"POST\",\r",
              "    header: 'Content-Type: application/json',\r",
              "    body: {\r",
              "        mode: 'raw',\r",
              "        raw: JSON.stringify({\r",
              "            \"username\": \"yanshi\",\r",
              "            \"password\": \"123456\",\r",
              "             \"code\": logincode,\r",
              "            \"uuid\": loginuuid\r",
              "        })   \r",
              "    }\r",
              "};\r",
              "\r",
              "// 发送请求\r",
              "pm.sendRequest(loginRequest, function (err, res) {\r",
              "\r",
              "    pm.test(\"Status code is 200\", function () {\r",
              "\r",
              "        var jsonData = res.json();\r",
              "        pm.expect(jsonData.msg).to.eql(\"验证码已失效\");\r",
              "        pm.expect(jsonData.code).to.eql(500);\r",
              "    });\r",
              "});"
            ],
            "type": "text/javascript"
          }
        },
        {
          "listen": "prerequest",
          "script": {
            "exec": [
              "// 调接口获取验证码\r",
              "var apiurl = pm.environment.get(\"apiurl\")\r",
              "\r",
              "pm.sendRequest(apiurl + \"/captchaImage\", function (err, response) {\r",
              "    var loginuuid = response.json().uuid\r",
              "    pm.environment.set(\"loginuuid\", loginuuid)\r",
              "    console.log(\"uuid:\", loginuuid);\r",
              "    // 拿到验证码生成的uuid,用于查redis中的验证码\r",
              "\r",
              "    // 调接口查redis中的验证码的值 (验证码存储的key格式:captcha_codes:63fb9e2dc58448df973efb97c62a20c1,后面这一截为uuid)\r",
              "\r",
              "    pm.sendRequest(\"http://8.129.162.225:7379/get/captcha_codes:\" + loginuuid, function (err, response) {\r",
              "        var logincode = response.json().get.match(/\"(\\S*)\"/)[1] \r",
              "        console.log(\"验证码:\",logincode);\r",
              "        pm.environment.set(\"logincode\", logincode)\r",
              "    });\r",
              "});\r",
              "\r",
              ""
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Connection",
            "value": "keep-alive"
          },
          {
            "key": "Pragma",
            "value": "no-cache"
          },
          {
            "key": "Cache-Control",
            "value": "no-cache"
          },
          {
            "key": "Accept",
            "value": "application/json, text/plain, */*"
          },
          {
            "key": "isToken",
            "value": "false"
          },
          {
            "key": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"
          },
          {
            "key": "Content-Type",
            "value": "application/json;charset=UTF-8"
          },
          {
            "key": "Origin",
            "value": "http://8.129.162.225"
          },
          {
            "key": "Referer",
            "value": "http://8.129.162.225/"
          },
          {
            "key": "Accept-Language",
            "value": "zh,zh-CN;q=0.9,en;q=0.8"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"username\": \"yanshi\",\r\n    \"password\": \"123456\",\r\n    \"code\": \"{{logincode}}\",\r\n    \"uuid\": \"{{loginuuid}}\"\r\n}"
        },
        "url": {
          "raw": "{{apiurl}}/login",
          "host": [
            "{{apiurl}}"
          ],
          "path": [
            "login"
          ]
        }
      },
      "response": []
    }
  ]
}

环境变量的配置脚本:

{
  "id": "279be738-3e40-4de1-ba2d-f13563a601d5",
  "name": "ruoyi",
  "values": [
    {
      "key": "apiurl",
      "value": "http://8.129.162.225:8080",
      "type": "default",
      "enabled": true
    }
  ],
  "_postman_variable_scope": "environment",
  "_postman_exported_at": "2022-05-25T15:30:52.472Z",
  "_postman_exported_using": "Postman/9.19.3"
}

考虑到有的小伙伴复制脚本可能不知道怎么导入,或者懒得去复制,json文件我也上传到网盘了,有需要的在公众号回复关键字“若依项目实战”即可获取

如需进群和同行业大佬交流学习,请添加微信xiaobotester邀请加入。
文章来源地址https://www.toymoban.com/news/detail-419758.html

到了这里,关于项目实战-RuoYi后台管理系统-登录功能Postman接口自动化脚本分享的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ruoyi后台管理系统部署-2-安装mysql

    安装 首先查看系统是否安装了: 卸载自带的 mariadb: 去官网下载 mysql 安装包: 前往mysql官网下载rpm包,centos选择red hat:mysql下载地址 上传至服务器,解压 依次安装包: centos7 安装mysql 错误:libaio.so.1()(64bit) is needed by mysql-community-server-5.7.44-1.el7.x86_64: 需要安装: yum install liba

    2024年02月01日
    浏览(25)
  • 【项目实战】基于Vue3+TypeScript+Pinia的后台管理系统(coderwhy)

    是基于Vue3、Pinia、VueRouter、Vite、ElementPlus、TypeScript、Echarts等后台系统 https://documenter.getpostman.com/view/12387168/TzzDKb12 baseURL = ‘http://codercba.com:5000’ postman详细使用可以自己搜 也可以使用其他接口管理的工具 给项目添加 环境变量 baseURL https://gitee.com/yangyang993/vue3_ts_cms_admin.git 登录

    2024年02月07日
    浏览(66)
  • 黑马程序员课程Vue实战项目_Element-ui——电商后台管理系统-商品管理(商品列表)

    目录 商品列表 一.创建一个子分支 二.创建组件 三.绘制商品列表的页面基本结构 1.面包屑导航  2.卡片视图区域 四.功能 1.搜索  2.删除  3.添加 五.提交代码 git branch——查看当前所在分支 git checkout -b goods_list——创建新的子分支goods_list git branch——查看当前所在分支 git pus

    2024年02月08日
    浏览(54)
  • 若依管理系统RuoYi-Vue(前后端分离版)项目启动教程

    RuoYi-Vue  是一个 Java EE 企业级快速开发平台,基于经典技术组合(Spring Boot、Spring Security、MyBatis、Jwt、Vue),内置模块如:部门管理、角色用户、菜单及按钮授权、数据权限、系统参数、日志管理、代码生成等。在线定时任务配置;支持集群,支持多数据源,支持分布式事务

    2024年02月06日
    浏览(56)
  • vue项目-后台管理系统

    前言: 一个传唱度极高的前端项目,及其适合像博主这样的小白练手。特以此文章记录下项目基本的创作思路,并且文末附赠项目源码,思维导图及一些后台文件,有兴趣可自取。希望对朋友们有用。 结构: 一,登录页 二,主页面 1,用户管理 用户列表 2,权限管理 角色列

    2024年02月16日
    浏览(38)
  • 【开源项目】ELADMIN 后台管理系统

    一个基于 Spring Boot 2.1.0 、 Spring Boot Jpa、 JWT、Spring Security、Redis、Vue的前后端分离的后台管理系统 开发文档:  https://eladmin.vip 体验地址:  ELADMIN 账号密码:   admin / 123456 后端源码 前端源码 github GitHub - elunez/eladmin: 项目基于 Spring Boot 2.1.0 、 Jpa、 Spring Security、redis、Vue的前

    2024年02月07日
    浏览(64)
  • 基于VUE3+Layui从头搭建通用后台管理系统(前端篇)二:登录界面及对应功能实现

      本章介绍系统登录界面、登录流程、登录接口等相关内容的开发,实现包括账号密码登录、短信验证登录等不同的登录方式,使用svg-capter生成图形验证码,使用expressjwt实现登录token的生成及验证。 1. 详细课程地址: https://edu.csdn.net/course/detail/38183 2. 源码下载地址: 点击

    2024年02月11日
    浏览(64)
  • Java项目:微信小程序商城+后台管理系统

    作者主页:夜未央5788  简介:Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 本项目为小程序商城系统前后台,前台为普通会员用户登录,后台为管理员登录; 程序功能: 1.小程序前台:用户注册登录、首页、轮播图、新品推荐、分类、购物车、我的订单

    2024年02月10日
    浏览(44)
  • 超适合练手的一套JavaWeb项目 (超市后台管理系统)

    1.搭建一个maven web项目 2.配置Tomcat 3.测试项目是否能够跑起来 4.导入项目中遇到的jar包 5.创建项目结构 1.数据库配置文件 db.properties文件代码 2.编写数据库的公共类 java代码 3.编写字符编码过滤器 xml代码 java dao层接口代码 java dao接口的实现类代码 java service接口代码

    2024年02月05日
    浏览(47)
  • 微信小程序项目实例SSM项目小程序运动减肥+后台管理系统

     🍅文末获取联系🍅 目录 一、项目介绍  3.1可行性分析 3.1.1技术可行性 3.1.2经济可行性 3.1.3操作可行性 3.2网站性能需求分析 3.3网站功能分析 3.4系统流程的分析 3.4.1 用户管理的流程 二、截图  三、源码获取 计算机毕业设计微信小程序毕设项目之运动减肥+后台管理系统_哔

    2024年02月06日
    浏览(58)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包