pig开发文档

异常如下

![](http://obq1lvsd9.bkt.clouddn.com/3DB20C46B50C084C485CB548C0F120B8.png =x300)

解决方案

  1. 检查sys_oauth_client_details配置,有没有修改?
  2. 检查pig-gatway配置,有没有修改?
security:
  validate:
    code: false
  sessions: stateless
  oauth2:
    client:
      client-id: pig
      client-secret: pig
  1. 如果修改,请确保修改值和前端UI保持一致 login.js
export function mobileLogin(mobile, code) {
  var grant_type = 'mobile'
  var scope = 'server'
  return request({
    url: '/auth/mobile/token',
    headers: {
      'Authorization': 'Basic cGlnOnBpZw=='  //此处为 base64(pig:pig)
    },
    method: 'post',
    params: { mobile, code, grant_type, scope }
  })
}
export function login(username, password, randomStr, code) {
  var grant_type = 'password'
  var scope = 'server'
  return request({
    url: '/auth/oauth/token',
    headers: {
      'Authorization': 'Basic cGlnOnBpZw=='  //同上
    },
    method: 'post',
    params: { username, password, randomStr, code, grant_type, scope }
  })
}