From 804cc44f2e7840fe8680e42365e2aa4cd03d66ce Mon Sep 17 00:00:00 2001 From: qimiao <303176530@qq.com> Date: Fri, 3 Sep 2021 10:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E8=B7=B3=E5=87=BA=E7=9A=84=E4=B8=A4=E4=B8=AAbug?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=88=E4=B8=8D=E5=BD=B1=E5=93=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/system/sys_user.go | 1 + server/core/server_other.go | 1 + server/core/server_win.go | 1 + server/middleware/jwt.go | 1 - server/packfile/notUsePackFile.go | 1 + server/packfile/usePackFile.go | 1 + server/source/authority_menu.go | 2 +- server/source/user_authority.go.go | 2 +- server/utils/jwt.go | 2 +- server/utils/plugin/plugin_uinx.go | 3 +- web/package-lock.json | 160 ++++++++++++++--------------- 11 files changed, 89 insertions(+), 86 deletions(-) diff --git a/server/api/v1/system/sys_user.go b/server/api/v1/system/sys_user.go index 060d368c..8a59407a 100644 --- a/server/api/v1/system/sys_user.go +++ b/server/api/v1/system/sys_user.go @@ -74,6 +74,7 @@ func (b *BaseApi) tokenNext(c *gin.Context, user system.SysUser) { }, "登录成功", c) return } + if err, jwtStr := jwtService.GetRedisJWT(user.Username); err == redis.Nil { if err := jwtService.SetRedisJWT(token, user.Username); err != nil { global.GVA_LOG.Error("设置登录状态失败!", zap.Any("err", err)) diff --git a/server/core/server_other.go b/server/core/server_other.go index baa72220..ce159fe3 100644 --- a/server/core/server_other.go +++ b/server/core/server_other.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package core diff --git a/server/core/server_win.go b/server/core/server_win.go index ada3c4bf..60fb2681 100644 --- a/server/core/server_win.go +++ b/server/core/server_win.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package core diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go index adf82791..576a3da4 100644 --- a/server/middleware/jwt.go +++ b/server/middleware/jwt.go @@ -70,4 +70,3 @@ func JWTAuth() gin.HandlerFunc { c.Next() } } - diff --git a/server/packfile/notUsePackFile.go b/server/packfile/notUsePackFile.go index e54aad30..53871d6a 100644 --- a/server/packfile/notUsePackFile.go +++ b/server/packfile/notUsePackFile.go @@ -1,3 +1,4 @@ +//go:build !packfile // +build !packfile package packfile diff --git a/server/packfile/usePackFile.go b/server/packfile/usePackFile.go index 055f03dd..bb51bac3 100644 --- a/server/packfile/usePackFile.go +++ b/server/packfile/usePackFile.go @@ -1,3 +1,4 @@ +//go:build packfile // +build packfile package packfile diff --git a/server/source/authority_menu.go b/server/source/authority_menu.go index 710cae7b..1579bfd6 100644 --- a/server/source/authority_menu.go +++ b/server/source/authority_menu.go @@ -13,7 +13,7 @@ type authorityMenu struct{} //@author: [SliverHorn](https://github.com/SliverHorn) //@description: authority_menu 视图数据初始化 func (a *authorityMenu) Init() error { - if global.GVA_DB.Find(&[]system.SysMenu{}).RowsAffected > 0 { + if global.GVA_DB.Migrator().HasTable("authority_menu") && global.GVA_DB.Find(&[]system.SysMenu{}).RowsAffected > 0 { color.Danger.Println("\n[Mysql] --> authority_menu 视图已存在!") return nil } diff --git a/server/source/user_authority.go.go b/server/source/user_authority.go.go index c9bb6564..2bcda6df 100644 --- a/server/source/user_authority.go.go +++ b/server/source/user_authority.go.go @@ -21,7 +21,7 @@ var userAuthorityModel = []system.SysUseAuthority{ //@description: user_authority 数据初始化 func (a *userAuthority) Init() error { return global.GVA_DB.Model(&system.SysUseAuthority{}).Transaction(func(tx *gorm.DB) error { - if tx.Where("sys_user_id IN (1, 2)").Find(&[]AuthorityMenus{}).RowsAffected == 4 { + if tx.Where("sys_user_id IN (1, 2)").Find(&[]system.SysUseAuthority{}).RowsAffected == 4 { color.Danger.Println("\n[Mysql] --> sys_user_authority 表的初始数据已存在!") return nil } diff --git a/server/utils/jwt.go b/server/utils/jwt.go index a8d43d23..098d0f3c 100644 --- a/server/utils/jwt.go +++ b/server/utils/jwt.go @@ -68,4 +68,4 @@ func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error) { } -} \ No newline at end of file +} diff --git a/server/utils/plugin/plugin_uinx.go b/server/utils/plugin/plugin_uinx.go index dd42aa7d..5d234ec2 100644 --- a/server/utils/plugin/plugin_uinx.go +++ b/server/utils/plugin/plugin_uinx.go @@ -1,4 +1,5 @@ -//+build !windows +//go:build !windows +// +build !windows package plugin diff --git a/web/package-lock.json b/web/package-lock.json index 36e6f4c1..0c563c41 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1765,6 +1765,63 @@ "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=", "dev": true }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "ssri": { "version": "8.0.1", "resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz", @@ -1773,6 +1830,28 @@ "requires": { "minipass": "^3.1.1" } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.5.0", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz", + "integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + } } } }, @@ -11533,87 +11612,6 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.5.0", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz", - "integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "optional": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "optional": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "optional": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "optional": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "optional": true - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "optional": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "vue-particle-line": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz",