1234567891011121314151617181920212223242526272829303132 |
- import ApiController from './ApiController';
- class UserController extends ApiController {
- async register() {
- const createRule = {
- wallet: {
- type: 'string',
- trim: true,
- },
- pid: {
- type: 'int',
- trim: true,
- },
- sign: {
- type: 'string',
- trim: true,
- },
- };
- const err = this.app.validator.validate(createRule, this.ctx.request.body);
- if (err) {
- const firstErr = err[0];
- return this.fail(`参数: ${firstErr.field} 格式不正确`);
- }
- // TODO 验算签名用户是否是当前指定用户
- return this.success({});
- }
- }
- export default UserController;
|