{"_id":"l-request","name":"l-request","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"l-request","version":"1.0.0","description":"axios异步请求","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"liyx"},"license":"ISC","dependencies":{"axios":"^0.27.2","element-ui":"^2.15.9"},"repository":{"type":"git","url":""},"_id":"l-request@1.0.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-hSpfr47+b1X28wiIIJArH5wAFX5almIuj48aAiraVFE9bUUF/wzIkKWIxd9jB7Uzop+R4QxFCp9QmLLoQaRJlQ==","shasum":"b6d8642881a2fe8709ef7bd46ab5af8596f899b1","tarball":"https://registry.npmjs.org/l-request/-/l-request-1.0.0.tgz","fileCount":4,"unpackedSize":3618,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIALf6Dr7vKyywJPesROS/idN1Stnhj5whoTNWbTgIVLAAiEA6wHEgEWJb62w12N60lNzZpmS/BXBRt9NDxqwsKfGZLI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivpqNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN4g/+LxJCy+MCP5XMjwlMufima/ZYZmbIE96YIvEp3nm5LPFtV6FL\r\nZEtKfMaUx5W4GtdqdN8gPq3uQlyW1ZfHaWD48/CKaRkxTUAQieifG6mc60ok\r\nYuhwa3WMW7yrIHljEpjN02LTDQgwYFLviffNk8bGsaYGOXJSjS67Vh2WpKbL\r\nfyThn1q6KHASk0XNzQ/z8bJ1WWeNx/H76cAF/9GGS7cwZr97fOO1VG9esGFi\r\n/4nzpq7wenPMjR1eyeKOHHcwmJqLLhjPQTaNGeh9gO3auyzpUOSvj5sA5Myq\r\nhyFT+br7kHxAMKmuHCDuvW11RU4O/Kpr6euZ3JokPReDSPD6Qkw/h212XaMn\r\nbfkrdM6BqRPSb6goqFXf9XGQ+TNwRlBNMsdNlPy5RlFwnDPRGK6eC2chtP1V\r\n0TI3APRk2z7Ep3dChKSWwEiLtH9o7dBWD/QtRV7kE6KyRw/0X3GtYR3anoZ2\r\nYGBIR4iT0i2M477An7WEJ15zBx+gc6Xy76z+kUuGjW0Bj7TxJtym/1kr0zaE\r\na1SUnWjBnJnLW/xUcLCbirGPFcpppgwAoLxcLkMcIE8vFCCxhPY3uo0Dqn0r\r\n3yIY2skAGC12pYVLdZ72fANwRGsiGGuVvG5nZXymfQfL5GDJqAF0S4aOx7K0\r\n2dTY79CSTfrT+3wfESIQW5vrkez1EOacsp0=\r\n=nIFr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"lyx5026","email":"2717660778@qq.com"},"directories":{},"maintainers":[{"name":"lyx5026","email":"2717660778@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/l-request_1.0.0_1656658573419_0.12466392238891211"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-01T06:56:13.419Z","1.0.0":"2022-07-01T06:56:13.590Z","modified":"2022-07-01T06:56:13.764Z"},"maintainers":[{"name":"lyx5026","email":"2717660778@qq.com"}],"description":"axios异步请求","repository":{"type":"git","url":""},"author":{"name":"liyx"},"license":"ISC","readme":"# axios封装\r\n\r\n## 请求拦截、响应拦截、错误统一处理\r\n\r\n## 使用示例\r\n\r\n  ### request.js\r\n\r\n  ```\r\n  import $axios from 'request'\r\n\r\n  const options = {\r\n    baseURL: process.env.VUE_APP_BASE_API,\r\n    toLogin: () => {\r\n      // 这里填写重新登录方法\r\n    },\r\n    ......\r\n  }\r\n\r\n  export default function request(_option) {\r\n    return new Promise((resolve, reject) => {\r\n      $axios(option)(_option).then((res) => {\r\n        resolve(res)\r\n      }).catch((err) => {\r\n        reject(err)\r\n      })\r\n    })\r\n  }\r\n  ```\r\n\r\n  ### api/user.js\r\n\r\n  ```\r\n  import request from '@/utils/request'\r\n\r\n  export function login(data) {\r\n    return request({\r\n      url: '/rest/users/login',\r\n      method: 'post',\r\n      data\r\n    })\r\n  }\r\n\r\n  // 用法和axios没有区别\r\n  ```\r\n","readmeFilename":"README.md"}