mirror of https://gitee.com/xiaonuobase/snowy
【更新】前端界面验证码配置后刷新模式更改,登录界面回车监听增加
parent
b546184f3f
commit
cd3b44e6ba
|
@ -1,28 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<a-config-provider :locale="locale">
|
<a-config-provider :locale="locale">
|
||||||
<router-view></router-view>
|
<router-view />
|
||||||
</a-config-provider>
|
</a-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="App">
|
<script setup name="App">
|
||||||
import i18n from '@/locales'
|
import i18n from '@/locales'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import config from '@/config'
|
|
||||||
import configApi from '@/api/dev/configApi'
|
|
||||||
import tool from '@/utils/tool'
|
|
||||||
|
|
||||||
store.commit('initTheme')
|
store.commit('initTheme')
|
||||||
const locale = i18n.global.messages[i18n.global.locale].lang
|
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>
|
</script>
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
v-model:value="ruleForm.validCode"
|
v-model:value="ruleForm.validCode"
|
||||||
:placeholder="$t('login.validLaceholder')"
|
:placeholder="$t('login.validLaceholder')"
|
||||||
size="large"
|
size="large"
|
||||||
|
@keyup.enter="login"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<verified-outlined class="login-icon-gray" />
|
<verified-outlined class="login-icon-gray" />
|
||||||
|
@ -104,6 +105,10 @@
|
||||||
import smCrypto from '@/utils/smCrypto'
|
import smCrypto from '@/utils/smCrypto'
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { afterLogin } from './util'
|
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 {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
|
@ -111,11 +116,10 @@
|
||||||
phoneLoginForm,
|
phoneLoginForm,
|
||||||
threeLogin
|
threeLogin
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeKey: 'userAccount',
|
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: '',
|
validCodeBase64: '',
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
account: 'superAdmin',
|
account: 'superAdmin',
|
||||||
|
@ -130,8 +134,8 @@
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
config: {
|
config: {
|
||||||
lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
|
lang: tool.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||||
theme: this.$TOOL.data.get('APP_THEME') || 'default'
|
theme: tool.data.get('APP_THEME') || 'default'
|
||||||
},
|
},
|
||||||
lang: [
|
lang: [
|
||||||
{
|
{
|
||||||
|
@ -160,12 +164,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.commit('clearViewTags')
|
store.commit('clearViewTags')
|
||||||
this.$store.commit('clearKeepLive')
|
store.commit('clearKeepLive')
|
||||||
this.$store.commit('clearIframeList')
|
store.commit('clearIframeList')
|
||||||
},
|
},
|
||||||
mounted() {
|
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: {
|
methods: {
|
||||||
// 通过开关加载内容
|
// 通过开关加载内容
|
||||||
|
|
|
@ -192,15 +192,12 @@
|
||||||
submitLoading.value = true
|
submitLoading.value = true
|
||||||
let submitParam = cloneDeep(formData.value)
|
let submitParam = cloneDeep(formData.value)
|
||||||
submitParam.SNOWY_SYS_LOGO = submitParam.SNOWY_SYS_LOGO[0]
|
submitParam.SNOWY_SYS_LOGO = submitParam.SNOWY_SYS_LOGO[0]
|
||||||
|
|
||||||
const param = Object.entries(submitParam).map((item) => {
|
const param = Object.entries(submitParam).map((item) => {
|
||||||
return {
|
return {
|
||||||
configKey: item[0],
|
configKey: item[0],
|
||||||
configValue: item[1]
|
configValue: item[1]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(JSON.stringify(param))
|
|
||||||
// 创建快捷方式
|
// 创建快捷方式
|
||||||
const shortcut = {
|
const shortcut = {
|
||||||
shortcut: menuTreeSelectRef.value.getSelectData()
|
shortcut: menuTreeSelectRef.value.getSelectData()
|
||||||
|
|
Loading…
Reference in New Issue