diff --git a/src/App.vue b/src/App.vue index bc3acbe..d66320c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,7 +10,7 @@ import { ElConfigProvider } from 'element-plus' import zh from 'element-plus/lib/locale/lang/zh-cn' // 中文语言 import en from 'element-plus/lib/locale/lang/en' // 英文语言 import tw from 'element-plus/lib/locale/lang/zh-tw' //繁体 - +import defaultSettings from '@/settings' const { proxy } = getCurrentInstance() const token = computed(() => { @@ -21,7 +21,8 @@ const lang = computed(() => { return useAppStore().lang }) const locale = ref(zh) -const size = ref('small') +const size = ref(defaultSettings.defaultSize) + size.value = useAppStore().size watch( token, @@ -32,8 +33,8 @@ watch( }, { immediate: true, - deep: true, - }, + deep: true + } ) watch( lang, @@ -49,7 +50,7 @@ watch( } }, { - immediate: true, - }, + immediate: true + } ) diff --git a/src/settings.js b/src/settings.js index 7112635..fedf9cc 100644 --- a/src/settings.js +++ b/src/settings.js @@ -71,5 +71,9 @@ export default { /** * 是否显示其他登录 */ - showOtherLogin: false + showOtherLogin: false, + /** + * 默认大小 + */ + defaultSize: 'default' } diff --git a/src/views/login.vue b/src/views/login.vue index f48c229..eba1526 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -104,9 +104,9 @@ const captchaOnOff = ref('') const register = ref(false) const redirect = ref() redirect.value = route.query.redirect -proxy.getConfigKey('sys.account.captchaOnOff').then((response) => { - captchaOnOff.value = response.data -}) +// proxy.getConfigKey('sys.account.captchaOnOff').then((response) => { +// captchaOnOff.value = response.data +// }) function handleLogin() { proxy.$refs.loginRef.validate((valid) => { @@ -147,6 +147,7 @@ function getCode() { getCodeImg().then((res) => { codeUrl.value = 'data:image/gif;base64,' + res.data.img loginForm.value.uuid = res.data.uuid + captchaOnOff.value = res.data.captchaOff }) }