Skip to content

Commit

Permalink
删除谜之操作
Browse files Browse the repository at this point in the history
  • Loading branch information
IJNKAWAKAZE committed Aug 23, 2024
1 parent 5a9cff9 commit bfd49b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/core/web/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"arknights_bot/plugins/account"
"arknights_bot/plugins/skland"
"arknights_bot/utils"
"fmt"
"github.com/gin-gonic/gin"
"log"
"net/http"
Expand Down Expand Up @@ -103,6 +104,10 @@ func Box(r *gin.Engine) {

box.Name = playerData.Status.Name
box.Chars = chars
if len(box.Chars) == 0 {
utils.WebC <- fmt.Errorf("无符合干员")
return
}

c.HTML(http.StatusOK, "Box.tmpl", box)
})
Expand Down
5 changes: 5 additions & 0 deletions src/core/web/missing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"arknights_bot/plugins/account"
"arknights_bot/plugins/skland"
"arknights_bot/utils"
"fmt"
"github.com/gin-gonic/gin"
"log"
"net/http"
Expand Down Expand Up @@ -102,6 +103,10 @@ func Missing(r *gin.Engine) {

missingInfo.Name = playerData.Status.Name
missingInfo.Chars = chars
if len(missingInfo.Chars) == 0 {
utils.WebC <- fmt.Errorf("你什么都不缺")
return
}

c.HTML(http.StatusOK, "Missing.tmpl", missingInfo)
})
Expand Down
1 change: 0 additions & 1 deletion src/utils/base_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ func Screenshot(url string, waitTime float64, scale float64) ([]byte, error) {
})
if len(WebC) > 0 {
e := <-WebC
close(WebC)
return nil, e
}
page.WaitForTimeout(waitTime)
Expand Down

0 comments on commit bfd49b7

Please sign in to comment.