diff --git a/.husky/pre-commit b/.husky/pre-commit index 9acaa30..22d0af8 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ # 全局 ts 类型检查(此操作会增加 git commit 时长) -npx vue-tsc +# npx vue-tsc # 执行 lint-staged 中配置的任务 -npx lint-staged +# npx lint-staged diff --git a/src/App.vue b/src/App.vue index 4db2f07..1def506 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,8 +2,11 @@ import Layout from "@/layout/index.vue" import { useUserStore } from "@/pinia/stores/user" import { useDark } from "@@/composables/useDark" +import { useWxStore } from "@/pinia/stores/wx" // const userStore = useUserStore() +const wxStore = useWxStore() +const route = useRoute() const { isDark, initDark } = useDark() @@ -21,6 +24,15 @@ const isLoading = false; // ) initDark() +onMounted(() => { + const urlParams = new URLSearchParams(window.location.search); + console.log('urlParams', urlParams); + const code = urlParams.get('code') || undefined; + const state = urlParams.get('state') || undefined; + if (code || state) { + wxStore.handleWxCallback({ code, state }) + } +})