From 5e18f94f9a72763b8a4f5e2e8ddeb607b9859702 Mon Sep 17 00:00:00 2001 From: piexl <303176530@qq.com> Date: Mon, 8 Nov 2021 14:36:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=80=A7=E5=88=AB?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=88=9D=E5=A7=8B=E6=95=B0=E6=8D=AE=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=BD=9C=E5=BA=9F=E6=97=A0=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#791=20=E5=8F=98=E6=9B=B4=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=80=BC=E4=B8=BAundefined=20#792?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/template/web/form.vue.tpl | 2 +- server/resource/template/web/table.vue.tpl | 4 ++-- server/service/system/sys_dictionary.go | 2 +- server/source/dictionary_details.go | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/resource/template/web/form.vue.tpl b/server/resource/template/web/form.vue.tpl index c3486c13..dc607dae 100644 --- a/server/resource/template/web/form.vue.tpl +++ b/server/resource/template/web/form.vue.tpl @@ -63,7 +63,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType }} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), diff --git a/server/resource/template/web/table.vue.tpl b/server/resource/template/web/table.vue.tpl index 5b0c1fa5..2999607e 100644 --- a/server/resource/template/web/table.vue.tpl +++ b/server/resource/template/web/table.vue.tpl @@ -158,7 +158,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType}} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), @@ -249,7 +249,7 @@ export default { {{.FieldJson}}: '', {{- end }} {{- if eq .FieldType "int" }} - {{.FieldJson}}: 0, + {{.FieldJson}}: {{- if .DictType }} undefined{{ else }} 0{{- end }}, {{- end }} {{- if eq .FieldType "time.Time" }} {{.FieldJson}}: new Date(), diff --git a/server/service/system/sys_dictionary.go b/server/service/system/sys_dictionary.go index 4dfc9601..d2be5bfe 100644 --- a/server/service/system/sys_dictionary.go +++ b/server/service/system/sys_dictionary.go @@ -68,7 +68,7 @@ func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *s //@return: err error, sysDictionary model.SysDictionary func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint) (err error, sysDictionary system.SysDictionary) { - err = global.GVA_DB.Where("type = ? OR id = ?", Type, Id).Preload("SysDictionaryDetails").First(&sysDictionary).Error + err = global.GVA_DB.Where("type = ? OR id = ? and status = ?", Type, Id, true).Preload("SysDictionaryDetails", "status = ?", true).First(&sysDictionary).Error return } diff --git a/server/source/dictionary_details.go b/server/source/dictionary_details.go index 96066a32..254fbe5e 100644 --- a/server/source/dictionary_details.go +++ b/server/source/dictionary_details.go @@ -41,6 +41,8 @@ func (d *dictionaryDetail) Init() error { {global.GVA_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longblob", 8, status, 8, 5}, {global.GVA_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longtext", 9, status, 9, 5}, {global.GVA_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "tinyint", 0, status, 0, 6}, + {global.GVA_MODEL{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "男", 0, status, 0, 1}, + {global.GVA_MODEL{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "女", 1, status, 1, 1}, } return global.GVA_DB.Transaction(func(tx *gorm.DB) error { if tx.Where("id IN ?", []int{1, 23}).Find(&[]system.SysDictionaryDetail{}).RowsAffected == 2 { From ef67dded9f1011ef2c1a7fd90fedc53387530f0a Mon Sep 17 00:00:00 2001 From: piexl <303176530@qq.com> Date: Tue, 9 Nov 2021 11:37:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=A0=A1=E9=AA=8C=E8=A7=84=E5=88=99=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=AB=AF=E9=85=8D=E7=BD=AE=E4=B8=80=E8=87=B4?= =?UTF-8?q?=20#794?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/system/sys_captcha.go | 5 +- server/model/system/response/sys_captcha.go | 5 +- web/src/style/login.scss | 128 -------------------- web/src/view/login/index.vue | 30 +++-- 4 files changed, 20 insertions(+), 148 deletions(-) delete mode 100644 web/src/style/login.scss diff --git a/server/api/v1/system/sys_captcha.go b/server/api/v1/system/sys_captcha.go index f07587d5..8ca800e9 100644 --- a/server/api/v1/system/sys_captcha.go +++ b/server/api/v1/system/sys_captcha.go @@ -34,8 +34,9 @@ func (b *BaseApi) Captcha(c *gin.Context) { response.FailWithMessage("验证码获取失败", c) } else { response.OkWithDetailed(systemRes.SysCaptchaResponse{ - CaptchaId: id, - PicPath: b64s, + CaptchaId: id, + PicPath: b64s, + CaptchaLength: global.GVA_CONFIG.Captcha.KeyLong, }, "验证码获取成功", c) } } diff --git a/server/model/system/response/sys_captcha.go b/server/model/system/response/sys_captcha.go index 9e78035a..4d482f9c 100644 --- a/server/model/system/response/sys_captcha.go +++ b/server/model/system/response/sys_captcha.go @@ -1,6 +1,7 @@ package response type SysCaptchaResponse struct { - CaptchaId string `json:"captchaId"` - PicPath string `json:"picPath"` + CaptchaId string `json:"captchaId"` + PicPath string `json:"picPath"` + CaptchaLength int `json:"captchaLength""` } diff --git a/web/src/style/login.scss b/web/src/style/login.scss deleted file mode 100644 index 3c037ec8..00000000 --- a/web/src/style/login.scss +++ /dev/null @@ -1,128 +0,0 @@ -.login-register-box { - height: 100vh; - .login-box { - width: 40vw; - position: absolute; - left: 50%; - margin-left: -22vw; - top: 5vh; - .logo { - height: 35vh; - width: 35vh; - } - } -} - -.link-icon { - width: 20px; - min-width: 20px; - height: 20px; - border-radius: 10px; -} - -.vPic { - width: 33%; - height: 38px; - float: right !important; - background: #ccc; - img { - cursor: pointer; - vertical-align: middle; - } -} - -.logo_login { - width: 100px; -} - -#userLayout.user-layout-wrapper { - height: 100%; - position: relative; - &.mobile { - .container { - .main { - max-width: 368px; - width: 98%; - } - } - } - .container { - position: relative; - overflow: auto; - width: 100%; - min-height: 100%; - background: #f0f2f5 url(@/assets/background.svg) no-repeat 50%; - background-size: 100%; - padding: 110px 0 144px; - a { - text-decoration: none; - } - .top { - text-align: center; - margin-top: -40px; - .header { - height: 44px; - line-height: 44px; - margin-bottom: 30px; - .badge { - position: absolute; - display: inline-block; - line-height: 1; - vertical-align: middle; - margin-left: -12px; - margin-top: -10px; - opacity: 0.8; - } - .logo { - height: 44px; - vertical-align: top; - margin-right: 16px; - border-style: none; - } - .title { - font-size: 33px; - color: rgba(0, 0, 0, 0.85); - font-family: Avenir, "Helvetica Neue", Arial, Helvetica, sans-serif; - font-weight: 600; - position: relative; - top: 2px; - } - } - .desc { - font-size: 14px; - color: rgba(0, 0, 0, 0.45); - margin-top: 12px; - } - } - .main { - min-width: 260px; - width: 368px; - margin: 0 auto; - } - .footer { - position: relative; - width: 100%; - padding: 0 20px; - margin: 40px 0 10px; - text-align: center; - .links { - margin-bottom: 8px; - font-size: 14px; - width: 330px; - display: inline-flex; - flex-direction: row; - justify-content: space-between; - padding-right: 40px; - a { - color: rgba(0, 0, 0, 0.45); - transition: all 0.3s; - } - } - .copyright { - color: rgba(0, 0, 0, 0.45); - font-size: 14px; - padding-right: 40px; - } - } - } -} \ No newline at end of file diff --git a/web/src/view/login/index.vue b/web/src/view/login/index.vue index 0369d437..080698be 100644 --- a/web/src/view/login/index.vue +++ b/web/src/view/login/index.vue @@ -7,7 +7,7 @@ class="login_panle_form_title_logo" :src="$GIN_VUE_ADMIN.appLogo" alt - /> + >

{{ $GIN_VUE_ADMIN.appName }}

+ > - 前往初始化 + 前往初始化 登 录 + >登 录 @@ -70,16 +71,16 @@