From 4cb426cb3ae31e772a09d4ade5b2f0242aaeefa0 Mon Sep 17 00:00:00 2001
From: hyb <kk_huangyangbo@163.com>
Date: Fri, 09 Jan 2026 08:34:47 +0000
Subject: [PATCH] 更新昆明理工压测脚本自动获取token

---
 测试组/脚本/造数脚本2/昆明理工大学/动物检疫.py |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git "a/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\351\200\240\346\225\260\350\204\232\346\234\2542/\346\230\206\346\230\216\347\220\206\345\267\245\345\244\247\345\255\246/\345\212\250\347\211\251\346\243\200\347\226\253.py" "b/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\351\200\240\346\225\260\350\204\232\346\234\2542/\346\230\206\346\230\216\347\220\206\345\267\245\345\244\247\345\255\246/\345\212\250\347\211\251\346\243\200\347\226\253.py"
index 2bdb1c4..ce95642 100644
--- "a/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\351\200\240\346\225\260\350\204\232\346\234\2542/\346\230\206\346\230\216\347\220\206\345\267\245\345\244\247\345\255\246/\345\212\250\347\211\251\346\243\200\347\226\253.py"
+++ "b/\346\265\213\350\257\225\347\273\204/\350\204\232\346\234\254/\351\200\240\346\225\260\350\204\232\346\234\2542/\346\230\206\346\230\216\347\220\206\345\267\245\345\244\247\345\255\246/\345\212\250\347\211\251\346\243\200\347\226\253.py"
@@ -26,18 +26,25 @@
 
 parent_dir = get_parent_directory(__file__, 5)  # 获取上五级目录
 sys.path.append(parent_dir)
-from 测试组.脚本.造数脚本2.Util.random_util import RandomUtil
-from 测试组.脚本.造数脚本2.Util.dingtalk_helper import DingTalkHelper
-
+from 测试组.脚本.造数脚本2.Util import TokenValidator, DingTalkHelper, RandomUtil, RequestRecord, LoadTestReportGenerator
 
 # --- 配置 ---
 ACCESS_TOKEN = '4625f6690acd9347fae5b3a05af598be63e73d604b933a9b3902425b8f136d4d'
 SECRET = 'SEC3b6937550bd297b5491855f6f40c2ff1b41bc8c495e118ba9848742b1ddf8f19'
 
+# 账号密码配置
+username = "gly"
+password = "Baoyi@1341"
+# 创建获取token实例
+token_validator = TokenValidator()
+
+domain = "http://192.168.6.168:5534"
+token = token_validator.get_token(domain, username, password)
+
 apiname = "动物检疫"
-url = "http://192.168.6.168:5534/api/mainbusiness/animalquarantine/animalQuarantine/save"
+url = f"{domain}/api/mainbusiness/animalquarantine/animalQuarantine/save"
 headers = {
-    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NjA2Nzk1MDksInVzZXJuYW1lIjoiZ2x5In0.aApZ-cXC_pIw6gdPZHg3TlsgZIaCPRrmlMDM3-zEhtg",
+    "token": token,
     "Content-Type": "application/json"
 }
 

--
Gitblit v1.9.1