上线本子更新(同步更新)
This commit is contained in:
parent
69d45dd6ef
commit
77d771f98a
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<el-button @click="changeCollect(props.row.gid, props.row.isCollect)">{{props.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
<el-button @click="changeCollect(props.row.gid, props.row.isCollect)">{{props.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
||||||
<el-button @click="editTag(props.row.gid, props.row.tag)">编辑标签</el-button>
|
<el-button @click="editTag(props.row.gid, props.row.tag)">编辑标签</el-button>
|
||||||
|
<el-button @click="updateGallery(props.row.link)" :disabled="props.row.download === undefined">更新</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -264,6 +265,9 @@ function submitTag(){
|
|||||||
function downloadTask(link){
|
function downloadTask(link){
|
||||||
window.open(link)
|
window.open(link)
|
||||||
}
|
}
|
||||||
|
function updateGallery(link){
|
||||||
|
store.dispatch("updateGallery", link)
|
||||||
|
}
|
||||||
function deleteGallery(gid){
|
function deleteGallery(gid){
|
||||||
store.dispatch("deleteGallery", gid)
|
store.dispatch("deleteGallery", gid)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,6 +116,20 @@ const actions = {
|
|||||||
ElMessage("查询失败")
|
ElMessage("查询失败")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
updateGallery(context, link){
|
||||||
|
axios.post(GalleryManageUrl + "/update", qs.stringify({AuthCode: state.AuthCode, link}))
|
||||||
|
.then((res) => {
|
||||||
|
if(res.data.result === 'success' && state.refreshTimer === 0){
|
||||||
|
setTimeout(() => {
|
||||||
|
context.dispatch("updateGalleryTasks", "all").then()
|
||||||
|
}, 5000)
|
||||||
|
state.refreshTimer = setInterval(() => {
|
||||||
|
context.dispatch("updateGalleryTasks", "undone").then()
|
||||||
|
}, 20000)
|
||||||
|
}
|
||||||
|
ElMessage(res.data.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
validate(context, AuthCode){
|
validate(context, AuthCode){
|
||||||
axios.post(BaseUrl + "validate?AuthCode=" + AuthCode).then((res)=>{
|
axios.post(BaseUrl + "validate?AuthCode=" + AuthCode).then((res)=>{
|
||||||
if(res.data.result === 'success'){
|
if(res.data.result === 'success'){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user