Files
qncV4uni-app/src/utils/session.js

17 lines
462 B
JavaScript
Raw Normal View History

2026-05-16 15:47:07 +08:00
/** 对齐 tyc-webview-v2 登录成功后的本地存储字段 */
export function saveAuthSession(payload) {
uni.setStorageSync('token', payload.accessToken)
uni.setStorageSync('refreshAfter', String(payload.refreshAfter))
uni.setStorageSync('accessExpire', String(payload.accessExpire))
}
export function hasToken() {
try {
const t = uni.getStorageSync('token')
return typeof t === 'string' && t.length > 0
}
catch {
return false
}
}