@@ -164,19 +164,19 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
164
164
presentingVC = [BaseViewController presentingVC ];
165
165
}
166
166
167
- NSString *userRegexStr = @" /u/([^/]+)$" ;
168
- NSString *userTweetRegexStr = @" /u/([^/]+)/bubble$" ;
169
- NSString *ppRegexStr = @" /u/([^/]+)/pp/([0-9]+)" ;
170
- NSString *pp_projectRegexStr = @" /u /([^/]+)/p/([^\? ]+)[\? ]pp=([0-9]+)$" ;
171
- NSString *topicRegexStr = @" /u /([^/]+)/p/([^/]+)/topic/(\\ d+)" ;
172
- NSString *taskRegexStr = @" /u /([^/]+)/p/([^/]+)/task/(\\ d+)" ;
173
- NSString *fileRegexStr = @" /u /([^/]+)/p/([^/]+)/attachment/([^/]+)/preview/(\\ d+)" ;
174
- NSString *gitMRPRCommitRegexStr = @" /u /([^/]+)/p/([^/]+)/git/(merge|pull|commit)/([^/#]+)" ;
175
- NSString *conversionRegexStr = @" /user/messages/history/([^/]+)$" ;
176
- NSString *pp_topicRegexStr = @" /pp/topic/([0-9]+)$" ;
177
- NSString *codeRegexStr = @" /u /([^/]+)/p/([^/]+)/git/blob/([^/]+)[/]?([^?]*)" ;
178
- NSString *twoFARegexStr = @" /app_intercept/show_2fa" ;
179
- NSString *projectRegexStr = @" /u /([^/]+)/p/([^/]+)" ;
167
+ NSString *userRegexStr = @" /u/([^/]+)$" ;// AT某人
168
+ NSString *userTweetRegexStr = @" /u/([^/]+)/bubble$" ;// 某人的冒泡
169
+ NSString *ppRegexStr = @" /u/([^/]+)/pp/([0-9]+)" ;// 冒泡
170
+ NSString *pp_projectRegexStr = @" /[ut] /([^/]+)/p/([^\? ]+)[\? ]pp=([0-9]+)$" ;// 项目内冒泡(含团队项目)
171
+ NSString *topicRegexStr = @" /[ut] /([^/]+)/p/([^/]+)/topic/(\\ d+)" ;// 讨论(含团队项目)
172
+ NSString *taskRegexStr = @" /[ut] /([^/]+)/p/([^/]+)/task/(\\ d+)" ;// 任务(含团队项目)
173
+ NSString *fileRegexStr = @" /[ut] /([^/]+)/p/([^/]+)/attachment/([^/]+)/preview/(\\ d+)" ;// 文件(含团队项目)
174
+ NSString *gitMRPRCommitRegexStr = @" /[ut] /([^/]+)/p/([^/]+)/git/(merge|pull|commit)/([^/#]+)" ;// MR(含团队项目)
175
+ NSString *conversionRegexStr = @" /user/messages/history/([^/]+)$" ;// 私信
176
+ NSString *pp_topicRegexStr = @" /pp/topic/([0-9]+)$" ;// 话题
177
+ NSString *codeRegexStr = @" /[ut] /([^/]+)/p/([^/]+)/git/blob/([^/]+)[/]?([^?]*)" ;// 代码(含团队项目)
178
+ NSString *twoFARegexStr = @" /app_intercept/show_2fa" ;// 两步验证
179
+ NSString *projectRegexStr = @" /[ut] /([^/]+)/p/([^/]+)" ;// 项目(含团队项目)
180
180
NSArray *matchedCaptures = nil ;
181
181
if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: ppRegexStr]).count > 0 ){
182
182
// 冒泡
@@ -197,6 +197,7 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
197
197
analyseVC = vc;
198
198
}
199
199
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: pp_projectRegexStr]).count > 0 ){
200
+ // 项目内冒泡
200
201
NSString *owner_user_global_key = matchedCaptures[1 ];
201
202
NSString *project_name = matchedCaptures[2 ];
202
203
NSString *pp_id = matchedCaptures[3 ];
@@ -279,6 +280,7 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
279
280
analyseVC = vc;
280
281
}
281
282
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: fileRegexStr]).count > 0 ){
283
+ // 文件
282
284
NSString *user_global_key = matchedCaptures[1 ];
283
285
NSString *project_name = matchedCaptures[2 ];
284
286
NSString *fileId = matchedCaptures[4 ];
@@ -331,6 +333,7 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
331
333
vc.topicID = pp_topic_id.integerValue ;
332
334
analyseVC = vc;
333
335
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: codeRegexStr]).count > 0 ){
336
+ // 代码
334
337
NSString *user_global_key = matchedCaptures[1 ];
335
338
NSString *project_name = matchedCaptures[2 ];
336
339
NSString *ref = matchedCaptures[3 ];
0 commit comments