feat: 微信自动登陆

master
xjs 2025-06-23 16:01:46 +08:00
parent 1037562c5f
commit e6c809fabd
2 changed files with 10 additions and 1 deletions

View File

@ -7,9 +7,12 @@ 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
};
}

View File

@ -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"));
}
});
</script>