上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 24 下一页
摘要: 打window包直接go build一下,完事, 但是,打linux包出现如下错误 ..\github.com\mattn\go-isatty\isatty_linux.go:7:8: cannot find package "golang.org/x/sys/unix" in any of: 解决 阅读全文
posted @ 2019-04-13 11:24 wujf 阅读(1302) 评论(0) 推荐(0)
摘要: func Cors(c *gin.Context) { c.Header("Access-Control-Allow-Origin", "*") c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token") c.Header("... 阅读全文
posted @ 2019-04-13 10:52 wujf 阅读(481) 评论(0) 推荐(0)
摘要: 1、定义中间件 2、对要拦截的路由进行分组并引入中间件 3、测试 分别查看http://127.0.0.1:8088/api/ping和http://127.0.0.1:8088/ping,可以看出一个会输出“我是中间件”,一个不会输出 4、结论 什么权限、登陆、token之类的就这样起飞吧 阅读全文
posted @ 2019-04-13 10:47 wujf 阅读(1474) 评论(0) 推荐(0)
摘要: func wrapCtx(handler func(ctx *gin.Context)) gin.HandlerFunc { return func(c *gin.Context) { //获取请求的url log.Info("当前请求url:%s", c.Request.RequestURI) t 阅读全文
posted @ 2019-04-13 10:23 wujf 阅读(781) 评论(0) 推荐(0)
摘要: 需求: 记录所有请求的json数据 此方法即可打印所有请求的body内容,但是在对应的处理器上就取不到数据 解决办法: 阅读全文
posted @ 2019-04-12 19:01 wujf 阅读(13320) 评论(0) 推荐(0)
摘要: 导包 加载log4go 写日志 java折腾久了,日志框架还是喜欢这个 阅读全文
posted @ 2019-04-12 14:46 wujf 阅读(877) 评论(0) 推荐(0)
摘要: func getCurrentPath() string { _, filename, _, ok := runtime.Caller(1) var cwdPath string if ok { cwdPath = path.Join(path.Dir(filename), "") // the the main function file directo... 阅读全文
posted @ 2019-04-12 14:42 wujf 阅读(1344) 评论(0) 推荐(0)
摘要: mybatis-generator-lombok-plugin下载地址 https://github.com/GuoGuiRong/mybatis-generator-lombok-plugin,下载完执行mvn install 阅读全文
posted @ 2019-04-11 13:52 wujf 阅读(5158) 评论(0) 推荐(0)
摘要: package com.qmtt.config; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import ... 阅读全文
posted @ 2019-04-11 11:25 wujf 阅读(472) 评论(0) 推荐(0)
摘要: 通过apt-get安装rar后,执行rar命令会有如下坑: rar: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_typ 阅读全文
posted @ 2019-04-11 10:50 wujf 阅读(1088) 评论(0) 推荐(1)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 24 下一页