Skip to content

Commit

Permalink
feat: 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
anhoder committed Feb 14, 2023
1 parent a5339f5 commit 44a6fc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utils/response_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (
// CheckCode 验证响应码
func CheckCode(code float64) ResCode {
switch code {
case 301, 302:
case 301, 302, 20001:
return NeedLogin
case 520:
return NetworkError
Expand Down
3 changes: 3 additions & 0 deletions utils/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func (t *Timer) Run() {
t.done = make(chan struct{})

for {
if t.ticker == nil {
return
}
select {
case tickAt := <-t.ticker.C:
t.passed += tickAt.Sub(t.lastTick)
Expand Down

0 comments on commit 44a6fc9

Please sign in to comment.