From 5f07e0d5e85bdaa42b46bb234de9bd7f69e87b5d Mon Sep 17 00:00:00 2001 From: admin <> Date: Fri, 14 Jun 2024 15:06:57 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=BF=98=E8=AE=B0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pagesLogin/login/index.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pagesLogin/login/index.vue b/src/pagesLogin/login/index.vue index 6dda512..601d0cf 100644 --- a/src/pagesLogin/login/index.vue +++ b/src/pagesLogin/login/index.vue @@ -145,6 +145,7 @@ import LoginLayout from "./components/loginLayout.vue"; import { useMemberStore } from "@/store/index"; import valid from "@/utils/validate"; import pinia from "@/store"; +import { onShow } from "@dcloudio/uni-app"; const handleClear = (item: any) => { setTimeout(() => { @@ -239,6 +240,11 @@ const submit = () => { } ProfileApi.loginByAccount(model1.userInfo).then((res: any) => { if (res.code === 200) { + if(checkGroup.rememberCheck.length === 1) { + uni.setStorageSync('catchLoginInfo', model1.userInfo); + } else { + uni.setStorageSync('catchLoginInfo', {}); + } store.setProfile(res.data); uni.reLaunch({ url: "/pagesHome/index", // 要跳转到的页面路径 @@ -297,7 +303,6 @@ const handleSelect = (v: any) => { state.isShow = false; state.dpObj = v; model1.userInfo.dpName = v.name; - console.log(v.dbIp); store.setChildPath(v.dbIp); }; @@ -315,6 +320,15 @@ ProfileApi.getDbInfo({}).then((res) => { }); } }); + +onShow(() => { + if (uni.getStorageSync('catchLoginInfo')) { + const {userName, password} = uni.getStorageSync('catchLoginInfo') + model1.userInfo.userName = userName + model1.userInfo.password = password + } + +});