对比新文件 |
| | |
| | | import request from '/@/utils/request'; |
| | | import { toFormData } from '/@/utils/util'; |
| | | |
| | | /** |
| | | * @summary description |
| | | */ |
| | | export const PostLogin = async (params, req: any = request) => { |
| | | return req({ |
| | | url: '/login', |
| | | method: 'POST', |
| | | data: params, |
| | | headers: { |
| | | 'Content-Type': 'application/x-www-form-urlencoded', |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @summary description |
| | | */ |
| | | export const PostLogout = async ( req:any = request) => { |
| | | return req({ |
| | | url: "/logout", |
| | | method: "POST", |
| | | }); |
| | | }; |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted } from 'vue'; |
| | | import asideNew from './waterLeftAside/asideNew.vue'; |
| | | import asideTitle from './waterLeftAside/asideTitle.vue'; |
| | | import { PostLogin } from '/@/api/ai/user'; |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts" name="layoutClassic"> |
| | | import { defineAsyncComponent, computed, ref, watch, nextTick, onMounted } from 'vue'; |
| | | import { useRoute } from 'vue-router'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { computed, defineAsyncComponent, nextTick, onMounted, ref, watch } from 'vue'; |
| | | import { useRoute } from 'vue-router'; |
| | | import { PostLogin } from '/@/api/ai/user'; |
| | | import { useThemeConfig } from '/@/stores/themeConfig'; |
| | | |
| | | const login = () => { |
| | | return PostLogin({ |
| | | user: 'tc', |
| | | pass: 'a', |
| | | }); |
| | | }; |
| | | |
| | | // 寮曞叆缁勪欢 |
| | | |
| | | const LayoutMain = defineAsyncComponent(() => import('/@/layout/component/main.vue')); |
| | | const LayoutMain = defineAsyncComponent(async () => { |
| | | try { |
| | | await login(); |
| | | } finally { |
| | | // eslint-disable-next-line no-unsafe-finally |
| | | return import('/@/layout/component/main.vue'); |
| | | } |
| | | }); |
| | | |
| | | // 瀹氫箟鍙橀噺鍐呭 |
| | | const layoutMainRef = ref<InstanceType<typeof LayoutMain>>(); |