Files
ctms-client/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/refresh-token.js
fm453 c62d15b288 首次完整推送,
V:1.20240808.006
2024-08-13 18:32:37 +08:00

25 lines
460 B
JavaScript

/**
* 刷新token
* @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-token
*/
module.exports = async function () {
const refreshTokenRes = await this.uniIdCommon.refreshToken({
token: this.getUniversalUniIdToken()
})
const {
errCode,
token,
tokenExpired
} = refreshTokenRes
if (errCode) {
throw refreshTokenRes
}
return {
errCode: 0,
newToken: {
token,
tokenExpired
}
}
}