text: const tokens = {
    admin: {
      token: 'admin-token'
    },
    editor: {
      token: 'editor-token'
    }
  }
  
  const users = {
    'admin-token': {
      roles: ['admin'],
      introduction: 'I am a super administrator',
      avatar: 'https://p1-ppx.byteimg.com/obj/tos-cn-i-8gu37r9deh/4f4f697480c04d26bd7698139c4a8cf3',
      name: 'Super Admin'
    },
    'editor-token': {
      roles: ['editor'],
      introduction: 'I am an editor',
      avatar: 'https://p1-ppx.byteimg.com/obj/tos-cn-i-8gu37r9deh/4f4f697480c04d26bd7698139c4a8cf3',
      name: 'Normal Editor'
    }
  }
  
  module.exports = [
    // user login
    {
      url: '/vue-element-admin/user/login',
      type: 'post',
      response: (config) => {
        const { username } = config.body
        const token = tokens[username]
        // mock error
        if (!token) {
          return {
            code: 60204,
            message: 'Account and password are incorrect.'
          }
        }
  
        return {
          code: 20000,
          data: token
        }
      }
    },
  
    // get user info
    {
      url: '/vue-element-admin/user/info.*',
      type: 'get',
      response: (config) => {
        const { token = '' } = config.query
        console.log(token)
        const info = users[token.toLocaleLowerCase()]
        // mock error
        if (!info) {
          return {
            code: 50008,
            message: 'Login failed, unable to get user details.'
          }
        }
  
        return {
          code: 20000,
          data: info
        }
      }
    },
  
    // user logout
    {
      url: '/vue-element-admin/user/logout',
      type: 'post',
      response: (_) => {
        return {
          code: 20000,
          data: 'success'
        }
      }
    }
  ]
  