|
@@ -16,34 +16,36 @@ import { queryTeacherInfo } from "@/api/app";
|
|
|
export default {
|
|
|
name: "app",
|
|
|
async created() {
|
|
|
- const whiteList = ["/order"];
|
|
|
- const routePath = this.$route.path;
|
|
|
- if(whiteList.includes(routePath)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- let Authorization = this.getQueryVariable('Authorization') || null;
|
|
|
- if(window.location.hash.indexOf("+") >= 0) {
|
|
|
- Authorization = Authorization ? Authorization.split('+')[1] : null
|
|
|
- Authorization = ('bearer ' + Authorization)
|
|
|
- } else {
|
|
|
- Authorization = decodeURI(Authorization)
|
|
|
- }
|
|
|
- if (Authorization && Authorization != 'null') {
|
|
|
- localStorage.setItem("Authorization", Authorization);
|
|
|
- localStorage.setItem("userInfo", Authorization);
|
|
|
- }
|
|
|
- const auth = localStorage.getItem("Authorization") || "";
|
|
|
- const userInfo = localStorage.getItem("userInfo") || "";
|
|
|
- if (userInfo || auth) {
|
|
|
- await queryTeacherInfo().then((res) => {
|
|
|
- const result = res.data || null;
|
|
|
- const tenantId = result.data.tenantId || 0;
|
|
|
- sessionStorage.setItem("tenantId", tenantId);
|
|
|
- });
|
|
|
+ const whiteList = ["#/order"];
|
|
|
+ // const routePath = this.$route.path;
|
|
|
+ const locationHash = window.location.hash;
|
|
|
+ console.log(this.$route.path, locationHash);
|
|
|
+ if (locationHash.includes('#/order') == -1) {
|
|
|
+ console.log('true')
|
|
|
+ try {
|
|
|
+ let Authorization = this.getQueryVariable("Authorization") || null;
|
|
|
+ if (window.location.hash.indexOf("+") >= 0) {
|
|
|
+ Authorization = Authorization ? Authorization.split("+")[1] : null;
|
|
|
+ Authorization = "bearer " + Authorization;
|
|
|
+ } else {
|
|
|
+ Authorization = decodeURI(Authorization);
|
|
|
+ }
|
|
|
+ if (Authorization && Authorization != "null") {
|
|
|
+ localStorage.setItem("Authorization", Authorization);
|
|
|
+ localStorage.setItem("userInfo", Authorization);
|
|
|
+ }
|
|
|
+ const auth = localStorage.getItem("Authorization") || "";
|
|
|
+ const userInfo = localStorage.getItem("userInfo") || "";
|
|
|
+ if (userInfo || auth) {
|
|
|
+ await queryTeacherInfo().then((res) => {
|
|
|
+ const result = res.data || null;
|
|
|
+ const tenantId = result.data.tenantId || 0;
|
|
|
+ sessionStorage.setItem("tenantId", tenantId);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
}
|
|
|
- } catch(e) {
|
|
|
- console.log(e)
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|