登录加cid;注掉记住密码
This commit is contained in:
@@ -1,15 +1,32 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
<script setup>
|
||||
import { onLaunch } from '@dcloudio/uni-app'
|
||||
|
||||
// 应用启动时执行
|
||||
onLaunch(() => {
|
||||
console.log('App 启动')
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 只有 App 平台才获取 CID
|
||||
getPushCID()
|
||||
// #endif
|
||||
})
|
||||
|
||||
// 获取 uniPush 2.0 CID
|
||||
function getPushCID() {
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
console.log('推送初始化成功')
|
||||
console.log('CID =', res.cid)
|
||||
|
||||
// 存起来备用
|
||||
uni.setStorageSync('push_cid', res.cid)
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide')
|
||||
fail: (err) => {
|
||||
console.error('获取推送 CID 失败', err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -208,10 +208,12 @@ const handleLogin = () => {
|
||||
title: '登录中...',
|
||||
mask: true
|
||||
})
|
||||
const push_cid = uni.getStorageSync('push_cid')
|
||||
let params = {
|
||||
phone: phoneNumber.value,
|
||||
smsCode: verifyCode.value,
|
||||
scene: 'butler_login'
|
||||
scene: 'butler_login',
|
||||
cid:push_cid
|
||||
}
|
||||
getLoginBySms(params)
|
||||
.then(res => {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 记住密码 -->
|
||||
<view class="remember-wrap">
|
||||
<view class="remember-wrap" style="display: none;">
|
||||
<view class="remember-item" @click="toggleRemember">
|
||||
<uni-icons type="checkbox-filled" size="18" color="#4D5DFA" v-if="rememberPwd"></uni-icons>
|
||||
<uni-icons type="checkbox" size="18" color="#999" v-else></uni-icons>
|
||||
@@ -150,9 +150,12 @@
|
||||
return;
|
||||
}
|
||||
uni.showLoading({ title: '登录中...', mask: true });
|
||||
const push_cid = uni.getStorageSync('push_cid')
|
||||
// console.log('cid',push_cid)
|
||||
let params = {
|
||||
username:phoneNumber.value,
|
||||
password:password.value
|
||||
password:password.value,
|
||||
cid:push_cid
|
||||
}
|
||||
getLoginPassword(params).then(res =>{
|
||||
// console.log('33333',res)
|
||||
|
||||
@@ -107,7 +107,15 @@ const openDoor = () => {
|
||||
const device = doorList.value[selectedDoor.value]
|
||||
if (!device) return
|
||||
|
||||
uni.showLoading({ title: '开门中...' })
|
||||
uni.showToast({
|
||||
title: '正在对接硬件中...',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
function getSwitchOpen(){
|
||||
uni.showLoading({ title: '开门中...',mask:true })
|
||||
switchOpenDoor({ deviceId: device.id }).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code === 200) {
|
||||
@@ -119,6 +127,7 @@ const openDoor = () => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: err.msg || '开门失败', icon: 'none' })
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user