From 9790ff7ecc198ae3bbf10d5e3707a95d60ddab69 Mon Sep 17 00:00:00 2001 From: sjz <1240968267@qq.com> Date: 星期三, 19 二月 2025 11:54:28 +0800 Subject: [PATCH] 煜昌pad前端 --- pages/login/login.vue | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 0ffba34..b60f7d5 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -34,6 +34,12 @@ } } }, + onLoad() { + let user = uni.getStorageSync('userInfo') + if (user) { + this.userInfo.account = user.code + } + }, methods: { login() { // 杈撳叆妫�楠� @@ -52,9 +58,6 @@ }) return } - - - console.log(this.userInfo) login(this.userInfo.account, this.userInfo.password).then(response => { console.log(response) if (!response.result) { @@ -64,17 +67,20 @@ }) return } + uni.setStorageSync('userInfo', { + username: response.data.FNAME, + code: response.data.FCODE, + company: response.data.FCOMPANY, + factory: response.data.FFACTORY, + }) uni.navigateTo({ - url:'/pages/index/index' + url: '/pages/index/index', }) }) - - } - } + }, } </script> - <style> .uni-input { height: 28px; -- Gitblit v1.9.3