Skip to content

Commit

Permalink
perf: rename EZNiuTransAPIKey
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Nov 15, 2023
1 parent aa1e861 commit f76c784
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Easydict/Feature/Service/Model/EZConstKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static NSString *const EZOpenAIModelKey = @"EZOpenAIModelKey";


static NSString *const EZDeepLAuthKey = @"EZDeepLAuthKey";
static NSString *const EZNiuTransAuthKey = @"EZNiuTransAuthKey";
static NSString *const EZNiuTransAPIKey = @"EZNiuTransAPIKey";

static NSString *const EZBingCookieKey = @"EZBingCookieKey";

Expand Down
10 changes: 5 additions & 5 deletions Easydict/Feature/Service/Niutrans/EZNiuTransTranslate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@interface EZNiuTransTranslate ()

@property (nonatomic, copy) NSString *authKey;
@property (nonatomic, copy) NSString *apiKey;

@end

Expand All @@ -27,9 +27,9 @@ - (instancetype)init {
return self;
}

- (NSString *)authKey {
NSString *authKey = [[NSUserDefaults standardUserDefaults] stringForKey:EZNiuTransAuthKey] ?: @"";
return authKey;
- (NSString *)apiKey {
NSString *apiKey = [[NSUserDefaults standardUserDefaults] stringForKey:EZNiuTransAPIKey] ?: @"";
return apiKey;
}


Expand Down Expand Up @@ -126,7 +126,7 @@ - (void)niuTransTranslate:(NSString *)text from:(EZLanguage)from to:(EZLanguage)
NSString *url = [NSString stringWithFormat:@"%@/NiuTransServer/translation", host];

NSDictionary *params = @{
@"apikey" : self.authKey,
@"apikey" : self.apiKey,
@"src_text" : text,
@"from" : souceLangCode,
@"to" : targetLangCode
Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Utility/EZLinkParser/EZSchemeParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ - (NSArray *)allowedReadWriteKeys {
EZDeepLAuthKey,
EZDeepLTranslationAPIKey,

EZNiuTransAuthKey,
EZNiuTransAPIKey,

EZIntelligentQueryModeKey,

Expand Down

0 comments on commit f76c784

Please sign in to comment.