api检测会员注册时是否已经存在
接口特点: 增加任意字段(无论主表或副表),做好字段维护,无需改动接口,可检测表中任意字段,真正做到接口免维护,更适合小白站长,一劳永逸。
$.ajax({ url: '/api/v1/?act=check_field&field=username&value=xiayu', // 示例 API type: 'GET', dataType: 'json', success: function (response) { if (response && 0 === response.code) {
// 返回 true if (response.data.duplicate) {
alert('用户已被注册了'); } } }, error: function (xhr, status, error) { } });
|