mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-21 02:40:26 +08:00
add table visit in user.db
This commit is contained in:
@@ -13,6 +13,13 @@ func FileHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if !utils.IsMethod("GET", w, r) {
|
||||
return
|
||||
}
|
||||
token := r.Header.Get("Authorization")
|
||||
user := usertokens.Get(token)
|
||||
if user == nil {
|
||||
writeresult(w, codeError, nil, errInvalidToken.Error(), typeError)
|
||||
return
|
||||
}
|
||||
global.UserDB.VisitAPI()
|
||||
if r.URL.Path[0] != '/' {
|
||||
r.URL.Path = "/" + r.URL.Path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user