This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
const{
userCollection
}=require('../../common/constants')
const{
USER_STATUS
}=require('../../common/constants')
asyncfunctionsetUserStatus(uid,status){
constupdateData={
status
}
if(status!==USER_STATUS.NORMAL){
updateData.valid_token_date=Date.now()
}
awaituserCollection.doc(uid).update({
status
})
// TODO 此接口尚不完善,例如注销后其他客户端可能存在有效token,支持Redis后此处会补充额外逻辑