优化油猴脚本

This commit is contained in:
ngfchl
2023-02-09 22:02:31 +08:00
parent 740cbd850f
commit b66bd6a4be
2 changed files with 2 additions and 2 deletions

View File

@@ -156,7 +156,7 @@ var i = 1;
async function getSite() {
return new Promise((resolve, reject) => {
GM_xmlhttpRequest({
url: `${ptools}${path}?url=${document.location.origin + '/'}&token=${token}`,
url: `${ptools}${path}?url=${document.location.host + '/'}&token=${token}`,
method: "GET",
responseType: "json",
onload: function (response) {

View File

@@ -1232,7 +1232,7 @@ def monkey_to_ptools(request):
msg='Token认证失败'
).to_dict(), safe=False)
logger.info(url)
site_list = Site.objects.filter(url=url)
site_list = Site.objects.filter(url__contains=url)
if len(site_list) == 1:
site = site_list.first()
# logger.info(f'{(datetime.now() - site.mysite.updated_at).seconds / 3600}')