update: 忘记密码优化

This commit is contained in:
admin 2024-06-14 15:06:57 +08:00
parent 3e6923b94f
commit 5f07e0d5e8
1 changed files with 15 additions and 1 deletions

View File

@ -145,6 +145,7 @@ import LoginLayout from "./components/loginLayout.vue";
import { useMemberStore } from "@/store/index"; import { useMemberStore } from "@/store/index";
import valid from "@/utils/validate"; import valid from "@/utils/validate";
import pinia from "@/store"; import pinia from "@/store";
import { onShow } from "@dcloudio/uni-app";
const handleClear = (item: any) => { const handleClear = (item: any) => {
setTimeout(() => { setTimeout(() => {
@ -239,6 +240,11 @@ const submit = () => {
} }
ProfileApi.loginByAccount(model1.userInfo).then((res: any) => { ProfileApi.loginByAccount(model1.userInfo).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
if(checkGroup.rememberCheck.length === 1) {
uni.setStorageSync('catchLoginInfo', model1.userInfo);
} else {
uni.setStorageSync('catchLoginInfo', {});
}
store.setProfile(res.data); store.setProfile(res.data);
uni.reLaunch({ uni.reLaunch({
url: "/pagesHome/index", // url: "/pagesHome/index", //
@ -297,7 +303,6 @@ const handleSelect = (v: any) => {
state.isShow = false; state.isShow = false;
state.dpObj = v; state.dpObj = v;
model1.userInfo.dpName = v.name; model1.userInfo.dpName = v.name;
console.log(v.dbIp);
store.setChildPath(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
}
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>