提交 5bee1120 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

Merge remote-tracking branch 'origin/update' into update

......@@ -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)
}
}
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""`
}
......@@ -61,7 +61,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(),
......
......@@ -156,7 +156,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(),
......@@ -245,7 +245,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(),
......
......@@ -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
}
......
......@@ -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 {
......
<template>
<span class="headerAvatar">
<template v-if="picType === 'avatar'">
<el-avatar v-if="userInfo.headerImg" :size="24" :src="avatar" />
<el-avatar v-else :size="24" :src="require('@/assets/noBody.png')" />
<el-avatar v-if="userInfo.headerImg" :size="30" :src="avatar" />
<el-avatar v-else :size="30" :src="noAvatar" />
</template>
<template v-if="picType === 'img'">
<img v-if="userInfo.headerImg" :src="avatar" class="avatar">
<img v-else :src="require('@/assets/noBody.png')" class="avatar">
<img v-else :src="noAvatar" class="avatar">
</template>
<template v-if="picType === 'file'">
<img :src="file" class="file">
......@@ -15,6 +15,7 @@
</template>
<script>
import noAvatar from '@/assets/noBody.png'
import { mapGetters } from 'vuex'
const path = import.meta.env.VITE_BASE_API
export default {
......@@ -33,6 +34,7 @@ export default {
},
data() {
return {
noAvatar: noAvatar,
path: path + '/'
}
},
......
.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
......@@ -7,7 +7,7 @@
class="login_panle_form_title_logo"
:src="$GIN_VUE_ADMIN.appLogo"
alt
/>
>
<p class="login_panle_form_title_p">{{ $GIN_VUE_ADMIN.appName }}</p>
</div>
<el-form
......@@ -50,19 +50,20 @@
:src="picPath"
alt="请输入验证码"
@click="loginVerify()"
/>
>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" style="width: 46%" @click="checkInit"
>前往初始化</el-button
>
<el-button
type="primary"
style="width: 46%"
@click="checkInit"
>前往初始化</el-button>
<el-button
type="primary"
style="width: 46%; margin-left: 8%"
@click="submitForm"
>登 录</el-button
>
>登 录</el-button>
</el-form-item>
</el-form>
</div>
......@@ -70,16 +71,16 @@
<div class="login_panle_foot">
<div class="links">
<a href="http://doc.henrongyi.top/">
<img src="@/assets/docs.png" class="link-icon" />
<img src="@/assets/docs.png" class="link-icon">
</a>
<a href="https://www.yuque.com/flipped-aurora/">
<img src="@/assets/yuque.png" class="link-icon" />
<img src="@/assets/yuque.png" class="link-icon">
</a>
<a href="https://github.com/flipped-aurora/gin-vue-admin">
<img src="@/assets/github.png" class="link-icon" />
<img src="@/assets/github.png" class="link-icon">
</a>
<a href="https://space.bilibili.com/322210472">
<img src="@/assets/video.png" class="link-icon" />
<img src="@/assets/video.png" class="link-icon">
</a>
</div>
<div class="copyright">
......@@ -124,8 +125,6 @@ export default {
password: [{ validator: checkPassword, trigger: 'blur' }],
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' },
{
min: 5,
max: 6,
message: '验证码格式不正确',
trigger: 'blur',
}]
......@@ -180,6 +179,8 @@ export default {
},
loginVerify() {
captcha({}).then((ele) => {
this.rules.captcha[1].max = ele.data.captchaLength
this.rules.captcha[1].min = ele.data.captchaLength
this.picPath = ele.data.picPath
this.loginForm.captchaId = ele.data.captchaId
})
......@@ -189,9 +190,6 @@ export default {
</script>
<style lang="scss" scoped>
@import "@/style/newLogin.scss";
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册