mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 优化更新规则逻辑,修复更新规则失败的bug
This commit is contained in:
@@ -210,8 +210,12 @@ def do_update(request):
|
||||
print(data[2])
|
||||
print(data[0].get('url'))
|
||||
for site in data:
|
||||
del site['pk']
|
||||
Site.objects.update_or_create(defaults=site, url=site.get('url'))
|
||||
print(site)
|
||||
if site.get('pk'):
|
||||
del site['pk']
|
||||
print(site)
|
||||
site_obj = Site.objects.update_or_create(defaults=site, url=site.get('url'))
|
||||
print(site_obj)
|
||||
return JsonResponse(data=CommonResponse.success(
|
||||
msg='更新成功!!',
|
||||
data=result
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
</span>
|
||||
<span style="float: right;margin-top: -10px">
|
||||
{# <el-button type="primary" @click="do_refresh">刷新页面</el-button>#}
|
||||
<el-button type="success" @click="do_update">更新</el-button>
|
||||
<el-button type="success" @click="do_update" v-if="update">更新</el-button>
|
||||
<el-button type="danger" @click="do_restart">重启</el-button>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user