diff --git a/src/pagesLogin/login/index.vue b/src/pagesLogin/login/index.vue index 8b6cb2e..0d69821 100644 --- a/src/pagesLogin/login/index.vue +++ b/src/pagesLogin/login/index.vue @@ -143,6 +143,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(() => { @@ -237,6 +238,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", // 要跳转到的页面路径 @@ -295,7 +301,6 @@ const handleSelect = (v: any) => { state.isShow = false; state.dpObj = v; model1.userInfo.dpName = v.name; - console.log(v.dbIp); store.setChildPath(v.dbIp); }; @@ -304,8 +309,7 @@ const state = reactive({ isShow: false, dpObj: {}, }); - -// // 获取基地信息 +// 获取基地信息 // ProfileApi.getDbInfo({}).then((res) => { // if (res.code === 200) { // state.dpList = res.data.map((item: any) => { @@ -313,6 +317,16 @@ const state = reactive({ // }); // } // }); + +onShow(() => { + if (uni.getStorageSync('catchLoginInfo')) { + const {userName, password} = uni.getStorageSync('catchLoginInfo') + model1.userInfo.userName = userName + model1.userInfo.password = password + } + +}); +