OneTiny 开发日记3-2021-6-29

新增访问层级限制 更新功能没写成,还是没想好怎么处理整个流程。 摆在面前有两个问题: 下载下来的新版本(可执行文件)放在哪 如何关闭自己然后启动新版本 所以暂时搁置,转头去实现访问层级限制功能。 使用中间件 这次把中间件用上了,还把之前对浏览器的默认行为:请求 favicon.ico 进行拦截的部分放在单独的中间件里,并且应用到全局。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // Start 函数负责启动 gin 实例,开始提供 HTTP 服务 func Start() { gin.SetMode(gin.ReleaseMode) r := gin.New() r.Use(gin.LoggerWithWriter(config.Output),gin.Recovery()) // 中间件 r.Use(middleware.InterceptICO) r.Use(middleware.CheckLevel) r.NoRoute(controller.NotFound) r.GET("/*filename", controller.Handler) r.POST("/upload", controller.Upload) printInfo() err := r.Run(":" + config.Port) if _, ok := err.(*net.OpError); ok { log.Fatal(color.RedString("指定的 %s 端口已被占用,请换一个端口号。", config....

June 29, 2021 · 2 min · Boii

OneTiny 开发日记2-2021-6-25

第一次修改别人的东西哈哈 ...

June 25, 2021 · 7 min · Boii

OneTiny 开发日记1-2021-6-22

开发 OneTiny 时的一点思路 ...

June 22, 2021 · 1 min · Boii

Hexo-文件下载功能

So easy~ ...

August 23, 2020 · 1 min · Boii

VUE-note-day2

Vue 的细节是真的多. ...

April 9, 2020 · 3 min · Boii

VUE-note-day1

疫情在家真的无聊 T_T,学点Vue吧 ...

April 8, 2020 · 6 min · Boii

全站变灰的实现

哀悼日-全站变灰的实现...

April 6, 2020 · 2 min · Boii

Electron Note

Note ...

March 21, 2020 · 5 min · Boii

Git-基本操作说明

Git Yes! ...

July 18, 2019 · 1 min · Boii

SSM-配置文件

先把配置文件捋清楚 前言 SSM框架中有几个比较重要的配置文件,一开始学起来会很模糊,这里做一下整理 当一个web程序启动时,Tomcat服务器最先会读取 web.xml 文件,这个文件中会启动一些配置,还会启动Spring配置文件**applicationContext.xml** 和SpringMVC配置文件 springMVC-servlet.xml 这两个文件,在运行 applicationContext.xml 的时候会启动MyBatis的配置文件 myBatis.xml,并且会调用到 jdbc.properties 和 log4J.properties 两个资源属性文件里的属性。 web.xml 接下来先看看最先启动的 web.xml 是都怎么配置。 在Spring配置中和在Servlet配置中,就启动了applicationContext 和 SpringMVC-servlet 两个配置文件 启动applicationContext 1 2 3 4 <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> 启动SpringMVC-servlet 1 2 3 4 5 6 7 8 9 10 11 <!--部署Servlet分发器 DispatcherServlet--> <servlet> <servlet-name>springer</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!--注册DispatcherServlet的配置文件--> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springer-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> 运行到这的时候就会调用到上述两个文件。 整个文件如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 <?...

July 14, 2019 · 5 min · Boii