master
秦子超 2024-07-01 13:56:47 +08:00
commit 9bd7ce6ca9
4 changed files with 71802 additions and 131 deletions

View File

@ -38,7 +38,7 @@
<script>
import CryptoJS from 'crypto-js'
import { onMounted } from "vue"
let checked = false
export default {
@ -51,6 +51,17 @@ export default {
}
}
},
mounted(){
console.log(uni.getStorageSync('loginChecked'));
if (uni.getStorageSync('loginChecked')===true){
this.formData = {
username: uni.getStorageSync('loginName'),
password: uni.getStorageSync('password'),
checked: true,
}
}
},
methods: {
handleChange (formData) {
checked = !checked
@ -88,11 +99,15 @@ export default {
//
if (formData.checked === true) {
uni.setStorageSync('loginChecked', true)
uni.setStorageSync('loginName', postForm.loginName)
uni.setStorageSync('password',formData.password)
uni.setStorageSync('secretKey', postForm.secretKey)
} else {
uni.setStorageSync('loginChecked', false)
uni.removeStorageSync('loginName')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('password')
this.formData.username = ''
this.formData.password = ''
}

View File

@ -81,13 +81,22 @@
// console.log('click',index,func[index].url)
},
logout(){
uni.removeStorageSync('loginName')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('Gs-Token')
uni.removeStorageSync('value')
uni.redirectTo({
url: '/pages/login/login'
})
if(uni.getStorageSync('loginChecked')===true){
uni.redirectTo({
url: '/pages/login/login'
})
} else {
uni.removeStorageSync('loginName')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('Gs-Token')
uni.removeStorageSync('value')
uni.removeStorageSync('password')
uni.redirectTo({
url: '/pages/login/login'
})
}
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff