DEBUG Admin
This commit is contained in:
@@ -37,7 +37,7 @@ func AccountRead(w http.ResponseWriter, r *http.Request, cb func(account *Accoun
|
||||
|
||||
// 獲取當前用戶
|
||||
user := User{ID: session.UserID}
|
||||
if err := configs.ORMDB().Model(&user).Select("id, name, email, created_at, updated_at").Find(&user).Error; err != nil {
|
||||
if err := configs.ORMDB().Take(&user).Error; err != nil {
|
||||
http.SetCookie(w, &http.Cookie{Name: "session_id", Value: "", Path: "/", MaxAge: -1})
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
w.Write([]byte("401 - 用戶不存在, 請重新登錄"))
|
||||
|
Reference in New Issue
Block a user