App.vue 1.83 KB
<template>
  <router-view />
</template>

<script setup>
import { nextTick, onMounted, watch} from 'vue'
import { handleThemeStyle } from '@/utils/theme'
import useSettingsStore from '@/store/modules/settings'
import ResetPwd from '@/views/system/user/profile/components/resetPwd'
import useUserStore from '@/store/modules/user'
import { getCurrentInstance } from '@vue/runtime-core'
import {useStorage} from "@vueuse/core";

const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const language= useStorage('language',0)

onMounted(() => {
  document.body.style.setProperty('--el-color-primary', '#453DEA')
  document.body.style.setProperty('--el-color-primary-light-3', '#8623FC')
  document.body.style.setProperty('--el-button-hover-bg-color', '#fff')
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
  })
})

watch(language,(val)=>{
  location.reload()
})

// watch(() => userStore.user?.changePassFlag, (val) => {
//   if (val === '1') {
//     proxy.$modal.confirm('密码长期未更新,请及时更新').then(() => {
//       proxy.$refs['resetPwdRef'].open()
//     })
//   }
// })

</script>

<style lang="scss">
:root {
  --el-color-golden: #946A12;
  --el-fill-color-light: #faf5f5;
  --el-button-hover-border-color: #94080B;
  --el-button-hover-bg-color: rgba(148, 8, 11, 0.3);
  --el-fill-color-lighter: #F6F9FE!important;
}

.box {
  width: 1600px;
  margin: auto;
}
@media screen and (max-width: 1650px) {
  .box {
    width: 1200px;
  }
}
@media screen and (max-width: 1200px) {
  .box {
    width: 860px;
  }
}
@media screen and (max-width: 900px) {
  .box {
    width: 750px;
  }
}

@font-face {
  font-family: 'YouSheBiaoTiHei';
  src: url("@/assets/fonts/YouSheBiaoTiHei-2.ttf");
}
@font-face {
  font-family: 'DIN Alternate';
  src: url("@/assets/fonts/DIN Alternate Bold.ttf");
}
</style>