Skip to content

Commit 7c33fb1

Browse files
authored
Merge branch 'flipped-aurora:main' into main
2 parents 53a9d69 + 5be3293 commit 7c33fb1

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

server/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ system:
8787
router-prefix: ""
8888
# 严格角色模式 打开后权限将会存在上下级关系
8989
use-strict-auth: false
90-
# 自动迁移数据库表结构,生产环境建议设为false,手动迁移
90+
# 禁用自动迁移数据库表结构,生产环境建议设为true,手动迁移
9191
disable-auto-migrate: false
9292

9393
# captcha configuration

server/service/system/auto_code_package.go

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ package system
33
import (
44
"context"
55
"fmt"
6+
"go/token"
7+
"os"
8+
"path/filepath"
9+
"strings"
10+
"text/template"
11+
612
"github.com/flipped-aurora/gin-vue-admin/server/global"
713
common "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
814
model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -11,12 +17,7 @@ import (
1117
"github.com/flipped-aurora/gin-vue-admin/server/utils/ast"
1218
"github.com/flipped-aurora/gin-vue-admin/server/utils/autocode"
1319
"github.com/pkg/errors"
14-
"go/token"
1520
"gorm.io/gorm"
16-
"os"
17-
"path/filepath"
18-
"strings"
19-
"text/template"
2021
)
2122

2223
var AutoCodePackage = new(autoCodePackage)
@@ -162,7 +163,6 @@ func (s *autoCodePackage) All(ctx context.Context) (entities []model.SysAutoCode
162163
"api": true,
163164
"config": true,
164165
"initialize": true,
165-
"model": true,
166166
"plugin": true,
167167
"router": true,
168168
"service": true,
@@ -179,14 +179,25 @@ func (s *autoCodePackage) All(ctx context.Context) (entities []model.SysAutoCode
179179
}
180180
}
181181
}
182-
if len(dirNameMap) != 0 {
183-
continue
182+
183+
var desc string
184+
if len(dirNameMap) == 0 {
185+
// 完全符合标准结构
186+
desc = "系统自动读取" + pluginDir[i].Name() + "插件,使用前请确认是否为v2版本插件"
187+
} else {
188+
// 缺少某些结构,生成警告描述
189+
var missingDirs []string
190+
for dirName := range dirNameMap {
191+
missingDirs = append(missingDirs, dirName)
192+
}
193+
desc = fmt.Sprintf("系统自动读取,但是缺少 %s 结构,不建议自动化和mcp使用", strings.Join(missingDirs, "、"))
184194
}
195+
185196
pluginPackage := model.SysAutoCodePackage{
186197
PackageName: pluginDir[i].Name(),
187198
Template: "plugin",
188199
Label: pluginDir[i].Name() + "插件",
189-
Desc: "系统自动读取" + pluginDir[i].Name() + "插件,使用前请确认是否为v2版本插件",
200+
Desc: desc,
190201
Module: global.GVA_CONFIG.AutoCode.Module,
191202
}
192203
plugin = append(plugin, pluginPackage)

web/src/view/login/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@
179179
// 获取验证码
180180
const loginVerify = async () => {
181181
const ele = await captcha()
182-
const lengthFromServer = Number(ele.data?.captchaLength) || 0
183-
captchaRequiredLength.value = Math.max(6, lengthFromServer)
182+
captchaRequiredLength.value = Number(ele.data?.captchaLength) || 0
184183
picPath.value = ele.data?.picPath
185184
loginFormData.captchaId = ele.data?.captchaId
186185
loginFormData.openCaptcha = ele.data?.openCaptcha

0 commit comments

Comments
 (0)