web-backset.cn/apps/server/view/page/signup/index.ts
2023-02-22 23:07:06 +08:00

26 lines
711 B
TypeScript

import './index.less';
import { RegUtil, ValidateUtil } from '@backset/util';
import $ from 'jquery';
$(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: '手机号格式错误' });
$.post('/user/create', params, res => {
console.log(res);
});
}
});