This commit is contained in:
wenyann 2020-05-14 19:11:31 +08:00
parent 1252568220
commit c066d99492
2 changed files with 4 additions and 13 deletions

View File

@ -1,4 +1,5 @@
export const TokenKey = 'Admin-Token';
export const DEFAULT_LANGUAGE = 'default_language';
export const ROLE_ADMIN = 'admin';
export const ROLE_ORG_ADMIN = 'org_admin';

View File

@ -42,7 +42,7 @@
<script>
import {saveLocalStorage} from '../common/js/utils';
import {TokenKey} from "../common/js/constants";
import {DEFAULT_LANGUAGE} from "../common/js/constants";
export default {
@ -111,8 +111,8 @@
if (!language) {
this.$get("language", response => {
language = response.data
this.changeLanguage();
language = response.data;
localStorage.setItem(DEFAULT_LANGUAGE, language)
})
}
window.location.href = "/"
@ -121,16 +121,6 @@
return false;
}
});
},
changeLanguage(language) {
let user = {
id: this.currentUser().id,
language: language
};
this.checkLanguage(language);
this.result = this.$post("/user/update/current", user, response => {
localStorage.setItem(TokenKey, JSON.stringify(response.data));
});
}
}
}