From f9b144cb4643e3edba5ce5df69afbe9da4960002 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 21 三月 2023 09:01:30 +0800 Subject: [PATCH] # --- pages/login/login.vue | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 498e0cb..cfb94da 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -46,7 +46,7 @@ <view>璁颁綇瀵嗙爜</view> </view> <view class="check-right"> - <switch checked color="#FFCC33" style="zoom:.5" @change="remberChange"/> + <switch :checked='remberPassword' color="#FFCC33" style="zoom:.5" @change="remberChange"/> </view> </view> </view> @@ -101,6 +101,7 @@ version: '', showPassword: false, value: '', + remberPassword: true, url: { ip: '', port: '', @@ -122,7 +123,10 @@ this.url = uni.getStorageSync('url') this.baseUrl = uni.getStorageSync('baseUrl') if (!this.user) { - this.user = {userName: '',password: '',} + this.user = {userName: '',password: ''} + } + if (!this.url) { + this.url = {ip: '',port: '',project: ''} } // 鎵嬫満绔増鏈彿 @@ -139,7 +143,7 @@ this.showPassword = !this.showPassword; }, remberChange(e) { - console.log(e.detail); + this.remberPassword = !this.remberPassword }, // 璁剧疆绐楀彛寮�鍚寜閽� settings() { @@ -190,7 +194,11 @@ that.load.loading = true; that.load.btnText = '鐧诲綍涓�'; uni.setStorageSync('token', res.data.token); - uni.setStorageSync('user', that.user); + if(that.remberPassword){ + uni.setStorageSync('user', that.user); + }else{ + uni.removeStorageSync('user'); + } setTimeout(() => { uni.showToast({ title: '鐧诲綍鎴愬姛' -- Gitblit v1.9.1