完成了登录模块

This commit is contained in:
2025-05-19 09:08:33 +08:00
parent 7c934ded5f
commit 3fe9c3c209
20 changed files with 364 additions and 208 deletions

View File

@ -7,7 +7,8 @@
*/
function validate(data, rules) {
for (const [field, message] of Object.entries(rules)) {
if (!data[field]) {
const value = data[field];
if ((typeof value === 'string' && !value.trim()) || value == null) {
wx.showToast({ title: message, icon: 'none' });
return false;
}