This commit is contained in:
Air 2024-03-05 16:33:11 +08:00
parent a776179199
commit 6b8b60a1da
3 changed files with 64 additions and 30 deletions

10
.idea/UniappTool.xml generated Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
<option name="generalBasePath" value="$PROJECT_DIR$" />
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
<option name="scanNum" value="1" />
<option name="type" value="store" />
</component>
</project>

View File

@ -59,28 +59,40 @@ const changeType = () => {
type.value=type.value==0?1:0;
}
const submitDoLogin = () => {
//
userPhoneLogin({'mobile':mobile.value,'captcha':code.value}).then(res => {
// 200
if(res.code==200){
message.success(res.msg);
//
message.success(res.msg);
// sessionStorage
sessionStorage.setItem('user', JSON.stringify(res.data.userinfo));
//
router.push('/');
}else{
// 200
message.error(res.msg)
}
});
}
const getMsg = () => {
console.log(mobile.value);
if (mobile.value.length != 11) {
message.error( '手机号输入错误!')
return;
}
if (!canGetCode.value) {
//
getPhoneCode();
} else {
message.error( '请在' + codeTips.value + '秒后重试')
}
console.log(mobile.value);
//
if (mobile.value.length != 11) {
message.error( '手机号输入错误!')
return;
}
//
if (!canGetCode.value) {
//
getPhoneCode();
} else {
message.error( '请在' + codeTips.value + '秒后重试')
}
}
const getPhoneCode = () => {
canGetCode.value = true;

View File

@ -50,27 +50,39 @@ const userInfo = ref();
onMounted(() => {
var item = sessionStorage.getItem('user');
var jsonArray = JSON.parse(item);
// 37
const hiddenPhoneNumber = jsonArray.mobile.substring(0, 3) + "****" + jsonArray.mobile.substring(7);
//
jsonArray.mobile = hiddenPhoneNumber;
// userInfo
userInfo.value = jsonArray;
})
</script>
<style scoped>
.right_title {
font-size: 20px;
font-weight: 400;
color: #000000;
letter-spacing: 4px;
}
.left_text {
cursor: pointer;
font-size: 18px;
color: #000000;
letter-spacing: 3px;
}
.left_text_init {
// mobile
jsonArray.mobile = hiddenPhoneNumber;
//
//
userPhoneLogin({'mobile':mobile.value,'captcha':code.value}).then(res => {
// 200
if(res.code==200){
//
message.success(res.msg);
// sessionStorage
sessionStorage.setItem('user', JSON.stringify(res.data.userinfo));
//
router.push('/');
}else{
// 200
message.error(res.msg)
}
});
ngify(res.data.userinfo));
//
router.push('/');
}else{
// 200
message.error(res.msg)
}
});
_text_init {
color: #0051B1;
}
</style>