Commit d0466236 authored by 艾娇平's avatar 艾娇平

校验传入的链接

parent 1413cdc3
...@@ -24,15 +24,15 @@ extern NSString * const ShareVideoUrl; ...@@ -24,15 +24,15 @@ extern NSString * const ShareVideoUrl;
// 获取分享平台渠道---埋点使用 // 获取分享平台渠道---埋点使用
static inline NSString *_getGMShareChannelByType(GMSharePlatform platformType) { static inline NSString *_getGMShareChannelByType(GMSharePlatform platformType) {
if (platformType & GMSharePlatformQQFriend) return @"qq"; if (platformType == GMSharePlatformQQFriend) return @"qq";
if (platformType & GMSharePlatformQQSpace) return @"qzone"; if (platformType == GMSharePlatformQQSpace) return @"qzone";
if (platformType & GMSharePlatformWechatSession) return @"wechat"; if (platformType == GMSharePlatformWechatSession) return @"wechat";
if (platformType & GMSharePlatformWechatTimeline) return @"wechatline"; if (platformType == GMSharePlatformWechatTimeline) return @"wechatline";
if (platformType & GMSharePlatformWechatSessionSnapShot) return @"wechat_snapshot"; if (platformType == GMSharePlatformWechatSessionSnapShot) return @"wechat_snapshot";
if (platformType & GMSharePlatformWechatTimelineSnapShot) return @"wechatline_snapshot"; if (platformType == GMSharePlatformWechatTimelineSnapShot) return @"wechatline_snapshot";
if (platformType & GMSharePlatformWechatMiniProgram) return @"xcx"; if (platformType == GMSharePlatformWechatMiniProgram) return @"xcx";
if (platformType & GMSharePlatformSinaWeibo) return @"tsina"; if (platformType == GMSharePlatformSinaWeibo) return @"tsina";
if (platformType & GMSharePlatformDouyin) return @"Douyin"; if (platformType == GMSharePlatformDouyin) return @"Douyin";
if (platformType & GMSharePlatformCopyLink) return @"copy_url"; if (platformType == GMSharePlatformCopyLink) return @"copy_url";
return @"Default"; return @"Default";
} }
...@@ -476,8 +476,12 @@ ...@@ -476,8 +476,12 @@
NSString *description = parameters[ShareText]; NSString *description = parameters[ShareText];
WXWebpageObject *ext = [WXWebpageObject object]; WXWebpageObject *ext = [WXWebpageObject object];
ext.webpageUrl = url.absoluteString; if ([url isKindOfClass:[NSURL class]]) {
ext.webpageUrl = url.absoluteString;
} else {
ext.webpageUrl = url;
}
WXMediaMessage *message = [WXMediaMessage message]; WXMediaMessage *message = [WXMediaMessage message];
message.title = title; message.title = title;
message.description = description; message.description = description;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment