def unauthorized(error): if request.is_xhr: return render_json(u"没有查看/操作的权限") return redirect(url_for("home.login", next=request.path))
def server_error(error): if request.is_xhr: return render_json(u'出错了...') return render_template("errors/500.html", error=error)
def forbidden(error): if request.is_xhr: return render_json(u'Sorry, not allowed') return render_template("errors/403.html", error=error)
def page_not_found(error): if request.is_xhr: return render_json(u'查看的内容不存在') return render_template("errors/404.html", error=error)
def unauthorized(error): if request.is_xhr: return render_json(u"要登录的") return redirect(url_for("account_login.login", next=request.path))
def unauthorized(error): if request.is_xhr: return render_json(u"没有查看/操作的权限") return render_template("errors/401.html", error=error)