feat: 微信自动登陆
parent
1037562c5f
commit
e6c809fabd
|
|
@ -7,9 +7,12 @@ export const usePlatformType = () => {
|
||||||
// 判断是否为 APP 环境(这里假设 APP 环境会在 userAgent 中包含特定标识)
|
// 判断是否为 APP 环境(这里假设 APP 环境会在 userAgent 中包含特定标识)
|
||||||
const isApp = /myapp|appname/i.test(userAgent); // 请根据实际 APP 的标识修改
|
const isApp = /myapp|appname/i.test(userAgent); // 请根据实际 APP 的标识修改
|
||||||
|
|
||||||
|
const isWechat = /micromessenger/i.test(userAgent);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isMobile,
|
isMobile,
|
||||||
isApp,
|
isApp,
|
||||||
isPC: !isMobile
|
isPC: !isMobile,
|
||||||
|
isWechat
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -109,6 +109,12 @@ import { usePlatformType } from "@/utils/device";
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
getTitleSvg();
|
getTitleSvg();
|
||||||
|
const { isWechat } = usePlatformType();
|
||||||
|
if (isWechat) {
|
||||||
|
formData.value.username = "superadmin"
|
||||||
|
formData.value.password = "123456"
|
||||||
|
handleSubmit(new Event("submit"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue