fix locale 404 not default

This commit is contained in:
Jay
2017-04-05 15:36:29 +08:00
parent 34f2d0e24a
commit 8d8b4818ae
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ class PageRoot extends React.Component {
.then(response=>response.json())
.then(json => {
if(json.status != 1) return location.replace('/');
let lang = navigator
let slang = sessionStorage.getItem('lang');
let lang = slang || navigator
.language
.substring(0, 2);
fetch(`/locales/${lang}.json`).then(response => {