| | |
| | | <script> |
| | | import { Navbar, Sidebar, AppMain } from './components' |
| | | import ResizeMixin from './mixin/ResizeHandler' |
| | | import { login } from "@/api/user"; |
| | | |
| | | export default { |
| | | name: 'Layout', |
| | |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | // 获取地址栏code |
| | | let code = this.$route.query.code; |
| | | if (code) { |
| | | this.getUserDate(code); |
| | | } |
| | | // else { |
| | | // this.$router.push("/login"); |
| | | // } |
| | | }, |
| | | methods: { |
| | | getUserDate(code) { |
| | | login({ |
| | | code: code, |
| | | }).then((res) => { |
| | | localStorage.setItem("user", JSON.stringify(res)); |
| | | }); |
| | | }, |
| | | handleClickOutside() { |
| | | this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) |
| | | } |