【更新】前端界面验证码配置后刷新模式更改,登录界面回车监听增加

pull/90/head
小诺 2023-03-12 19:20:21 +08:00 committed by 俞宝山
parent b546184f3f
commit cd3b44e6ba
3 changed files with 23 additions and 27 deletions

View File

@ -1,28 +1,13 @@
<template>
<a-config-provider :locale="locale">
<router-view></router-view>
<router-view />
</a-config-provider>
</template>
<script setup name="App">
import i18n from '@/locales'
import store from '@/store'
import config from '@/config'
import configApi from '@/api/dev/configApi'
import tool from '@/utils/tool'
store.commit('initTheme')
const locale = i18n.global.messages[i18n.global.locale].lang
if (!tool.data.get('SNOWY_SYS_BASE_CONFIG')) {
let formData = ref(config.SYS_BASE_CONFIG)
configApi.configSysBaseList().then((data) => {
if (data) {
data.forEach((item) => {
formData.value[item.configKey] = item.configValue
})
tool.data.set('SNOWY_SYS_BASE_CONFIG', formData.value)
store.commit('SET_sysBaseConfig', formData.value)
}
})
}
</script>

View File

@ -64,6 +64,7 @@
v-model:value="ruleForm.validCode"
:placeholder="$t('login.validLaceholder')"
size="large"
@keyup.enter="login"
>
<template #prefix>
<verified-outlined class="login-icon-gray" />
@ -104,6 +105,10 @@
import smCrypto from '@/utils/smCrypto'
import { required } from '@/utils/formRules'
import { afterLogin } from './util'
import config from '@/config'
import configApi from '@/api/dev/configApi'
import tool from '@/utils/tool'
import store from '@/store'
export default {
name: 'Login',
@ -111,11 +116,10 @@
phoneLoginForm,
threeLogin
},
data() {
return {
activeKey: 'userAccount',
sysBaseConfig: this.$TOOL.data.get('SNOWY_SYS_BASE_CONFIG') || this.$store.state.global.sysBaseConfig,
sysBaseConfig: store.state.global.sysBaseConfig || tool.data.get('SNOWY_SYS_BASE_CONFIG'),
validCodeBase64: '',
ruleForm: {
account: 'superAdmin',
@ -130,8 +134,8 @@
},
loading: false,
config: {
lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
theme: this.$TOOL.data.get('APP_THEME') || 'default'
lang: tool.data.get('APP_LANG') || this.$CONFIG.LANG,
theme: tool.data.get('APP_THEME') || 'default'
},
lang: [
{
@ -160,12 +164,22 @@
}
},
created() {
this.$store.commit('clearViewTags')
this.$store.commit('clearKeepLive')
this.$store.commit('clearIframeList')
store.commit('clearViewTags')
store.commit('clearKeepLive')
store.commit('clearIframeList')
},
mounted() {
this.refreshSwitch()
let formData = ref(config.SYS_BASE_CONFIG)
configApi.configSysBaseList().then((data) => {
if (data) {
data.forEach((item) => {
formData.value[item.configKey] = item.configValue
})
tool.data.set('SNOWY_SYS_BASE_CONFIG', formData.value)
store.commit('SET_sysBaseConfig', formData.value)
this.refreshSwitch()
}
})
},
methods: {
//

View File

@ -192,15 +192,12 @@
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
submitParam.SNOWY_SYS_LOGO = submitParam.SNOWY_SYS_LOGO[0]
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
console.log(JSON.stringify(param))
//
const shortcut = {
shortcut: menuTreeSelectRef.value.getSelectData()