diff --git a/README.MD b/README.MD index c815d26..72b7a4b 100644 --- a/README.MD +++ b/README.MD @@ -1,10 +1,10 @@ # 全新JWB打印系统 -ThinkPrint-GO +ThinkPrinter-GO ## 简介 -ThinkPrint-GO是一个基于Golang的全新JWB打印系统,它的前身是ThinkPrint-python +ThinkPrinter-GO是一个基于Golang的全新JWB打印系统,它的前身是ThinkPrint-python 本项目采用纯Golang重写,前后端分离设计。 @@ -35,13 +35,13 @@ ThinkPrint-GO是一个基于Golang的全新JWB打印系统,它的前身是Thin ### 服务器端 1. 安装``Microsoft Word 2016``以上或``Microsoft Office 365`` -2. 从GitHub下载最新的``ThinkPrint-GO``二进制文件和``thinkprint-vue``前端包 -3. 将``ThinkPrint-GO``二进制文件和``thinkprint-vue``前端包放置在同一目录下。 -4. 请确保``dist``文件夹与``ThinkPrint-GO``同级 -5. 将工作目录切换到``ThinkPrint-GO``所在目录 -6. 运行``ThinkPrint-GO``,首次启动程序将自动创建``config.toml``配置文件 +2. 从GitHub下载最新的``ThinkPrinter-GO``二进制文件和``ThinkPrinter-vue``前端包 +3. 将``ThinkPrinter-GO``二进制文件和``ThinkPrinter-vue``前端包放置在同一目录下。 +4. 请确保``dist``文件夹与``ThinkPrinter-GO``同级 +5. 将工作目录切换到``ThinkPrinter-GO``所在目录 +6. 运行``ThinkPrinter-GO``,首次启动程序将自动创建``config.toml``配置文件 7. 自定义修改``config.toml``配置文件 -8. 再次运行``ThinkPrint-GO``,程序将自动创建数据库文件``sqlite.db`` +8. 再次运行``ThinkPrinter-GO``,程序将自动创建数据库文件``sqlite.db`` ### 配置文件注解 diff --git a/router/handler/upload.go b/router/handler/upload.go index b82a5db..3c705ce 100644 --- a/router/handler/upload.go +++ b/router/handler/upload.go @@ -1,13 +1,14 @@ package handler import ( - "github.com/gin-gonic/gin" "log/slog" "net/http" "os" "path/filepath" . "thinkprinter/models" "thinkprinter/printer" + + "github.com/gin-gonic/gin" ) // Upload 批量上传文件 @@ -35,7 +36,7 @@ func Upload(c *gin.Context) { return } username := c.GetString("username") - dir := filepath.Join(os.TempDir(), "ThinkPrint", username) + dir := filepath.Join(os.TempDir(), "ThinkPrinter", username) for _, file := range files { // 检查文件后缀 for _, ext := range allowedExt { diff --git a/tools/jwt.go b/tools/jwt.go index eeb3fcb..0b5f5aa 100644 --- a/tools/jwt.go +++ b/tools/jwt.go @@ -2,17 +2,18 @@ package tools import ( "errors" - . "github.com/golang-jwt/jwt/v5" "strconv" "thinkprinter/models" "time" + + . "github.com/golang-jwt/jwt/v5" ) var jwtKey = []byte(models.C.Security.JWTSecret) func CreateToken(user models.User) (string, error) { claims := RegisteredClaims{ - Issuer: "ThinkPrint-GO", + Issuer: "ThinkPrinter-GO", Subject: "Login", Audience: ClaimStrings{user.Username}, ExpiresAt: NewNumericDate(time.Now().