Skip to content

Commit 82cc5ef

Browse files
committed
服务器地址末尾保证有 ‘/’
1 parent 4021af7 commit 82cc5ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Coding_iOS/Controllers/Login/CannotLoginViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ - (void)changeBaseURLTip{
8282
[NSObject showHudTipStr:@"需要 8.0 以上系统才能切换服务器地址"];
8383
return;
8484
}
85-
UIAlertController *alertCtrl = [UIAlertController alertControllerWithTitle:@"更改服务器 URL" message:@"空白值可切换回生产环境\n(地址末尾务必加上「/」)" preferredStyle:UIAlertControllerStyleAlert];
85+
UIAlertController *alertCtrl = [UIAlertController alertControllerWithTitle:@"更改服务器 URL" message:@"空白值可切换回生产环境\n" preferredStyle:UIAlertControllerStyleAlert];
8686

8787
UIAlertAction *cancelA = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
8888
UIAlertAction *confirmA = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {

Coding_iOS/Util/OC_Category/NSObject+Common.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ + (BOOL)baseURLStrIsProduction{
139139
+ (void)changeBaseURLStrTo:(NSString *)baseURLStr{
140140
if (baseURLStr.length <= 0) {
141141
baseURLStr = kBaseURLStr;
142+
}else if ([baseURLStr hasSuffix:@"/"]){
143+
baseURLStr = [baseURLStr stringByAppendingString:@"/"];
142144
}
143145

144146
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

0 commit comments

Comments
 (0)