fix bug
This commit is contained in:
parent
5a6a8dbd35
commit
b217939063
14
README.md
14
README.md
|
|
@ -24,12 +24,18 @@
|
|||
|
||||
### 说明
|
||||
|
||||
1. 首先,<a href="javascript:(function(){data=JSON.parse(localStorage.user);prompt('',JSON.stringify({token:data['token'],userId:data['userId'], tenantCode:data['tenantCode'], userProjectId: data['preUserProjectId']}));})();">请将这个链接拖入收藏夹</a>。
|
||||
1. 登录[安全微伴 (mycourse.cn)](http://weiban.mycourse.cn/#/login),在登录后的页面上运行刚才添加进收藏夹的脚本
|
||||
|
||||
2. 登录[安全微伴 (mycourse.cn)](http://weiban.mycourse.cn/#/login),在登录后的页面上运行刚才添加进收藏夹的脚本
|
||||
2. 在浏览器地址栏运行
|
||||
|
||||
```
|
||||
javascript:(function(){data=JSON.parse(localStorage.user);prompt('',JSON.stringify({token:data['token'],userId:data['userId'], tenantCode:data['tenantCode'], userProjectId: data['preUserProjectId']}));})();
|
||||
```
|
||||
|
||||
浏览器地址栏如果吞掉了“`javascript:`”,请手动加上,或者你可以将上述脚本添加到收藏夹。
|
||||
|
||||
3. 复制弹窗内的内容,**按照格式**添加到`config.json`。(格式不对会报错)
|
||||
|
||||
[](http://png.eot.ooo/i/2022/09/06/6316d7c7f3567.png)
|
||||
|
||||
4. 运行`main.exe`。
|
||||
|
||||
4. 运行`main.py` 或者 [main.exe](https://github.com/pooneyy/weiban-tool/releases)。
|
||||
1
Utils.py
1
Utils.py
|
|
@ -2,7 +2,6 @@ import time
|
|||
import requests
|
||||
import json
|
||||
|
||||
|
||||
class main:
|
||||
tenantCode = 0
|
||||
userId = ""
|
||||
|
|
|
|||
12
main.py
12
main.py
|
|
@ -1,6 +1,7 @@
|
|||
# @Author : Qiuyelin
|
||||
# @repo : https://github.com/pooneyy/weiban-tool
|
||||
|
||||
import os
|
||||
import Utils
|
||||
import time
|
||||
import json
|
||||
|
|
@ -16,9 +17,16 @@ try:
|
|||
userProjectId = user['userProjectId']
|
||||
main = Utils.main(tenantCode, userId, x_token, userProjectId)
|
||||
main.init()
|
||||
finishIdList = main.getFinishIdList()
|
||||
try:
|
||||
finishIdList = main.getFinishIdList()
|
||||
except json.decoder.JSONDecodeError:
|
||||
print('账户信息错误或已经过期,请重新获取。详见:https://github.com/pooneyy/weiban-tool')
|
||||
break
|
||||
for i in main.getCourse():
|
||||
main.start(i)
|
||||
time.sleep(20)
|
||||
main.finish(finishIdList[i])
|
||||
except FileNotFoundError:print('未找到 config.json !')
|
||||
os.system("pause")
|
||||
except FileNotFoundError:
|
||||
print('未找到 config.json!详见:https://github.com/pooneyy/weiban-tool')
|
||||
os.system("pause")
|
||||
Loading…
Reference in New Issue