refactor(App.vue): 清理无用代码并添加早期返回
移除未使用的导入和计算属性,添加早期返回优化onMounted逻辑
Showing
1 changed file
with
3 additions
and
5 deletions
| ... | @@ -16,8 +16,8 @@ | ... | @@ -16,8 +16,8 @@ |
| 16 | </template> | 16 | </template> |
| 17 | 17 | ||
| 18 | <script setup> | 18 | <script setup> |
| 19 | -import { mainStore, useTitle } from "@/utils/generatePackage"; | 19 | +import { mainStore } from "@/utils/generatePackage"; |
| 20 | -import { computed, ref, watchEffect, onMounted, onUnmounted } from "vue"; | 20 | +import { computed, ref, onMounted, onUnmounted } from "vue"; |
| 21 | import { useRouter } from "vue-router"; | 21 | import { useRouter } from "vue-router"; |
| 22 | // import { Toast } from "vant"; | 22 | // import { Toast } from "vant"; |
| 23 | // 会根据配置判断是否显示调试控件 | 23 | // 会根据配置判断是否显示调试控件 |
| ... | @@ -38,7 +38,6 @@ import { useAuthRedirect } from '@/composables'; | ... | @@ -38,7 +38,6 @@ import { useAuthRedirect } from '@/composables'; |
| 38 | 38 | ||
| 39 | // 使用 include + pinia 状态管理动态缓存页面 | 39 | // 使用 include + pinia 状态管理动态缓存页面 |
| 40 | const store = mainStore(); | 40 | const store = mainStore(); |
| 41 | -const keepPages = computed(() => store.getKeepPages); | ||
| 42 | // 表单配置和授权判断完成前,先只显示加载态,避免用户先看到表单又被授权回跳打断 | 41 | // 表单配置和授权判断完成前,先只显示加载态,避免用户先看到表单又被授权回跳打断 |
| 43 | const app_bootstrap_ready = ref(false); | 42 | const app_bootstrap_ready = ref(false); |
| 44 | 43 | ||
| ... | @@ -63,8 +62,6 @@ const $router = useRouter(); | ... | @@ -63,8 +62,6 @@ const $router = useRouter(); |
| 63 | // className: 'zIndex' | 62 | // className: 'zIndex' |
| 64 | // }); | 63 | // }); |
| 65 | 64 | ||
| 66 | -// web端判断 | ||
| 67 | -const is_pc = computed(() => wxInfo().isPC); | ||
| 68 | // 微信端判断 | 65 | // 微信端判断 |
| 69 | const is_wx = computed(() => wxInfo().isWeiXin); | 66 | const is_wx = computed(() => wxInfo().isWeiXin); |
| 70 | // iframe模式判断 | 67 | // iframe模式判断 |
| ... | @@ -145,6 +142,7 @@ onMounted(async () => { | ... | @@ -145,6 +142,7 @@ onMounted(async () => { |
| 145 | data_id | 142 | data_id |
| 146 | } | 143 | } |
| 147 | }); | 144 | }); |
| 145 | + return; | ||
| 148 | } | 146 | } |
| 149 | // 没有授权判断 | 147 | // 没有授权判断 |
| 150 | let open_auth = form_setting.wxzq_enable && !form_setting.x_field_weixin_openid; | 148 | let open_auth = form_setting.wxzq_enable && !form_setting.x_field_weixin_openid; | ... | ... |
-
Please register or login to post a comment