Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
wly-APP
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘川
wly-APP
Commits
cc09b294
Commit
cc09b294
authored
Sep 13, 2022
by
xiangzj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录成功记住账号密码
parent
d762a457
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
login.nvue
pages/login/login.nvue
+30
-5
No files found.
pages/login/login.nvue
View file @
cc09b294
...
...
@@ -12,9 +12,9 @@
placeholder-class='placeholder-text' />
</view>
<view class="password-block" v-show="loginType==='password'">
<input ref="password" class="password" :cursor='cursorNumber' :password="!passwordVisible"
<input ref="password" class="password" :cursor='cursorNumber'
type='text'
:password="!passwordVisible"
v-model="password" placeholder="请输入密码" placeholder-class='placeholder-text' />
<template v-if="
!
passwordVisible">
<template v-if="passwordVisible">
<image class="icon-visible" src="../../static/image/visible@3x.png" mode="aspectFit"
@click="handlePasswordVisible"></image>
</template>
...
...
@@ -57,9 +57,9 @@
export default {
data() {
return {
account: '
0050000215
',
account: '',
// password: 'DO1tjHPW0Z',
password: '
Wly12345
',
password: '',
phone: '',
code: '',
loginType: 'password',
...
...
@@ -108,6 +108,29 @@
// this.code = this.option.code
// }
},
//页面初始加载
mounted() {
let that = this;
//缓存的账号
const username = uni.getStorageSync('username');
//缓存的密码
const password = uni.getStorageSync('password');
console.log("密码",password,username)
//有缓存就赋值给文本没有就清空
if (username && password) {
that.account = username;
that.password = password;
} else {
that.account = '';
that.password = '';
}
that.handlePasswordVisible()
that.$nextTick(()=>{
setTimeout(function() {
that.handlePasswordVisible()
}, 100);
})
},
methods: {
// 切换密码可见性
handlePasswordVisible() {
...
...
@@ -134,6 +157,8 @@
// status: 1
// }
if (res.status === 1) {
uni.setStorageSync('username', this.account);
uni.setStorageSync('password', this.password);
this.$uStore({
name: 'userInfo',
value: {
...
...
@@ -297,4 +322,4 @@
font-size: 28rpx;
color: #666660;
}
</style>
</style>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment