routers

package
v0.0.0-...-fe0d846 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

@APIVersion 1.0.0 @Title bootgo Test API @Description beego has a very cool tools to autogenerate documents for your API @Contact zhoubin296@gmail.com @TermsOfServiceUrl https://gitee.com/ipanocloud/bootgo @License MIT @LicenseUrl https://gitee.com/ipanocloud/bootgo/blob/master/LICENSE

Index

Constants

This section is empty.

Variables

View Source
var FilterAdminAuth = func(ctx *context.Context) {
	session := ctx.Input.Session(base.ADMIN_SESSION_KEY)
	if session == nil && !strings.Contains(ctx.Request.RequestURI, "login") {

		ctx.Redirect(302, "/home/login?r_url="+ctx.Request.RequestURI)
	}
	logs.Info("dddd")
}

后台权限校验

View Source
var FilterLog = func(ctx *context.Context) {
	url, _ := json.Marshal(ctx.Input.Data()["RouterPattern"])
	params, _ := json.Marshal(ctx.Request.Form)
	outputBytes, _ := json.Marshal(ctx.Input.Data()["json"])
	divider := " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
	topDivider := "┌" + divider
	middleDivider := "├" + divider
	bottomDivider := "└" + divider
	outputStr := "\n" + topDivider + "\n│ 请求地址:" + string(url) + "\n" + middleDivider + "\n│ 请求参数:" + string(params) + "\n│ 返回数据:" + string(outputBytes) + "\n" + bottomDivider
	logs.Info(outputStr)
}

添加日志拦截器

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL