Skip to content

Commit 8996b15

Browse files
committed
企业版 MR 的 handoff 链接有误
1 parent 51a2ec2 commit 8996b15

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Coding_iOS/Controllers/RootControllers/BaseViewController.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ - (void)p_setupUserActivity{
323323
}
324324
}else if ([self isKindOfClass:MRDetailViewController.class] || [self isKindOfClass:PRDetailViewController.class]){
325325
MRPR *curMRPR = [self valueForKey:@"curMRPR"];
326-
webStr = curMRPR.path;
326+
NSString *path = curMRPR.path;
327+
NSRange range = [path rangeOfString:@"/p/"];
328+
webStr = range.location == NSNotFound? path: [path substringFromIndex:range.location];
327329
}else if ([self isKindOfClass:CodeViewController.class]){
328330
Project *curPro = ((CodeViewController *) self).myProject;
329331
CodeFile *curCF = ((CodeViewController *) self).myCodeFile;
@@ -491,6 +493,10 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
491493
//MR
492494
NSString *path = [matchedCaptures[0] stringByReplacingOccurrencesOfString:@"https://coding.net" withString:@""];
493495

496+
// NSString *defaultTeamStr = [NSString stringWithFormat:@"/u/%@", [Login curLoginCompany].global_key ?: [NSObject baseCompany]];
497+
// linkStr = [linkStr stringByReplacingCharactersInRange:NSMakeRange(pRange.location, 0) withString:defaultTeamStr];
498+
499+
494500
if ([matchedCaptures[3] isEqualToString:@"commit"]) {
495501
if ([presentingVC isKindOfClass:[CommitFilesViewController class]]) {
496502
CommitFilesViewController *vc = (CommitFilesViewController *)presentingVC;

0 commit comments

Comments
 (0)