Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f6de22e8
authored
2024-03-07 19:33:02 +0800
by
华明祺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
语言切换
1 parent
8f61ec56
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
src/App.vue
src/layoutPc/components/AppHeader.vue
src/layoutPc/components/AppTop.vue
src/App.vue
View file @
f6de22e
...
...
@@ -4,15 +4,17 @@
</
template
>
<
script
setup
>
import
{
nextTick
,
onMounted
,
watch
}
from
'vue'
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'
)
...
...
@@ -24,6 +26,10 @@ onMounted(() => {
})
})
watch
(
language
,(
val
)
=>
{
location
.
reload
()
})
// watch(() => userStore.user?.changePassFlag, (val) => {
// if (val === '1') {
// proxy.$modal.confirm('密码长期未更新,请及时更新').then(() => {
...
...
src/layoutPc/components/AppHeader.vue
View file @
f6de22e
...
...
@@ -124,6 +124,8 @@ import Captcha from './captcha'
import
CaptchaSms
from
'./captchaSms'
import
cache
from
'@/plugins/cache'
import
locale
from
'element-plus/lib/locale/lang/zh-cn'
import
{
useStorage
}
from
"@vueuse/core"
;
const
router
=
useRouter
()
const
route
=
useRoute
()
const
{
proxy
}
=
getCurrentInstance
()
...
...
@@ -134,6 +136,9 @@ const loginForm = ref({})
const
drawer
=
ref
(
false
)
const
mode
=
ref
(
'horizontal'
)
const
language
=
ref
(
cache
.
local
.
get
(
'language'
)
||
0
)
const
language2
=
useStorage
(
'language'
,
0
)
onMounted
(()
=>
{
console
.
log
(
window
.
location
.
href
)
if
(
useUserStore
().
user
)
{
...
...
@@ -159,9 +164,9 @@ onMounted(() => {
// console.log(activeIndex.value)
})
function
changeLanguage
(
n
)
{
// language.value = n
cache
.
local
.
set
(
'language'
,
n
)
location
.
reload
(
)
proxy
.
$modal
.
loading
()
language2
.
value
=
n
// cache.local.set('language', n
)
}
function
showDrawer
()
{
drawer
.
value
=
true
...
...
src/layoutPc/components/AppTop.vue
View file @
f6de22e
...
...
@@ -95,6 +95,8 @@ import Captcha from './captcha'
import
CaptchaSms
from
'./captchaSms'
import
cache
from
'@/plugins/cache'
import
locale
from
'element-plus/lib/locale/lang/zh-cn'
import
{
useStorage
}
from
"@vueuse/core/index"
;
const
router
=
useRouter
()
const
route
=
useRoute
()
const
{
proxy
}
=
getCurrentInstance
()
...
...
@@ -105,6 +107,8 @@ const loginForm = ref({})
const
drawer
=
ref
(
false
)
const
mode
=
ref
(
'horizontal'
)
const
language
=
ref
(
cache
.
local
.
get
(
'language'
)
||
0
)
const
language2
=
useStorage
(
'language'
,
0
)
onMounted
(()
=>
{
console
.
log
(
window
.
location
.
href
)
if
(
useUserStore
().
user
)
{
...
...
@@ -130,9 +134,9 @@ onMounted(() => {
// console.log(activeIndex.value)
})
function
changeLanguage
(
n
)
{
// language.value = n
cache
.
local
.
set
(
'language'
,
n
)
location
.
reload
(
)
proxy
.
$modal
.
loading
()
language2
.
value
=
n
// cache.local.set('language', n
)
}
function
showDrawer
()
{
drawer
.
value
=
true
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment