对接活动实况接口;注掉登录接口代码
This commit is contained in:
@@ -72,7 +72,7 @@ import {getLoginPassword} from '../api/api.js'
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('');
|
||||
const password = ref('');
|
||||
const agreeAgreement = ref(true); // 默认勾选
|
||||
const agreeAgreement = ref(false); // 默认勾选
|
||||
const placeholderStyle = ref('font-size:24rpx')
|
||||
|
||||
// 计算属性:是否可登录(帐号+密码+协议都满足)
|
||||
@@ -118,43 +118,43 @@ const handleLogin = () => {
|
||||
username:phoneNumber.value,
|
||||
password:password.value
|
||||
}
|
||||
getLoginPassword(params).then(res =>{
|
||||
// console.log('33333',res)
|
||||
if(res.code === 200){
|
||||
uni.setStorageSync('token', res.data.token);
|
||||
// 存用户ID
|
||||
if(res.data) {
|
||||
// 存当前绑定的小区ID,0 表示未绑定
|
||||
const currentVillageId = res.data.currentVillageId || 0;
|
||||
uni.setStorageSync('currentVillageId', currentVillageId);
|
||||
}
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
setTimeout(() =>{
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
},1000);
|
||||
})
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'error' });
|
||||
}
|
||||
// getLoginPassword(params).then(res =>{
|
||||
// // console.log('33333',res)
|
||||
// if(res.code === 200){
|
||||
// uni.setStorageSync('token', res.data.token);
|
||||
// // 存用户ID
|
||||
// if(res.data) {
|
||||
// // 存当前绑定的小区ID,0 表示未绑定
|
||||
// const currentVillageId = res.data.currentVillageId || 0;
|
||||
// uni.setStorageSync('currentVillageId', currentVillageId);
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// setTimeout(() =>{
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// },1000);
|
||||
// })
|
||||
// }else{
|
||||
// uni.showToast({ title: res.msg, icon: 'error' });
|
||||
// }
|
||||
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: '网络异常',
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
// }).catch(err => {
|
||||
// uni.showToast({
|
||||
// title: '网络异常',
|
||||
// icon: 'error'
|
||||
// });
|
||||
// })
|
||||
|
||||
// 测试
|
||||
// uni.showLoading({
|
||||
// title: '登录中...',
|
||||
// mask:true
|
||||
// });
|
||||
// setTimeout(() => {
|
||||
// uni.switchTab({ url: '/pages/index/index' });
|
||||
// }, 1500);
|
||||
// uni.hideLoading()
|
||||
uni.showLoading({
|
||||
title: '登录中...',
|
||||
mask:true
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
}, 1500);
|
||||
uni.hideLoading()
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user