1
0
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:
源文雨
2023-03-21 23:19:01 +08:00
parent ddf7182234
commit 6269a9544f
14 changed files with 81 additions and 414 deletions

View File

@@ -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
}