01 2022 档案
摘要:1. 引入依赖库 github.com/gin-contrib/static 2. 配置默认页面 r := gin.Default() r.Use(static.Serve("/", static.LocalFile("templates/index.html", true))) 3. 关键点【解决
阅读全文
摘要:r := gin.Default() //Get路由,动态路由 r.GET("/GetFile/:name", DowFile) // DowFile 文件在线预览func DowFile(c *gin.Context){ //通过动态路由方式获取文件名,以实现下载不同文件的功能 name:=c.P
阅读全文
摘要:post请求 projectName := c.PostForm("projectName") get请求 curr := c.Query("curr")
阅读全文
摘要://将字符串转为int类型 limitInt, _ := strconv.Atoi(limit)
阅读全文
摘要:// UploadCodeHandler 上传代码 func UploadCodeHandler(c *gin.Context){ userId := c.PostForm("userId") projectId := c.PostForm("projectId") fmt.Println(user
阅读全文
摘要:currTime :=time.Now().Format("2006-01-02 15:04:05") local, _ := time.LoadLocation("Local") t, _ := time.ParseInLocation("2006-01-02 15:04:05", currTim
阅读全文
摘要:1. 下载依赖 pip install yagmail 2. 获取授权码 授权码获取方式查看链接:https://www.cnblogs.com/lxz123/p/14962000.html(注:以前写的这种发送邮件的方式,在往公司邮箱(阿里邮箱)发送邮件的时候,显示发送成功,但是邮件收不到,后面改
阅读全文