完成了登录模块
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user