Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sky96111 committed Oct 20, 2023
1 parent fec9d1b commit cb982b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 全新JWB打印系统

ThinkPrint-GO
ThinkPrinter-GO

## 简介

ThinkPrint-GO是一个基于Golang的全新JWB打印系统,它的前身是ThinkPrint-python
ThinkPrinter-GO是一个基于Golang的全新JWB打印系统,它的前身是ThinkPrint-python

本项目采用纯Golang重写,前后端分离设计。

Expand Down Expand Up @@ -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``

### 配置文件注解

Expand Down
5 changes: 3 additions & 2 deletions router/handler/upload.go
Original file line number Diff line number Diff line change
@@ -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 批量上传文件
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions tools/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down

0 comments on commit cb982b9

Please sign in to comment.