Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gjjs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhouqian
vue-gjjs
Commits
97eb98a7
Commit
97eb98a7
authored
Apr 15, 2022
by
吴佳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://114.115.138.98:8900/fukai/vue-gjjs
parents
140c5078
a3906e5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
index.js
src/lang/index.js
+12
-0
lang.js
src/service/business/lang.js
+6
-0
Header.vue
src/views/Layout/Header.vue
+15
-4
No files found.
src/lang/index.js
View file @
97eb98a7
...
...
@@ -3,8 +3,12 @@ import VueI18n from "vue-i18n";
import
Cookies
from
"js-cookie"
;
import
elementEnLocale
from
"element-ui/lib/locale/lang/en"
;
// element-ui lang
import
elementZhLocale
from
"element-ui/lib/locale/lang/zh-CN"
;
// element-ui lang
import
elementThLocale
from
"element-ui/lib/locale/lang/th"
;
// element-ui lang
import
elementViLocale
from
"element-ui/lib/locale/lang/vi"
;
// element-ui lang
import
enLocale
from
"./local/en/"
;
import
zhLocale
from
"./local/zh/"
;
import
thLocale
from
"./local/en/"
;
//TODO 本地th暂无
import
viLocale
from
"./local/en/"
;
//TODO 本地vi暂无
/**
* 详细文档
...
...
@@ -21,6 +25,14 @@ const messages = {
...
zhLocale
,
...
elementZhLocale
,
},
th
:
{
...
thLocale
,
...
elementThLocale
,
},
vi
:
{
...
viLocale
,
...
elementViLocale
,
},
};
export
function
getLanguage
()
{
const
chooseLanguage
=
Cookies
.
get
(
"language"
);
...
...
src/service/business/lang.js
0 → 100644
View file @
97eb98a7
import
Api
from
"~/service/Api"
export
function
changeLang
(
data
)
{
return
Api
.
post
(
'/business/lang/changeLang'
,
data
)
}
\ No newline at end of file
src/views/Layout/Header.vue
View file @
97eb98a7
...
...
@@ -122,6 +122,9 @@
<
script
>
import
cPage
from
"../../components/c-page.vue"
;
import
Api
from
"~/service/Api"
;
import
{
changeLang
}
from
"~/service/business/lang"
;
export
default
{
components
:
{
cPage
},
data
()
{
...
...
@@ -146,6 +149,8 @@ export default {
languageOptions
:
[
{
lang
:
"zh"
,
shortName
:
"中文"
,
fullName
:
"中文"
},
{
lang
:
"en"
,
shortName
:
"En"
,
fullName
:
"English"
},
{
lang
:
"th"
,
shortName
:
"ไทย"
,
fullName
:
"ภาษาไทย"
},
{
lang
:
"vi"
,
shortName
:
"Tiếng Việt"
,
fullName
:
"Tiếng Việt"
},
],
};
},
...
...
@@ -175,10 +180,16 @@ export default {
this
.
$router
.
push
(
"/login"
);
// window.location.href = "/#/login"
},
handleLang
(
lang
)
{
this
.
$i18n
.
locale
=
lang
;
this
.
$store
.
dispatch
(
"I18n/setLang"
,
lang
);
this
.
langSelectVisible
=
false
;
async
handleLang
(
lang
)
{
const
data
=
{
lang
:
lang
}
let
rtnmsg
=
await
changeLang
(
data
)
if
(
rtnmsg
.
respCode
==
SUCCESS
)
{
this
.
$i18n
.
locale
=
lang
;
this
.
$store
.
dispatch
(
"I18n/setLang"
,
lang
);
this
.
langSelectVisible
=
false
;
}
},
showLogoutDialog
(
flg
)
{
// this.$refs.logoutform.show(flg);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment