增强用户隐私保护,新增昵称授权功能。更新头像选择逻辑,用户可直接通过按钮选择微信头像或相册图片。优化个人资料页面,强化手机号必填提示,提升用户体验。调整多个页面以支持新隐私授权机制,确保符合最新隐私规范。
This commit is contained in:
@@ -174,6 +174,20 @@ const showConfirm = (title, content) => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 从头像 URL 提取路径部分(不含域名),用于保存到后端
|
||||
* 例如:https://xxx.com/uploads/avatars/1.jpg → /uploads/avatars/1.jpg
|
||||
* @param {string} url - 完整 URL 或路径
|
||||
* @returns {string}
|
||||
*/
|
||||
const toAvatarPath = url => {
|
||||
if (!url || typeof url !== 'string') return url || ''
|
||||
const idx = url.indexOf('/uploads/')
|
||||
if (idx >= 0) return url.substring(idx)
|
||||
if (url.startsWith('/')) return url
|
||||
return url
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime,
|
||||
formatDate,
|
||||
@@ -191,5 +205,6 @@ module.exports = {
|
||||
showToast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
showConfirm
|
||||
showConfirm,
|
||||
toAvatarPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user