You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
duoji-frontend/src/App.vue

46 lines
1.2 KiB
Vue

6 years ago
<template>
<div id="app">
<router-view />
</div>
</template>
6 years ago
<script>
export default {
mounted() {
window.onmessage = e => {
if (!e.data.id) return;
sessionStorage.setItem("postMessage", e.data.id);
6 years ago
if (e.data.userInfo && e.data.userInfo.id) {
6 years ago
if (
e.data.userInfo.permissionList.some(
item => item.rights === "duojiSystem"
)
) {
6 years ago
let authList = this.$utils.translateDataToTree(
e.data.userInfo.permissionList,
'duojiSystem'
6 years ago
);
e.data.userInfo.permissionList = this.$utils.treeToArray(
authList
);
} else {
e.data.userInfo.permissionList = [];
}
localStorage.setItem(
"userInfo",
JSON.stringify(e.data.userInfo)
);
} else {
localStorage.clear();
}
};
}
};
</script>
6 years ago
<style lang="scss">
@import "style/common/reset.css";
@import "style/common/layout";
@import "style/common/form";
</style>