chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本 2. 新增数据库操作、API调用工具 3. 新增Excel数据处理脚本 4. 新增弱密码检测脚本
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# %%
|
||||
import os
|
||||
os.add_dll_directory(os.getcwd())
|
||||
from pctoken import get_token
|
||||
from requests import get,post
|
||||
|
||||
# %%
|
||||
BASE_URL = 'http://net2.hxzhxy.cn:5092'
|
||||
USERNAME = 'xiatianle'
|
||||
PASSWORD = 'Xia123456'
|
||||
TOKEN = get_token(BASE_URL, USERNAME, PASSWORD)["access_token"]
|
||||
|
||||
|
||||
# %%
|
||||
print(TOKEN)
|
||||
+1
-1
@@ -27,7 +27,7 @@ def get_token(base_url: str, username: str, password: str) -> dict:
|
||||
oauth_client = 'hongxapp:hongxplapp'
|
||||
|
||||
enc_password = encrypt_password(password, enc_key)
|
||||
|
||||
print(enc_password)
|
||||
url = f"{base_url.rstrip('/')}/auth/oauth2/token"
|
||||
params = {
|
||||
'username': username,
|
||||
|
||||
+238
-32
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 2,
|
||||
"id": "70c9ccec",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": null,
|
||||
"id": "379f4db2",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -23,81 +23,287 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"342e75d2-dd64-4d6b-9316-da51fdce642d\n"
|
||||
"bN7Xn9xVdkyg\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "",
|
||||
"evalue": "",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[1;31m在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。\n",
|
||||
"\u001b[1;31m请查看单元格中的代码,以确定故障的可能原因。\n",
|
||||
"\u001b[1;31m单击<a href='https://aka.ms/vscodeJupyterKernelCrash'>此处</a>了解详细信息。\n",
|
||||
"\u001b[1;31m有关更多详细信息,请查看 Jupyter <a href='command:jupyter.viewOutput'>log</a>。"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"BASE_URL = \"http://192.168.0.244:9999\"\n",
|
||||
"data = get_token(BASE_URL, \"admin\", \"123456\")\n",
|
||||
"TOKEN = data.get(\"access_token\", \"\")\n",
|
||||
"print(TOKEN)\n",
|
||||
"headers = {\n",
|
||||
" \"Authorization\": f\"Bearer {TOKEN}\",\n",
|
||||
" \"hx-client\": \"hongxapp\",\n",
|
||||
"}"
|
||||
"BASE_URL = 'http://192.168.0.10:9999'\n",
|
||||
"USERNAME = '00000001CDSPTSZX'\n",
|
||||
"PASSWORD = 'xia123456'\n",
|
||||
"TOKEN = get_token(BASE_URL, USERNAME, PASSWORD)[\"access_token\"]\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"id": "820f6d23",
|
||||
"execution_count": 5,
|
||||
"id": "dcf475eb",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'{\"timestamp\":\"2026-02-27 15:36:51\",\"status\":500,\"error\":\"Internal Server Error\",\"path\":\"/videoInfoStream/page\"}'"
|
||||
"'ee5552cb-7dd8-46b4-b54a-e8cf57e90ddc'"
|
||||
]
|
||||
},
|
||||
"execution_count": 31,
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"TOKEN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"id": "820f6d23",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"headers = {\n",
|
||||
" \"Authorization\": f\"Bearer {TOKEN}\",\n",
|
||||
" \"HX-CLIENT\": \"hongxapp\",\n",
|
||||
" 'H-SV-CODE':'video',\n",
|
||||
" 'Host': '192.168.0.111:5173',\n",
|
||||
" 'Referer': 'http://192.168.0.111:5173/'\n",
|
||||
"}\n",
|
||||
"get( \" http://192.168.0.244:9999/video/videoInfoStream/page?current=1&size=10&descs=&ascs=\",headers=headers).text"
|
||||
" 'hx-p-type':'WEB',\n",
|
||||
" 'hx-t-type':'PLATFORM',\n",
|
||||
"}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "2c7227e6",
|
||||
"execution_count": 27,
|
||||
"id": "dd5eb589",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'{\"timestamp\":\"2026-02-27 15:34:24\",\"status\":500,\"error\":\"Internal Server Error\",\"path\":\"/podPhoto/pageInfoBySections\"}'"
|
||||
"{'Authorization': 'Bearer 295b20e2-1ce0-44ab-8d74-384cdefc16bb',\n",
|
||||
" 'HX-CLIENT': 'hongxapp',\n",
|
||||
" 'hx-p-type': 'WEB',\n",
|
||||
" 'hx-t-type': 'PLATFORM'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 21,
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": []
|
||||
"source": [
|
||||
"headers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1822efb2",
|
||||
"id": "869391ea",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
" # \"Accept\": 'application/json, text/plain, */*',\n",
|
||||
"# 'Connection': 'keep-alive',\n",
|
||||
"# 'H-SV-CODE':'video',\n",
|
||||
"# 'HX-CLIENT':'hongxapp',\n",
|
||||
"# 'Host': '192.168.0.111:5173',\n",
|
||||
"# 'Referer': 'http://192.168.0.111:5173/'"
|
||||
"post('http://192.168.0.10:8888/api/admin/user/v1/exist/add', headers=headers, json={\"userId\":\"2\",\"deptId\":\"19\",\"roleId\":\"2053724615032193025\"})\n",
|
||||
"{\"userId\":\"2\",\"deptId\":\"110\",\"roleId\":\"2055118564695838722\"}\n",
|
||||
"{\"userId\":\"2\",\"deptId\":\"119\",\"roleId\":\"2059515940711231489\"}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"id": "7006382d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"user_ids = [\n",
|
||||
" 3,\n",
|
||||
" 4,\n",
|
||||
" 6,\n",
|
||||
" 24,\n",
|
||||
" 31,\n",
|
||||
" 308,\n",
|
||||
" 909,\n",
|
||||
" 917,\n",
|
||||
" 918,\n",
|
||||
" 1145,\n",
|
||||
" 3690,\n",
|
||||
" 3698,\n",
|
||||
" 3828,\n",
|
||||
" 3842,\n",
|
||||
" 3843,\n",
|
||||
" 3844,\n",
|
||||
" 3895,\n",
|
||||
" 3899,\n",
|
||||
" 3912,\n",
|
||||
" 3913,\n",
|
||||
" 3935,\n",
|
||||
" 3936,\n",
|
||||
" 3988,\n",
|
||||
" 5440,\n",
|
||||
" 5492,\n",
|
||||
" 7696,\n",
|
||||
" 7713,\n",
|
||||
" 7714,\n",
|
||||
" 7723,\n",
|
||||
" 7728,\n",
|
||||
" 2059454179031199746]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 29,
|
||||
"id": "0e7366e2",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"{\"code\":1,\"msg\":\"用户不存在\",\"data\":null,\"ok\":false}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"{\"code\":0,\"msg\":null,\"data\":true,\"ok\":true}\n",
|
||||
"==================================================\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"for user_id in user_ids:\n",
|
||||
" resp = post('http://192.168.0.10:9999/admin/user/v1/exist/add', headers=headers, json={\"userId\":str(user_id),\"deptId\":\"110\",\"roleId\":\"2055118564695838722\"}).text\n",
|
||||
" resp1 = post('http://192.168.0.10:9999/admin/user/v1/exist/add', headers=headers, json={\"userId\":str(user_id),\"deptId\":\"119\",\"roleId\":\"2059515940711231489\"}).text\n",
|
||||
" resp2 = post('http://192.168.0.10:9999/admin/user/v1/exist/add', headers=headers, json={\"userId\":str(user_id),\"deptId\":\"19\",\"roleId\":\"2053724615032193025\"}).text\n",
|
||||
" print(resp)\n",
|
||||
" print(resp1)\n",
|
||||
" print(resp2)\n",
|
||||
" print(\"=\"*50)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user