wangfukang 19 hours ago
parent
commit
67124e17ba
  1. 21
      utils/sharePath.js

21
utils/sharePath.js

@ -33,6 +33,27 @@ export function buildGroupTargetPath(params) {
return targetPath return targetPath
} }
export function buildGroupShopTargetPath(shopId) {
if (!shopId) return ''
return '/package2/group/groupBuySingle?type=shop&shopId=' + encodeURIComponent(shopId)
}
export function resolveMiniCodeSceneTarget(scene) {
let value = String(scene || '').trim()
if (!value) return ''
try {
value = decodeURIComponent(value)
} catch (e) {}
if (!value) return ''
if (value.indexOf('groupShop:') === 0) {
return buildGroupShopTargetPath(value.replace('groupShop:', ''))
}
if (/^s[A-Za-z0-9_-]{1,31}$/.test(value)) {
return buildGroupShopTargetPath(value.slice(1))
}
return ''
}
export function normalizeShareTargetPath(value) { export function normalizeShareTargetPath(value) {
let targetPath = String(value || '') let targetPath = String(value || '')
if (targetPath.indexOf('%2F') === 0 || targetPath.indexOf('%2f') === 0) { if (targetPath.indexOf('%2F') === 0 || targetPath.indexOf('%2f') === 0) {

Loading…
Cancel
Save