From b436b1fa9bf0011acb547948468627e8cde40c76 Mon Sep 17 00:00:00 2001
From: hyb <kk_huangyangbo@163.com>
Date: Fri, 05 Dec 2025 09:28:59 +0000
Subject: [PATCH] 优化各项目数据库地址变更和端口号变更后的数据库获取问题 增加数据库表中的端口字段,获取对应项目的端口号
---
测试组/脚本/登录获取token/获取用户token.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git "a/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\347\231\273\345\275\225\350\216\267\345\217\226token/\350\216\267\345\217\226\347\224\250\346\210\267token.py" "b/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\347\231\273\345\275\225\350\216\267\345\217\226token/\350\216\267\345\217\226\347\224\250\346\210\267token.py"
index 2a32066..df72d6c 100644
--- "a/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\347\231\273\345\275\225\350\216\267\345\217\226token/\350\216\267\345\217\226\347\224\250\346\210\267token.py"
+++ "b/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\347\231\273\345\275\225\350\216\267\345\217\226token/\350\216\267\345\217\226\347\224\250\346\210\267token.py"
@@ -8,12 +8,12 @@
}
def get_Token():
- url = "http://192.168.7.127:8083/sys/login"
+ url = "http://192.168.7.104:8081/sys/login"
headers = {
"content-type":"application/json; charset=UTF-8"
}
# 获取用户账号密码
- df = conftest.read_excel("TestData/userinfo.xlsx")
+ df = conftest.read_excel("TestData/userinfo_2.xlsx")
# 封装为字典列表
UserList = conftest.get_list(df,["username","password"])
# 遍历用户字典列表的索引和值
@@ -22,12 +22,13 @@
username = aes_encrypt(user["username"], "abcdefgh12345678", "12345678abcdefgh")
password = aes_encrypt(user["password"], "abcdefgh12345678", "12345678abcdefgh")
# 构造请求体
- params = {"code": "1234","username": username, "password": password }
+ params = {"code": "","username": username, "password": password,}
try:
response = requests.post(url=url, headers=headers, json=params, verify=False)
if response.status_code == 200:
data = response.json()
- token = data["token"]
+ token = data["refreshToken"]
+ print(user["username"])
if token:
# Token写入Excel文件
conftest.write_excel("TestData/userinfo.xlsx",index,"token",token)
--
Gitblit v1.9.1