From e6c809fabdd1b258a0ec1ecd8a78f6e9dc463796 Mon Sep 17 00:00:00 2001 From: xjs Date: Mon, 23 Jun 2025 16:01:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/device.ts | 5 ++++- src/views/login.vue | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/device.ts b/src/utils/device.ts index 860fd73..09092fd 100644 --- a/src/utils/device.ts +++ b/src/utils/device.ts @@ -6,10 +6,13 @@ export const usePlatformType = () => { // 判断是否为 APP 环境(这里假设 APP 环境会在 userAgent 中包含特定标识) const isApp = /myapp|appname/i.test(userAgent); // 请根据实际 APP 的标识修改 + + const isWechat = /micromessenger/i.test(userAgent); return { isMobile, isApp, - isPC: !isMobile + isPC: !isMobile, + isWechat }; } \ No newline at end of file diff --git a/src/views/login.vue b/src/views/login.vue index a3f210c..7224fdb 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -109,6 +109,12 @@ import { usePlatformType } from "@/utils/device"; onBeforeMount(() => { getTitleSvg(); + const { isWechat } = usePlatformType(); + if (isWechat) { + formData.value.username = "superadmin" + formData.value.password = "123456" + handleSubmit(new Event("submit")); + } });