Merge branch 'yongxu-dev' into devlop
# Conflicts: # miniprogram/pages/profile-edit/profile-edit.js # miniprogram/pages/profile-edit/profile-edit.wxml # miniprogram/pages/settings/settings.js # miniprogram/utils/ruleEngine.js # soul-admin/src/pages/distribution/DistributionPage.tsx # soul-admin/src/pages/users/UsersPage.tsx # soul-api/.env.production # soul-api/.gitignore # soul-api/internal/handler/db_ckb_leads.go # soul-api/internal/handler/miniprogram.go # soul-api/internal/handler/referral.go # 开发文档/1、需求/archive/链接人与事-存客宝同步-需求规划.md # 开发文档/1、需求/archive/链接人与事-实现方案.md
This commit is contained in:
@@ -171,6 +171,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,
|
||||
@@ -188,5 +202,6 @@ module.exports = {
|
||||
showToast,
|
||||
showLoading,
|
||||
hideLoading,
|
||||
showConfirm
|
||||
showConfirm,
|
||||
toAvatarPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user