
import moment from 'moment'
import Mock from 'mockjs'


export default [
  {
    url: '/registry/verifyCode',
    type: 'get',
    response: (req, res, next) => {
      // req.body 可获取post参数
      // req.query 可获取get参数
      return new Promise((res, rej) => {
        res({
          body: {
            imgUrl: "http://img5.imgtn.bdimg.com/it/u=1114443007,4076857238&fm=26&gp=0.jpg"
          },
          head: {
            errorCode: '0',
            data: null
          }
          })
      })
    }
  }, {
    url: '/registry/sendCode',
    type: 'get',
    response: (req, res, next) => {
      // req.body 可获取post参数
      // req.query 可获取get参数
      return new Promise((res, rej) => {
        res({
          body: {
            // imgUrl: Mock.Random.dataImage('50x20', Mock.mock({'regexp': /\w{4}/}).regexp)
            // imgUrl: Mock.Random.dataImage('50x20')
          },
          head: {
            errorCode: '0',
            data: null
          }
          })
      })
    }
  }, {
    url: '/registry/submit',
    type: 'get',
    response: (req, res, next) => {
      // req.body 可获取post参数
      // req.query 可获取get参数
      return new Promise((res, rej) => {
        setTimeout(() => {
          res({
            body: {
              // imgUrl: Mock.Random.dataImage('50x20', Mock.mock({'regexp': /\w{4}/}).regexp)
              // imgUrl: Mock.Random.dataImage('50x20')
            },
            head: {
              errorCode: '1',
              data: null
            }
          })
        }, 2000)
      })
    }
  }
]
