Upgraded to latest aero version

This commit is contained in:
2019-06-01 13:55:49 +09:00
parent ae591e5e7e
commit 28db818c37
196 changed files with 645 additions and 593 deletions
assets
auth
config.json
docs
go.modgo.sum
layout
main.gomain_test.gomakefile
middleware
pages
activity
admin
amv
amvs
anime
animeimport
animelist
animelistitem
apiview
calendar
character
characters
charge
companies
company
compare
editlog
editor
embed
episode
explore
explore.go
explorecolor
explorerelations
halloffame
forum
frontpage
genre
genres
group
groups
home
index/staffroutes
inventory
listimport
listimport.go
listimportanilist
listimportkitsu
listimportmyanimelist
login
me
newthread
notifications
paypal
popular
post
profile
quote
quotes
recommended
search
settings
shop
soundtrack
soundtracks
sse
statistics
support
terms
thread
upload
user
users
welcome
rewrite.go
scripts/Actions
tools
utils

@ -1,6 +1,7 @@
package admin
import (
"net/http"
"runtime"
"strings"
@ -14,11 +15,11 @@ import (
)
// Get admin page.
func Get(ctx *aero.Context) string {
func Get(ctx aero.Context) error {
user := utils.GetUser(ctx)
if user == nil || (user.Role != "admin" && user.Role != "editor") {
return ctx.Redirect("/")
return ctx.Redirect(http.StatusFound, "/")
}
// // CPU