Skip to content

Commit d39558c

Browse files
committed
fix
1 parent 50738f3 commit d39558c

File tree

10 files changed

+52
-11
lines changed

10 files changed

+52
-11
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,8 @@
12041204
B14689C11EE100B200B01371 /* vip_4_45@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689B11EE100B200B01371 /* vip_4_45@3x.png */; };
12051205
B14689C21EE100B200B01371 /* vip_4_75@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689B21EE100B200B01371 /* vip_4_75@2x.png */; };
12061206
B14689C31EE100B200B01371 /* vip_4_75@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B14689B31EE100B200B01371 /* vip_4_75@3x.png */; };
1207+
B19D4EE11F690F5E00C598F3 /* file_activity_icon_rename@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B19D4EDF1F690F5E00C598F3 /* file_activity_icon_rename@2x.png */; };
1208+
B19D4EE21F690F5E00C598F3 /* file_activity_icon_rename@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B19D4EE01F690F5E00C598F3 /* file_activity_icon_rename@3x.png */; };
12071209
B1C871131EADAEE1003DACF0 /* loading_monkey@2x.gif in Resources */ = {isa = PBXBuildFile; fileRef = B1C871121EADAEE1003DACF0 /* loading_monkey@2x.gif */; };
12081210
B1C871181EADF0B1003DACF0 /* messageAT@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1C871141EADF0B1003DACF0 /* messageAT@3x.png */; };
12091211
B1C871191EADF0B1003DACF0 /* messageComment@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = B1C871151EADF0B1003DACF0 /* messageComment@3x.png */; };
@@ -3164,6 +3166,8 @@
31643166
B14689B11EE100B200B01371 /* vip_4_45@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_4_45@3x.png"; sourceTree = "<group>"; };
31653167
B14689B21EE100B200B01371 /* vip_4_75@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_4_75@2x.png"; sourceTree = "<group>"; };
31663168
B14689B31EE100B200B01371 /* vip_4_75@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vip_4_75@3x.png"; sourceTree = "<group>"; };
3169+
B19D4EDF1F690F5E00C598F3 /* file_activity_icon_rename@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_activity_icon_rename@2x.png"; sourceTree = "<group>"; };
3170+
B19D4EE01F690F5E00C598F3 /* file_activity_icon_rename@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "file_activity_icon_rename@3x.png"; sourceTree = "<group>"; };
31673171
B1C871121EADAEE1003DACF0 /* loading_monkey@2x.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "loading_monkey@2x.gif"; sourceTree = "<group>"; };
31683172
B1C871141EADF0B1003DACF0 /* messageAT@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "messageAT@3x.png"; sourceTree = "<group>"; };
31693173
B1C871151EADF0B1003DACF0 /* messageComment@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "messageComment@3x.png"; sourceTree = "<group>"; };
@@ -4503,6 +4507,8 @@
45034507
4EAE06BB1B7B51AF00179F4B /* file_activity_icon */ = {
45044508
isa = PBXGroup;
45054509
children = (
4510+
B19D4EDF1F690F5E00C598F3 /* file_activity_icon_rename@2x.png */,
4511+
B19D4EE01F690F5E00C598F3 /* file_activity_icon_rename@3x.png */,
45064512
B1C871AD1EB2D9F0003DACF0 /* file_activity_icon_create@3x.png */,
45074513
B1C871AE1EB2D9F0003DACF0 /* file_activity_icon_delete_history@3x.png */,
45084514
B1C871AF1EB2D9F0003DACF0 /* file_activity_icon_move_file@3x.png */,
@@ -7115,6 +7121,7 @@
71157121
D0C447A61C02A3C700DC1C4B /* privatemessage_selected@2x.png in Resources */,
71167122
4E2DB34C1BA6AEB4002F27C4 /* coding_emoji_gif_07@2x.png in Resources */,
71177123
B1C8717D1EB18599003DACF0 /* calendar_0x59A2FF@2x.png in Resources */,
7124+
B19D4EE21F690F5E00C598F3 /* file_activity_icon_rename@3x.png in Resources */,
71187125
8E97CEB71A0C7E26006F9AD7 /* coding_emoji_32@2x.png in Resources */,
71197126
8E97CEA71A0C7E26006F9AD7 /* coding_emoji_16@2x.png in Resources */,
71207127
4EAAD05C1E544006008AA957 /* icon_triangle@3x.png in Resources */,
@@ -7155,6 +7162,7 @@
71557162
D0C447E01C02DB8900DC1C4B /* project_normal@3x.png in Resources */,
71567163
D0C447A51C02A3C700DC1C4B /* privatemessage_normal@2x.png in Resources */,
71577164
8EA6D19819E240C40076D59C /* tipIcon_ProjectMember@2x.png in Resources */,
7165+
B19D4EE11F690F5E00C598F3 /* file_activity_icon_rename@2x.png in Resources */,
71587166
8E97CEA81A0C7E26006F9AD7 /* coding_emoji_17@2x.png in Resources */,
71597167
4E6383B91B32640900D98648 /* messageLeft_bg_img@2x.png in Resources */,
71607168
4E80E95A1E02911E00DE1BC6 /* search_icon_project@2x.png in Resources */,
@@ -7383,15 +7391,15 @@
73837391
};
73847392
B7C390DEFD2073480C56FD88 /* [CP] Copy Pods Resources */ = {
73857393
isa = PBXShellScriptBuildPhase;
7386-
buildActionMask = 2147483647;
7394+
buildActionMask = 8;
73877395
files = (
73887396
);
73897397
inputPaths = (
73907398
);
73917399
name = "[CP] Copy Pods Resources";
73927400
outputPaths = (
73937401
);
7394-
runOnlyForDeploymentPostprocessing = 0;
7402+
runOnlyForDeploymentPostprocessing = 1;
73957403
shellPath = /bin/sh;
73967404
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Coding_iOS/Pods-Coding_iOS-resources.sh\"\n";
73977405
showEnvVarsInLog = 0;

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</dict>
3737
</array>
3838
<key>CFBundleVersion</key>
39-
<string>4.4.5.201706021100</string>
39+
<string>4.4.5.201706021500</string>
4040
<key>ITSAppUsesNonExemptEncryption</key>
4141
<false/>
4242
<key>LSApplicationQueriesSchemes</key>

Coding_iOS/Ease_2FA/Controllers/ZXScanCodeViewController.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
@interface ZXScanCodeViewController : BaseViewController
1313
@property (strong, nonatomic, readonly) AVCaptureVideoPreviewLayer *videoPreviewLayer;
14-
- (BOOL)isScaning;
14+
15+
@property (assign, nonatomic, readonly) BOOL isScaning;
16+
1517
- (void)startScan;
1618
- (void)stopScan;
1719

Coding_iOS/Ease_2FA/Controllers/ZXScanCodeViewController.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ @interface ZXScanCodeViewController ()<AVCaptureMetadataOutputObjectsDelegate, U
1717

1818
@property (strong, nonatomic) AVCaptureVideoPreviewLayer *videoPreviewLayer;
1919
@property (strong, nonatomic) CIDetector *detector;
20+
21+
@property (assign, nonatomic, readwrite) BOOL isScaning;
22+
2023
@end
2124

2225
@implementation ZXScanCodeViewController
@@ -136,6 +139,7 @@ - (void)configUI{
136139
make.height.mas_equalTo(30);
137140
}];
138141
[_scanRectView addSubview:_lineView];
142+
_isScaning = YES;
139143
[_videoPreviewLayer.session startRunning];
140144
[self scanLineStartAction];
141145
}
@@ -185,6 +189,9 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:
185189
}
186190

187191
- (void)analyseResult:(AVMetadataMachineReadableCodeObject *)result{
192+
if (!_isScaning) {
193+
return;
194+
}
188195
if (![result isKindOfClass:[AVMetadataMachineReadableCodeObject class]]) {
189196
return;
190197
}
@@ -232,6 +239,9 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
232239
}
233240

234241
- (void)handleImageInfo:(NSDictionary *)info{
242+
if (!_isScaning) {
243+
return;
244+
}
235245
//停止扫描
236246
[self stopScan];
237247

@@ -260,14 +270,13 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
260270
}
261271

262272
#pragma mark public
263-
- (BOOL)isScaning{
264-
return _videoPreviewLayer.session.isRunning;
265-
}
266273
- (void)startScan{
274+
_isScaning = YES;
267275
[self.videoPreviewLayer.session startRunning];
268276
[self scanLineStartAction];
269277
}
270278
- (void)stopScan{
279+
_isScaning = NO;
271280
[self.videoPreviewLayer.session stopRunning];
272281
[self scanLineStopAction];
273282
}
1.59 KB
Loading
2.75 KB
Loading

Coding_iOS/Models/ProjectActivity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
@interface ProjectActivity : NSObject
2222
@property (readwrite, nonatomic, strong) NSNumber *id;
23-
@property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content, *merge_request_path, *pull_request_path, *version;
23+
@property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content, *merge_request_path, *pull_request_path, *version, *old_name;
2424
@property (readwrite, nonatomic, strong) User *user, *target_user, *watcher;
2525
@property (readwrite, nonatomic, strong) NSDate *created_at;
2626
@property (readwrite, nonatomic, strong) Task *origin_task, *task;

Coding_iOS/Models/ProjectActivity.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ - (NSMutableString *)actionStr{
114114
[_actionStr appendFormat:@"%@", _project_topic.parent.title];
115115
}
116116
}else if ([_target_type isEqualToString:@"ProjectFile"]){
117-
[_actionStr appendString:[_type isEqualToString:@"dir"]? @"文件夹": @"文件"];
117+
if ([_action isEqualToString:@"rename"]) {
118+
[_actionStr appendString:@"修改了文件名称"];
119+
}else{
120+
[_actionStr appendString:[_type isEqualToString:@"dir"]? @"文件夹": @"文件"];
121+
}
118122
}else if ([_target_type isEqualToString:@"ProjectFileComment"]){
119123
[_actionStr appendFormat:@"文件「%@」的评论", _projectFile.title];
120124
}else if ([_target_type isEqualToString:@"Depot"]){
@@ -176,7 +180,11 @@ - (NSMutableString *)contentStr{
176180
[_contentStr saveAppendString:_project_topic.title];
177181
}
178182
}else if ([_target_type isEqualToString:@"ProjectFile"]){
179-
[_contentStr saveAppendString:_file.name];
183+
if ([_action isEqualToString:@"rename"]) {
184+
[_contentStr appendFormat:@"%@ -> %@", _old_name, _file.name];
185+
}else{
186+
[_contentStr saveAppendString:_file.name];
187+
}
180188
}else if ([_target_type isEqualToString:@"ProjectFileComment"]){
181189
[_contentStr saveAppendString:_projectFileComment.content];
182190
}else if ([_target_type isEqualToString:@"Depot"]){

Coding_iOS/Util/Manager/CodingNetAPIClient.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ - (void)requestJsonDataWithPath:(NSString *)aPath
5959
if (!aPath || aPath.length <= 0) {
6060
return;
6161
}
62+
//CSRF - 跨站请求伪造
63+
NSHTTPCookie *_CSRF = nil;
64+
for (NSHTTPCookie *tempC in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
65+
if ([tempC.name isEqualToString:@"XSRF-TOKEN"]) {
66+
_CSRF = tempC;
67+
}
68+
}
69+
if (_CSRF) {
70+
[self.requestSerializer setValue:_CSRF.value forHTTPHeaderField:@"X-XSRF-TOKEN"];
71+
}
6272
//log请求数据
6373
DebugLog(@"\n===========request===========\n%@\n%@:\n%@", kNetworkMethodName[method], aPath, params);
6474
aPath = [aPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

Coding_iOS/Views/Cell/FileActivityCell.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ + (NSAttributedString *)attrContentWithObj:(ProjectActivity *)curActivity{
2323
contentStr = [NSString stringWithFormat:@"%@ 历史版本 V%@ - %@", curActivity.action_msg, curActivity.version, [curActivity.created_at stringDisplay_HHmm]];
2424

2525
}else{
26-
contentStr = [NSString stringWithFormat:@"%@ 文件 - %@", curActivity.action_msg, [curActivity.created_at stringDisplay_HHmm]];
26+
if ([curActivity.action isEqualToString:@"rename"]) {
27+
contentStr = [NSString stringWithFormat:@"修改了文件名称 - %@", [curActivity.created_at stringDisplay_HHmm]];
28+
}else{
29+
contentStr = [NSString stringWithFormat:@"%@ 文件 - %@", curActivity.action_msg, [curActivity.created_at stringDisplay_HHmm]];
30+
}
2731
}
2832

2933
attrContent = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", userName, contentStr]];

0 commit comments

Comments
 (0)