优化系统配置

This commit is contained in:
不做码农 2022-10-28 21:58:57 +08:00
parent 0484b9c487
commit 1f5ce7d039
3 changed files with 16 additions and 10 deletions

View File

@ -10,7 +10,7 @@ import { ElConfigProvider } from 'element-plus'
import zh from 'element-plus/lib/locale/lang/zh-cn' // import zh from 'element-plus/lib/locale/lang/zh-cn' //
import en from 'element-plus/lib/locale/lang/en' // import en from 'element-plus/lib/locale/lang/en' //
import tw from 'element-plus/lib/locale/lang/zh-tw' // import tw from 'element-plus/lib/locale/lang/zh-tw' //
import defaultSettings from '@/settings'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const token = computed(() => { const token = computed(() => {
@ -21,7 +21,8 @@ const lang = computed(() => {
return useAppStore().lang return useAppStore().lang
}) })
const locale = ref(zh) const locale = ref(zh)
const size = ref('small') const size = ref(defaultSettings.defaultSize)
size.value = useAppStore().size size.value = useAppStore().size
watch( watch(
token, token,
@ -32,8 +33,8 @@ watch(
}, },
{ {
immediate: true, immediate: true,
deep: true, deep: true
}, }
) )
watch( watch(
lang, lang,
@ -49,7 +50,7 @@ watch(
} }
}, },
{ {
immediate: true, immediate: true
}, }
) )
</script> </script>

View File

@ -71,5 +71,9 @@ export default {
/** /**
* 是否显示其他登录 * 是否显示其他登录
*/ */
showOtherLogin: false showOtherLogin: false,
/**
* 默认大小
*/
defaultSize: 'default'
} }

View File

@ -104,9 +104,9 @@ const captchaOnOff = ref('')
const register = ref(false) const register = ref(false)
const redirect = ref() const redirect = ref()
redirect.value = route.query.redirect redirect.value = route.query.redirect
proxy.getConfigKey('sys.account.captchaOnOff').then((response) => { // proxy.getConfigKey('sys.account.captchaOnOff').then((response) => {
captchaOnOff.value = response.data // captchaOnOff.value = response.data
}) // })
function handleLogin() { function handleLogin() {
proxy.$refs.loginRef.validate((valid) => { proxy.$refs.loginRef.validate((valid) => {
@ -147,6 +147,7 @@ function getCode() {
getCodeImg().then((res) => { getCodeImg().then((res) => {
codeUrl.value = 'data:image/gif;base64,' + res.data.img codeUrl.value = 'data:image/gif;base64,' + res.data.img
loginForm.value.uuid = res.data.uuid loginForm.value.uuid = res.data.uuid
captchaOnOff.value = res.data.captchaOff
}) })
} }