From cd3b44e6bab5223a63279f0a5dc00bf37fa2f064 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E8=AF=BA?= <1253070437@qq.com>
Date: Sun, 12 Mar 2023 19:20:21 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E5=89=8D?=
=?UTF-8?q?=E7=AB=AF=E7=95=8C=E9=9D=A2=E9=AA=8C=E8=AF=81=E7=A0=81=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E5=90=8E=E5=88=B7=E6=96=B0=E6=A8=A1=E5=BC=8F=E6=9B=B4?=
=?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2=E5=9B=9E?=
=?UTF-8?q?=E8=BD=A6=E7=9B=91=E5=90=AC=E5=A2=9E=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
snowy-admin-web/src/App.vue | 17 +----------
.../src/views/auth/login/login.vue | 30 ++++++++++++++-----
.../src/views/dev/config/sysConfig.vue | 3 --
3 files changed, 23 insertions(+), 27 deletions(-)
diff --git a/snowy-admin-web/src/App.vue b/snowy-admin-web/src/App.vue
index 8822efca..75820d82 100644
--- a/snowy-admin-web/src/App.vue
+++ b/snowy-admin-web/src/App.vue
@@ -1,28 +1,13 @@
-
+
diff --git a/snowy-admin-web/src/views/auth/login/login.vue b/snowy-admin-web/src/views/auth/login/login.vue
index 44b784da..41cbafe7 100644
--- a/snowy-admin-web/src/views/auth/login/login.vue
+++ b/snowy-admin-web/src/views/auth/login/login.vue
@@ -64,6 +64,7 @@
v-model:value="ruleForm.validCode"
:placeholder="$t('login.validLaceholder')"
size="large"
+ @keyup.enter="login"
>
@@ -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: {
// 通过开关加载内容
diff --git a/snowy-admin-web/src/views/dev/config/sysConfig.vue b/snowy-admin-web/src/views/dev/config/sysConfig.vue
index 0452ac7a..b30f0242 100644
--- a/snowy-admin-web/src/views/dev/config/sysConfig.vue
+++ b/snowy-admin-web/src/views/dev/config/sysConfig.vue
@@ -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()