{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "318e7588", "metadata": {}, "outputs": [], "source": [ "from requests import get,post\n", "import time\n", "ip = \"http://band.hxzhxy.cn\"\n", "# ip = \"http://192.168.0.244:8100\"\n", "\n", "param = {\n", " \"username\": \"tangchao\",\n", " \"password\": \"123456a\",\n", " \"client_id\": \"client\",\n", " \"grant_type\": \"password\",\n", " \"client_secret\": \"123456\",\n", "}\n", "data = get(url=f\"http://band.hxzhxy.cn/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456\").json()\n", "token = data[\"access_token\"]\n", "header = {\n", " \"content-type\": \"application/json\",\n", " \"authorization\": f\"Bearer {token}\",\n", "}" ] }, { "cell_type": "code", "execution_count": null, "id": "3c046d8d", "metadata": {}, "outputs": [ { "ename": "", "evalue": "", "output_type": "error", "traceback": [ "\u001b[1;31m在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。\n", "\u001b[1;31m请查看单元格中的代码,以确定故障的可能原因。\n", "\u001b[1;31m单击此处了解详细信息。\n", "\u001b[1;31m有关更多详细信息,请查看 Jupyter log。" ] } ], "source": [ "for i in range(24,27):\n", " post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":i},timeout=600).text" ] }, { "cell_type": "code", "execution_count": null, "id": "343a9e44", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.1" } }, "nbformat": 4, "nbformat_minor": 5 }