适配多语言
Squashed commit of the following: commit 632f86c0228c68391c01865c7576f3aa0408c102 Author: Sun <95302870@qq.com> Date: Sun Jan 7 14:47:55 2024 +0800 退出的时候清除appstore commit b9d805e49a3c6b2ad38bc8d527cb12cc8709012e Author: Sun <95302870@qq.com> Date: Sun Jan 7 13:55:20 2024 +0800 系统状态监控适配国际化 commit daece99723ec96d210241d2ca4e5a85dc5ae69bd Author: Sun <95302870@qq.com> Date: Sun Jan 7 13:09:46 2024 +0800 适配添加项目页面的国际化配置还有时钟的星期* commit 8ea2b2fe951f6266415c96a197cb8d00faef4058 Author: Sun <95302870@qq.com> Date: Sun Jan 7 12:01:55 2024 +0800 完成适配所有apps国际化 commit 21ef54e0d4afb10f560c8cb7aff666374afe0f87 Author: Sun <95302870@qq.com> Date: Sat Jan 6 21:36:07 2024 +0800 增加读取默认浏览器语言 commit 6f710bbebe63ab2800193f27c71e5c0034f11978 Author: Sun <95302870@qq.com> Date: Sat Jan 6 21:09:58 2024 +0800 登录页面增加语言选择选项 commit cb7c4a89a160ed3ef91ad566ec98e75325e7601f Author: Sun <95302870@qq.com> Date: Sat Jan 6 20:37:16 2024 +0800 首次尝试增加英文语言,并在我的信息设置 commit fb996e17cd11611d30c0e12feee00ddf7b225e32 Author: Sun <95302870@qq.com> Date: Sat Jan 6 18:22:40 2024 +0800 完成基础设置页面的语言国际化适配
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton, NCard, NForm, NFormItem, NGradientText, NInput, useMessage } from 'naive-ui'
|
||||
import { NButton, NCard, NForm, NFormItem, NGradientText, NInput, NSelect, useMessage } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { login } from '@/api'
|
||||
import { useAuthStore } from '@/store'
|
||||
import { useAppStore, useAuthStore } from '@/store'
|
||||
import { SvgIcon } from '@/components/common'
|
||||
import { router } from '@/router'
|
||||
import { t } from '@/locales'
|
||||
import { languageOptions } from '@/utils/defaultData'
|
||||
import type { Language } from '@/store/modules/app/helper'
|
||||
|
||||
// const userStore = useUserStore()
|
||||
const authStore = useAuthStore()
|
||||
const appStore = useAppStore()
|
||||
const ms = useMessage()
|
||||
const loading = ref(false)
|
||||
const languageValue = ref<Language>(appStore.language)
|
||||
|
||||
// const isShowCaptcha = ref<boolean>(false)
|
||||
// const isShowRegister = ref<boolean>(false)
|
||||
|
||||
@@ -45,11 +50,25 @@ function handleSubmit() {
|
||||
// 点击登录按钮触发
|
||||
loginPost()
|
||||
}
|
||||
|
||||
function handleChangeLanuage(value: Language) {
|
||||
languageValue.value = value
|
||||
appStore.setLanguage(value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-container">
|
||||
<NCard class="login-card" style="border-radius: 20px;">
|
||||
<div class="mb-5 flex items-center justify-end">
|
||||
<div class="mr-2">
|
||||
<SvgIcon icon="ion-language" style="width: 20;height: 20;" />
|
||||
</div>
|
||||
<div class="min-w-[100px]">
|
||||
<NSelect v-model:value="languageValue" size="small" :options="languageOptions" @update-value="handleChangeLanuage" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-title ">
|
||||
<NGradientText :size="30" type="success" class="!font-bold">
|
||||
{{ $t('common.appName') }}
|
||||
|
||||
Reference in New Issue
Block a user