fix:修改addWebExtentionApi类名错误导致不能生效的问题

iOS添加changeUserId的API实现
master
wangtao 2023-03-23 11:45:52 +08:00
parent 67ccec51e4
commit 280592e888
5 changed files with 46 additions and 7 deletions

View File

@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface MOB_addWebExtentionApi : MOPBaseApi @interface MOP_addWebExtentionApi : MOPBaseApi
@property(nonatomic, copy) NSString* name; @property(nonatomic, copy) NSString* name;
@end @end

View File

@ -5,11 +5,11 @@
// Created by on 2021/12/21. // Created by on 2021/12/21.
// //
#import "MOB_addWebExtentionApi.h" #import "MOP_addWebExtentionApi.h"
#import "MopPlugin.h" #import "MopPlugin.h"
#import <FinApplet/FinApplet.h> #import <FinApplet/FinApplet.h>
@implementation MOB_addWebExtentionApi @implementation MOP_addWebExtentionApi
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel - (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
{ {

View File

@ -0,0 +1,16 @@
//
// MOP_changeUserId.h
// mop
//
// Created by on 2023/3/23.
//
#import "MOPBaseApi.h"
NS_ASSUME_NONNULL_BEGIN
@interface MOP_changeUserId : MOPBaseApi
@property (nonatomic, copy) NSString *userId;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,17 @@
//
// MOP_changeUserId.m
// mop
//
// Created by on 2023/3/23.
//
#import "MOP_changeUserId.h"
#import <FinApplet/FinApplet.h>
@implementation MOP_changeUserId
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
{
[FATClient sharedClient].config.currentUserId = self.userId;
success(@{});
}
@end

View File

@ -250,10 +250,16 @@
failure(@"初始化失败"); failure(@"初始化失败");
return; return;
} }
FATLogLevel logLevel = [self.config[@"logLevel"] integerValue];
NSInteger logLevelIntValue = [self.config[@"logLevel"] integerValue];
if (logLevelIntValue >= 5) {
[[FATClient sharedClient].logManager closeLog];
} else {
FATLogLevel logLevel = logLevelIntValue;
NSString *logDir = self.config[@"logDir"]; NSString *logDir = self.config[@"logDir"];
// [[FATExtClient sharedClient] fat_prepareExtensionApis];
[[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES]; [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES];
}
[[FATClient sharedClient] setEnableLog:YES]; [[FATClient sharedClient] setEnableLog:YES];