using System; using System.Collections.Generic; using System.Text; namespace CoreCms.Net.Utility.Helper { public static class ShareHelper { /// /// 分享URL压缩(type-invite-id-teamId type=场景类型 invite=邀请码 id=场景ID值 teamId=拼团ID) /// /// 场景类型 /// 邀请码 /// 场景ID值 /// 拼团ID /// public static string share_parameter_encode(string type, string invite, string id, string teamId) { var newUrl = type + "-" + invite + "-" + id + "-" + teamId; return newUrl; } /// /// 分享URL解压缩 /// /// 已经压缩的url,多个-组成的url /// public static string share_parameter_decode(string url) { var urlArr = url.Split("-"); var newUrl = "type=" + urlArr[0] + "&invite=" + urlArr[1] + "&id=" + urlArr[2] + "&teamId=" + urlArr[3]; return newUrl; } } }