node-egg-fb
v1.0.3
Published
$ npm i node-egg-fb
Downloads
2
Readme
$ npm i node-egg-fb
router-way
$//back/app/router
validator.addRule('phone', (rule, value) => { if (!/^1[3456789]\d{9}$/.test(value)) { return '手机号校验失败' } }) router.get('/', controller.home.index); router.post('/registry', controller.user.registry); router.post('/login', controller.user.login); router.get('/getcaptcha', controller.user.getcaptcha); router.get('/getuser', controller.user.getuser);
//service/user async getuser(name) { return await this.app.mysql.get('ykuser', { name }); } async registry(obj) { return await this.app.mysql.insert('ykuser', obj); } async login(obj) { return await this.app.mysql.select('ykuser', { where: obj }); }