chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本 2. 新增数据库操作、API调用工具 3. 新增Excel数据处理脚本 4. 新增弱密码检测脚本
This commit is contained in:
+84
-27
@@ -20,7 +20,7 @@
|
||||
"port=3306,\n",
|
||||
"user='root',\n",
|
||||
"password='Abcd@123456',\n",
|
||||
"database='hongxx_video',\n",
|
||||
"database='hongxx',\n",
|
||||
"charset='utf8'\n",
|
||||
")\n",
|
||||
"# 创建游标对象\n",
|
||||
@@ -50,17 +50,17 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": 26,
|
||||
"id": "b717043a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"sql = 'select * from video_info'"
|
||||
"sql = 'select * from sys_user where dept_id=100'\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 27,
|
||||
"id": "b4b373b8",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -72,46 +72,103 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"id": "84652b4b",
|
||||
"execution_count": 28,
|
||||
"id": "394495d3",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[2,\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]"
|
||||
]
|
||||
},
|
||||
"execution_count": 28,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"[i[\"user_id\"] for i in result]\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"id": "325e4664",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"result\n",
|
||||
"# http://192.168.0.244:88/record/original-files/video/522e4c55fc804decafdd0a62e5a1bf74.mp4\n",
|
||||
"for item in result:\n",
|
||||
" if item[\"video_url\"].startswith(\"http://192.168.0.244:88\"):\n",
|
||||
" video_url = item[\"video_url\"].replace(\"http://192.168.0.244:88\",\"/mp4\")\n",
|
||||
" sql = f\"update video_info set video_url='{video_url}' where id={item['id']}\"\n",
|
||||
" cursor.execute(sql)"
|
||||
" userid = item[\"user_id\"]\n",
|
||||
" \n",
|
||||
" sql2 = f\"update sys_user set dept_id=100, team_user_type ='BACKEND' where user_id={userid}\"\n",
|
||||
" cursor.execute(sql2)\n",
|
||||
"connection.commit()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"id": "f62b4e7d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for item in result:\n",
|
||||
" userid = item[\"user_id\"]\n",
|
||||
" sql2 = f\"update sys_user_dept set dept_id=100, person_type='hx_sys' where user_id={userid}\"\n",
|
||||
" cursor.execute(sql2)\n",
|
||||
"connection.commit()\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "0b4381f4",
|
||||
"id": "7dcf47b8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"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>。"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for item in result:\n",
|
||||
" userid = item[\"user_id\"]\n",
|
||||
" sql2 = f\"update sys_user_role set dept_id=100 where user_id={userid}\"\n",
|
||||
" cursor.execute(sql2)\n",
|
||||
"connection.commit()"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user