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 + } + +});