refactor(ios): 统一用户信息变量名从userInfo改为userinfo

修改ShutoApi中用户信息相关变量名,保持命名一致性
移除fireEventWithCallback中冗余的parameters日志输出
This commit is contained in:
2026-01-22 14:55:29 +08:00
parent a570be7cbe
commit 4dbb2d615e
2 changed files with 8 additions and 9 deletions

View File

@@ -8,14 +8,14 @@
@interface ShutoApi : CDVPlugin <ShutoApiProtocol>
@property (nonatomic, copy) NSString* eventCallbackId;
@property (nonatomic, strong) NSDictionary* userInfo;
@property (nonatomic, strong) NSDictionary* userinfo;
@property (nonatomic, strong) NSMutableDictionary* eventCallbacks;
@property (nonatomic, assign) BOOL isIonicReady;
- (void)close:(CDVInvokedUrlCommand*)command;
- (void)registerEvent:(CDVInvokedUrlCommand*)command;
- (void)getUserInfo:(CDVInvokedUrlCommand*)command;
- (void)setUserInfo:(NSDictionary*)userInfo;
- (void)setUserInfo:(NSDictionary*)userinfo;
- (void)navigateToRoute:(NSString*)route parameters:(NSDictionary*)parameters;
- (void)fireEvent:(NSString*)type parameters:(NSDictionary*)parameters;
- (void)fireEventWithCallback:(NSString*)eventName parameters:(NSDictionary*)parameters callback:(void (^)(NSDictionary* result, NSError* error))callback;

View File

@@ -64,8 +64,8 @@
{
//
CDVPluginResult* pluginResult;
if (self.userInfo) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:self.userInfo];
if (self.userinfo) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:self.userinfo];
} else {
//
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:nil];
@@ -73,12 +73,11 @@
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
- (void)setUserInfo:(NSDictionary*)userInfo
- (void)setUserInfo:(NSDictionary*)userinfo
{
//
if (userInfo) {
self.userInfo = userInfo;
[SGGC_Log log:@"SGGC_CDVFile" message:(@"ShutoApi: User info set successfully: %@", userInfo)];
if (userinfo) {
self.userinfo = userinfo;
} else {
[SGGC_Log log:@"SGGC_CDVFile" message:(@"ShutoApi: Invalid user info provided")];
}
@@ -120,7 +119,7 @@
//
- (void)fireEventWithCallback:(NSString*)eventName parameters:(NSDictionary*)parameters callback:(void (^)(NSDictionary* result, NSError* error))callback {
[SGGC_Log log:@"SGGC_CDVFile" message:[NSString stringWithFormat:@"ShutoApi: fireEventWithCallback called, eventName=%@, parameters=%@", eventName, parameters]];
[SGGC_Log log:@"SGGC_CDVFile" message:[NSString stringWithFormat:@"ShutoApi: fireEventWithCallback called, eventName=%@", eventName]];
if (!self.eventCallbackId) {
[SGGC_Log log:@"SGGC_CDVFile" message:@"ShutoApi: No event callback registered"];