This commit is contained in:
cdle
2021-10-11 16:48:37 +08:00
parent 0e551687c5
commit ecec622323
4 changed files with 88 additions and 2 deletions
+11 -1
View File
@@ -161,8 +161,18 @@ func initSys() {
if !IsBucket(b) {
return errors.New("不存在的存储桶")
}
old := b.Get(s.Get(1))
b.Set(s.Get(1), s.Get(2))
return "设置成功"
go func() {
s.Await(func(_ string, e error) interface{} {
if e != nil {
return nil
}
b.Set(s.Get(1), old)
return "已撤回。"
}, "^撤回$", time.Second*60)
}()
return "操作成功,如果你后悔了,请在60s内对我说\"撤回\",即可撤销本次操作。"
},
},
{