web-backset.cn/apps/server/view/page/signup/index.ts

26 lines
711 B
TypeScript
Raw Normal View History

2023-02-11 13:21:06 +08:00
import './index.less';
2023-02-21 17:58:09 +08:00
import { RegUtil, ValidateUtil } from '@backset/util';
2023-02-22 23:07:06 +08:00
import $ from 'jquery';
2023-02-11 13:21:06 +08:00
$(function () {
$('#signup-module').on('click', '#btn-signup', handleCreateUser);
/**
*
*/
function handleCreateUser() {
const params = {
user_login: '' + $('#username').val(),
user_pass: '' + $('#password').val(),
user_phone: '' + $('#tel').val(),
};
if (ValidateUtil.withEmpty(params)) return;
// return message.error({ text: '请补全表单' });
if (!RegUtil.PHONE.test(params.user_phone)) return;
// return message.error({ text: '手机号格式错误' });
2023-02-22 23:07:06 +08:00
$.post('/user/create', params, res => {
2023-02-11 13:21:06 +08:00
console.log(res);
});
}
});