refresh-token.js 349 B

12345678910111213141516171819
  1. /**
  2. * 刷新token
  3. * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-token
  4. */
  5. module.exports = async function () {
  6. const {
  7. token,
  8. tokenExpired
  9. } = await this.uniIdCommon.refreshToken({
  10. token: this.getUniIdToken()
  11. })
  12. return {
  13. errCode: 0,
  14. newToken: {
  15. token,
  16. tokenExpired
  17. }
  18. }
  19. }