From 2a2ccc67fe5f67a4a03e0c3934e184df36de9c3c Mon Sep 17 00:00:00 2001 From: fumiama Date: Thu, 17 Jun 2021 22:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E5=9B=BE=E7=89=87=E7=BD=91=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- randimg/setu_geter.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/randimg/setu_geter.go b/randimg/setu_geter.go index 4674efe6..3d35f9e6 100644 --- a/randimg/setu_geter.go +++ b/randimg/setu_geter.go @@ -36,6 +36,16 @@ func init() { // 插件主体 } return }) + zero.OnRegex(`^设置评价图片网址(.*)$`, zero.SuperUserPermission).SetBlock(true).SetPriority(20). + Handle(func(ctx *zero.Ctx) { + url := ctx.State["regex_matched"].([]string)[1] + if !strings.HasPrefix(url, "http") { + ctx.Send("URL非法!") + } else { + CLASSIFY_RANDOM_API_URL = url + RANDOM_API_URL + } + return + }) // 有保护的随机图片 if CLASSIFY_RANDOM_API_URL != "" { zero.OnFullMatch("评价图片").SetBlock(true).SetPriority(24).