Commit 8eceaf8a by pierce

提交部分下载逻辑。实现md5去重

parent 330c3447
Showing with 258 additions and 87 deletions
......@@ -95,7 +95,6 @@ FOUNDATION_EXPORT const unsigned char FUSFoundationVersionString[];
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceModel.h"
#import "FUSEventTrack.h"
#import "FUSTalkingData.h"
#import "FUSLog.h"
......
......@@ -35,7 +35,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)fus_addDownloadResourceModel:(FUSDownloadResourceModel *)downloadModel;
// 执行完的回调
@property (nonatomic, copy) void(^finishTaskHandler)(BOOL succeed,FUSDownloadTaskModel *task);
@property (nonatomic, copy) void(^finishTaskHandler)(BOOL succeed,FUSDownloadTaskModel *task, NSString *filePath);
// 下载进度回调
@property (nonatomic, copy) void(^downloadProgressHandler)(BOOL succeed,FUSDownloadTaskModel *task, NSString *filePath);
// 执行成功回调
- (void)fus_executeDownloadSucceedHandlerWithFilePath:(NSString *)filePath;
......
......@@ -55,7 +55,7 @@
}
if (self.finishTaskHandler) {
self.finishTaskHandler(YES,self);
self.finishTaskHandler(YES,self,filePath);
}
}
FUSLogInfo(@"pierce:%s",__func__);
......
......@@ -11,10 +11,20 @@
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
/// 下载限速
typedef NS_ENUM(NSInteger, FUSResourceDownloaderBitrateLimited) {
FUSResourceDownloaderBitrateLimitedNoLimit = 0,
FUSResourceDownloaderBitrateLimitedLow = 1,
FUSResourceDownloaderBitrateLimitedNormal = 2,
};
NS_ASSUME_NONNULL_BEGIN
@interface FUSResourceDownloader : NSObject
/// 下载限速,默认为:FUSResourceDownloaderBitrateLimitedNoLimit
@property (nonatomic, assign) FUSResourceDownloaderBitrateLimited bitrateLimit;
/**
* 获得单列
*
......
......@@ -12,9 +12,13 @@
#import "FUSDownloadOperation.h"
#import "FUSToolSet.h"
#import <AFNetworking/AFNetworking.h>
// 列表读写锁的信号量
static dispatch_semaphore_t semaphore;
static NSString const* FUSDownloadMd5ToLocalPathDictUDKey = @"DownloadMd5ToLocalPathDictUDKey";
// 下载操作的线程队列
static dispatch_queue_t downloadOperationQueue;
static dispatch_queue_t get_downloadOperationQueue(){
......@@ -29,12 +33,36 @@ static dispatch_queue_t get_downloadOperationQueue(){
// 当前所有的任务
@property (nonatomic, strong) NSMutableDictionary <NSString *,FUSDownloadTaskModel *> *taskDict;
// md5对应的本地地址
@property (nonatomic, strong) NSMutableDictionary <NSString *,NSString *> *md5ToLocalPathDict;
// 下载任务执行队列
@property (nonatomic, strong) NSOperationQueue *downloadQueue;
// 信号量
@property (nonatomic, assign) NSInteger semaphoreCount;
/// 最大的并行
@property (nonatomic, assign) NSInteger maxConcurrentOperationCount;
/// 是否下载限速,配合单线程使用效果更佳
@property (nonatomic, assign) BOOL needLimitBitRate;
/// 最大每秒可以下载多少文件大小
@property (nonatomic, assign) NSInteger maxDownloadBitRate;
/// 上一次更新的时间
@property (nonatomic, assign) NSTimeInterval lastUpdateTime;
/// 上一秒更新的文件大小
@property (nonatomic, assign) NSInteger lastSecondSize;
@end
@interface FUSResourceDownloader (FUSDownloadLimit)
- (void)fus_bindDownloadLiscener;
@end
@implementation FUSResourceDownloader
......@@ -60,7 +88,19 @@ static dispatch_queue_t get_downloadOperationQueue(){
{
self = [super init];
if (self) {
self.maxConcurrentOperationCount = 3;
self.maxDownloadBitRate = 1 * 1024 * 1024;
self.needLimitBitRate = NO;
self.bitrateLimit = FUSResourceDownloaderBitrateLimitedNoLimit;
self.taskDict = [NSMutableDictionary dictionary];
self.md5ToLocalPathDict = [[[NSUserDefaults standardUserDefaults] objectForKey:FUSDownloadMd5ToLocalPathDictUDKey] mutableCopy];
if ([NSDictionary isNull:self.md5ToLocalPathDict]) {
self.md5ToLocalPathDict = [NSMutableDictionary dictionary];
}
[self fus_bindDownloadLiscener];
}
return self;
}
......@@ -73,17 +113,33 @@ static dispatch_queue_t get_downloadOperationQueue(){
@autoreleasepool {
[self fus_addDataLock];
FUSDownloadTaskModel *task = self.taskDict[resource.resourceUrl];
/// 因为线上存在很多同个md5但是不同资源地址的文件。
/// 所以这里记录md5 -> 本地地址的映射,
/// 如果文件md5对应的本地地址存在,那么就直接返回这个资源下载成功
NSString *taskKey = [self fus_taskKeyWithDownloadUrl:resource.resourceUrl md5:resource.md5];
NSString *filePath = self.md5ToLocalPathDict[taskKey];
if (![NSString isNull:filePath]) {
/// 如果当前的资源已经有了本地文件了,那么直接返回下载成功
if (resource.succeedHandler) {
resource.succeedHandler(filePath);
}
FUSLogInfo(@"pierce:%s exist taskKey = %@;res = %@; local = %@",__func__,taskKey, resource.resourceUrl, filePath);
[self fus_removeDataLock];
return;
}
FUSDownloadTaskModel *task = self.taskDict[taskKey];
[self fus_removeDataLock];
BOOL isNewTask = NO;
if (!task) {
task = [[FUSDownloadTaskModel alloc] init];
__weak typeof(self) weakSelf = self;
task.finishTaskHandler = ^(BOOL succeed, FUSDownloadTaskModel * _Nonnull task) {
[weakSelf fus_removeTask:task];
task.finishTaskHandler = ^(BOOL succeed, FUSDownloadTaskModel * _Nonnull task, NSString * _Nonnull filePath) {
[weakSelf fus_removeTask:task filePath:filePath];
};
isNewTask = YES;
FUSLogInfo(@"pierce:%s isNewTask %@",__func__,resource.resourceUrl);
FUSLogInfo(@"pierce:%s isNewTask taskKey = %@; res = %@",__func__,taskKey, resource.resourceUrl);
}
[task fus_addDownloadResourceModel:resource];
......@@ -98,25 +154,37 @@ static dispatch_queue_t get_downloadOperationQueue(){
operation.queuePriority = task.downloadPriority;
[self.downloadQueue addOperation:operation];
} else {
FUSLogInfo(@"pierce:%s not NewTask",__func__);
FUSLogInfo(@"pierce:%s not NewTask taskKey = %@; res = %@",__func__,taskKey, resource.resourceUrl);
task.opertaion.queuePriority = task.downloadPriority;
}
}
});
}
- (void)fus_removeTask:(FUSDownloadTaskModel *)task {
- (void)fus_removeTask:(FUSDownloadTaskModel *)task filePath:(NSString * _Nonnull)filePath {
[self fus_addDataLock];
[self.taskDict removeObjectForKey:task.downloadUrl];
NSString *taskKey = [self fus_taskKeyWithDownloadUrl:task.downloadUrl md5:task.downloadMd5];
[self.taskDict removeObjectForKey:taskKey];
self.md5ToLocalPathDict[taskKey] = filePath;
[[NSUserDefaults standardUserDefaults] setObject:self.md5ToLocalPathDict forKey:FUSDownloadMd5ToLocalPathDictUDKey];
[[NSUserDefaults standardUserDefaults] synchronize];
[self fus_removeDataLock];
}
- (NSString *)fus_taskKeyWithDownloadUrl:(NSString *)downloadUrl md5:(NSString *)md5 {
if ([NSString isNull:md5]) {
return downloadUrl;
}
return md5;
}
- (NSOperationQueue *)downloadQueue {
if (!_downloadQueue) {
_downloadQueue = [[NSOperationQueue alloc] init];
_downloadQueue.maxConcurrentOperationCount = 3;
_downloadQueue.maxConcurrentOperationCount = self.maxConcurrentOperationCount;
}
return _downloadQueue;
}
......@@ -146,3 +214,75 @@ static dispatch_queue_t get_downloadOperationQueue(){
}
@end
@implementation FUSResourceDownloader (FUSDownloadLimit)
- (void)fus_bindDownloadLiscener {
__weak typeof(self) weakSelf = self;
/// 下载限速
[FUSHttpManager setDownloadTaskDidWriteDataBlock:^(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
if (weakSelf.needLimitBitRate == NO) {
return;
}
if (bytesWritten > weakSelf.maxDownloadBitRate) {
NSTimeInterval waitTime = bytesWritten / weakSelf.maxDownloadBitRate;
[weakSelf fus_suspendTask:downloadTask waitTime:waitTime];
return;
}
NSTimeInterval time = [NSDate date].timeIntervalSince1970;
if (time - weakSelf.lastUpdateTime > 1) {
/// 如果大于1s,则更新时间
weakSelf.lastSecondSize = 0;
weakSelf.lastUpdateTime = time;
return;
}
weakSelf.lastSecondSize += bytesWritten;
if (weakSelf.lastSecondSize > weakSelf.maxDownloadBitRate) {
NSTimeInterval waitTime = 1 - (time - weakSelf.lastUpdateTime);
[weakSelf fus_suspendTask:downloadTask waitTime:waitTime];
}
}];
}
- (void)setBitrateLimit:(FUSResourceDownloaderBitrateLimited)bitrateLimit {
_bitrateLimit = bitrateLimit;
switch (bitrateLimit) {
case FUSResourceDownloaderBitrateLimitedLow:
self.needLimitBitRate = YES;
self.maxDownloadBitRate = 1 * 500 * 1024;
break;
case FUSResourceDownloaderBitrateLimitedNormal:
self.needLimitBitRate = YES;
self.maxDownloadBitRate = 2 * 1024 * 1024;
break;
case FUSResourceDownloaderBitrateLimitedNoLimit:
self.needLimitBitRate = NO;
break;
}
}
- (void)fus_suspendTask:(NSURLSessionDownloadTask *)task waitTime:(NSTimeInterval)waitTime {
if (waitTime <= 0) {
return;
}
[task suspend];
__weak typeof(self) weakSelf = self;
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:waitTime repeats:NO block:^(NSTimer * _Nonnull timer) {
[task resume];
weakSelf.lastSecondSize = 0;
weakSelf.lastUpdateTime = [NSDate date].timeIntervalSince1970;
}];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
}
@end
//
// FUSResourceDownloadModel.h
// FusiLive
//
// Created by pierce on 2021/1/4.
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSBaseModel.h"
//typedef <#existing#> <#new#>;
NS_ASSUME_NONNULL_BEGIN
@interface FUSResourceDownloadModel : FUSBaseModel
// 资源id
@property (nonatomic, copy) NSString *resourceId;
// 资源路径
@property (nonatomic, copy) NSString *resourceUrl;
// md5
@property (nonatomic, copy) NSString *md5;
@end
NS_ASSUME_NONNULL_END
......@@ -1206,7 +1206,7 @@
}
// 拼接下载地址及下载存储路径
NSString *downPath = [FUSConfig.sharedInstanced.pathConfigs.downloadPathDocument stringByAppendingPathComponent:relativePath];
NSString *downPath = [FUSConfig.sharedInstanced.pathConfigs.downloadPathDocument stringByAppendingPathComponent:relativePath];
NSString *cachePath = [DOWNLOAD_PATH_CACHES stringByAppendingPathComponent:relativePath];
NSString *downUrl = [NSString stringWithString:dnsUrl];
if ([downUrl rangeOfString:relativePath].location == NSNotFound) {
......
......@@ -508,5 +508,7 @@ typedef enum : NSUInteger {
*/
+ (NSString *_Nonnull)fus_getHttUrl:(NSString *_Nonnull)url params:(NSDictionary *_Nullable)params;
/// 下载回调,用于整体限速
+ (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block;
@end
......@@ -38,8 +38,29 @@
#import "UIKit+AFNetworking.h"
#import "FUSToolSet.h"
@interface FUSHttpManager ()
/// 下载回调
@property (nonatomic, copy) void(^downloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
@end
@implementation FUSHttpManager
+ (instancetype)sharedInstance {
static id shared = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
shared = [[super alloc] init];
});
return shared;
}
+ (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block {
FUSHttpManager.sharedInstance.downloadTaskDidWriteDataBlock = block;
}
#pragma mark -- 监测网络工作状态
......@@ -742,6 +763,8 @@
NSArray *contentTypes = [NSArray arrayWithObjects:@"application/json", @"text/json", @"text/plain", @"text/html", nil];
AFHTTPSessionManager *manager = [self creatHttpManagerWithRequestType:HTTPRequestType responseType:HTTPResponseType contentTypes:contentTypes timeout:0];
[manager setDownloadTaskDidWriteDataBlock:FUSHttpManager.sharedInstance.downloadTaskDidWriteDataBlock];
__block NSURLSessionDownloadTask *task = [manager downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
if (progress) {
dispatch_async(dispatch_get_main_queue(), ^{
......
......@@ -599,6 +599,7 @@ static dispatch_queue_t get_status_queue() {
[[NSUserDefaults standardUserDefaults] setObject:@(0) forKey:TABBAR_ITEM_SOUND];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:SHOULD_REMOTE_NOTIFICATION_TIP];
[[NSUserDefaults standardUserDefaults] setObject:URL_WEB_BAOFANG_ACTIVE_URL forKey:UDKEY_BAOFANG_ACTIVE_PAGE_WEB_URL];
[[NSUserDefaults standardUserDefaults] setObject:@([NSDate date].timeIntervalSince1970) forKey:FirstLaunchTimeUDKey];
}
//第一次记录到的时间(目前只比较是不是第二天,不管有没有够24h)
......
......@@ -110,7 +110,7 @@ typedef NS_ENUM(NSUInteger,JumpType) {
case JTExchangeDew:
{
FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
exchangeDewVC.webUrlString = URL_WEB_DEW_EXCHANGE_DEW;
exchangeDewVC.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress;
exchangeDewVC.shouldIncludeIdentifyInfo = YES;
[currentController.navigationController pushViewController:exchangeDewVC animated:YES];
}
......
......@@ -121,6 +121,9 @@
// 是否已经加载
@property (nonatomic, assign) BOOL isLoadedLaunch;
/// 用户下载至今的时间
@property (nonatomic, assign, readonly) NSTimeInterval downloadTime;
// 创建单例
+ (FUSCacheDataShare *)shareStore;
......
......@@ -25,6 +25,18 @@
return instance;
}
- (instancetype)init {
self = [super init];
if (self) {
if (self.downloadTime <= 3 * 60 * 60 * 24) {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedNormal;
} else {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedNoLimit;
}
}
return self;
}
// 是否审核状态
+ (BOOL)fus_isCheckStatus{
if([[[NSUserDefaults standardUserDefaults] objectForKey:@"CHECK_STATUS"] integerValue]){
......@@ -178,4 +190,14 @@
[[NSNotificationCenter defaultCenter] postNotificationName:FUS_USER_TRADE_REMIND_CHANGE_NOTIFICATION object:userTradeRemindModel];
}
- (NSTimeInterval)downloadTime {
NSTimeInterval downloadDate = [[NSUserDefaults standardUserDefaults] floatForKey:FirstLaunchTimeUDKey];
if (downloadDate <= 0) {
downloadDate = [NSDate date].timeIntervalSince1970;
[[NSUserDefaults standardUserDefaults] setFloat:downloadDate forKey:FirstLaunchTimeUDKey];
}
return [NSDate date].timeIntervalSince1970 - downloadDate;
}
@end
......@@ -15,6 +15,8 @@
#define kFUSConfigTalkingDataUDKey @"openStatswith"
// 标记非第一次启动
#define NOT_FIRST_LAUNCH_BOOL @"NotFirstLaunchBool"
// 第一次启动时间
#define FirstLaunchTimeUDKey @"FirstLaunchTimeUDKey"
// 第一次允许联网
#define FIRST_LAUNCH_NETWORK_ALLOW @"FirstLaunchNetworkAllow"
// 自动登录标记
......
......@@ -1071,29 +1071,9 @@
//消费记录
#define URL_WEB_CONSUME_RECORD DNS_WEB(@"/Nesting/recording/consum.html")
// 宝石记录
#define URL_WEB_DIAMOND_RECORD DNS_WEB(@"/Nesting/recording/gem.html")
// 露水记录
#define URL_WEB_DEW_RECORD DNS_WEB(@"/Nesting/recording/dew.html")
// 可提现萤火
#define URL_WEB_FIREFLY_WITHDRAW DNS_WEB(@"/Nesting/fireflyRmb/canFireFly.html")
// 兑换露水页面
#define URL_WEB_DEW_EXCHANGE_DEW DNS_WEB(@"/Nesting/dew/exchangeDew.html")
// 兑换露水半屏网页
#define URL_WEB_DEW_EXCHANGE_DEW_HALF DNS_WEB(@"/Nesting/dew/exchangeDewRoom.html")
// 可提现萤火
#define URL_WEB_FIREFLY_WITHDRAW DNS_WEB(@"/Nesting/fireflyRmb/canFireFly.html")
// 累计萤火
#define URL_WEB_TOTAL_FIREFLY DNS_WEB(@"/Nesting/fireflyRmb/index.html")
// 露水消费记录
#define URL_WEB_DEW_CONSUM DNS_WEB(@"/Nesting/dew/dewConsum.html")
// 露水获得记录
#define URL_WEB_DEW_MONEY DNS_WEB(@"/Nesting/dew/devMoney.html")
......
......@@ -187,6 +187,7 @@ extern NSString * const kEneterRoomGiftCenterDownloadFinishNotification;
@param completion 成功回调
*/
- (void)fus_fetchWebpResourceWithResourceUrl:(NSString *)resourceUrl
resourceMd5:(NSString *)resourceMd5
completion:(void(^)(YYImage *yyImage))completion;
/**
......
......@@ -1420,21 +1420,21 @@ NSString * const kMD5GiftResourceKey = @"kMD5GiftResourceKey";
@param completion 成功回调
*/
- (void)fus_fetchWebpResourceWithResourceUrl:(NSString *)resourceUrl
resourceMd5:(NSString *)resourceMd5
completion:(void(^)(YYImage *yyImage))completion
{
NSString *filePath = [NSString stringWithFormat:@"%@%@", FUSConfig.sharedInstanced.pathConfigs.downloadPathDocument, resourceUrl];
if (![FUSFileHelper fus_isExistFileAtPath:filePath]) {
// 如果文件不存在
if (completion) {
completion(nil);
}
// 重新下载
[self checkResourceDownloadWithResourceUrl:resourceUrl resourceMd5:nil gid:nil success:^{
[self checkResourceDownloadWithResourceUrl:resourceUrl resourceMd5:resourceMd5 gid:nil success:^{
[self fus_fetchWebpResourceWithResourceUrl:resourceUrl resourceMd5:resourceMd5 completion:completion];
} failure:^(NSString *msg, int code) {
// 如果文件不存在
if (completion) {
completion(nil);
}
}];
return;
......
......@@ -179,6 +179,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 刷新 liveFunctionView 数据
[self.liveFunctionView fus_refreshFunctionView];
self.hiddenNavigationBar = YES;
if (FUSCacheDataShare.shareStore.downloadTime <= 3 * 60 * 60 * 24) {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedLow;
} else {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedNoLimit;
}
}
- (void)viewWillDisappear:(BOOL)animated {
......
......@@ -780,6 +780,12 @@
// [FUSLiveHelper shareInstance].pushStreamSwitchTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:[FUSLiveHelper shareInstance] selector:@selector(onPushStreamTimeOutTimer:) userInfo:nil repeats:NO];
[[FUSLiveHelper shareInstance] performSelector:@selector(onPushStreamTimeOutTimer:) withObject:nil afterDelay:1];
[[NSNotificationCenter defaultCenter] postNotificationName:QUICK_LIVE_ROOM object:nil];
if (FUSCacheDataShare.shareStore.downloadTime <= 3 * 60 * 60 * 24) {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedNormal;
} else {
FUSResourceDownloader.shareInstance.bitrateLimit = FUSResourceDownloaderBitrateLimitedNoLimit;
}
}
/**
......
......@@ -207,7 +207,7 @@
{
FUSHalfWebViewModel *halfWebModel = [[FUSHalfWebViewModel alloc] init];
halfWebModel.popupType = FUSHalfWebViewPopupTypeHalfWeb;
halfWebModel.url = URL_WEB_DEW_EXCHANGE_DEW_HALF;
halfWebModel.url = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewHalfAddress;
halfWebModel.clickBlank = YES;
halfWebModel.transparency = YES;
halfWebModel.heightR = @(82).stringValue;
......
......@@ -75,9 +75,9 @@
[self bringSubviewToFront:self.bgImageView];
if ([NSString isNull:self.animationModel.giftModel.darkRes]) {
[self fus_loadWebpImageWithURL:self.animationModel.resource];
[self fus_loadWebpImageWithURL:self.animationModel.resource resourceMd5:nil];
} else {
[self fus_loadWebpImageWithURL:self.animationModel.giftModel.darkRes];
[self fus_loadWebpImageWithURL:self.animationModel.giftModel.darkRes resourceMd5:self.animationModel.giftModel.darkMd5];
}
}
......@@ -87,11 +87,13 @@
@param resourceUrl 资源地址
*/
- (void)fus_loadWebpImageWithURL:(NSString *)resourceUrl
resourceMd5:(NSString *)resourceMd5
{
// 使用 YYIMage 来显示 WEBP 图片
__weak typeof(self) weakSelf = self;
[[FUSGiftDataCenter sharedCenter] fus_fetchWebpResourceWithResourceUrl:resourceUrl completion:^(YYImage *yyImage) {
[[FUSGiftDataCenter sharedCenter] fus_fetchWebpResourceWithResourceUrl:resourceUrl
resourceMd5:resourceMd5 completion:^(YYImage *yyImage) {
if (!yyImage) {
return;
......
......@@ -2667,7 +2667,7 @@ static FUSLiveGiftView *giftView = nil;
FUSHalfWebViewModel *halfWebModel = [[FUSHalfWebViewModel alloc] init];
halfWebModel.popupType = FUSHalfWebViewPopupTypeHalfWeb;
halfWebModel.url = URL_WEB_DEW_EXCHANGE_DEW_HALF;
halfWebModel.url = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewHalfAddress;
halfWebModel.clickBlank = YES;
halfWebModel.transparency = YES;
halfWebModel.heightR = @(82).stringValue;
......@@ -2730,7 +2730,7 @@ static FUSLiveGiftView *giftView = nil;
FUSHalfWebViewModel *halfWebModel = [[FUSHalfWebViewModel alloc] init];
halfWebModel.popupType = FUSHalfWebViewPopupTypeHalfWeb;
halfWebModel.url = URL_WEB_DEW_EXCHANGE_DEW_HALF;
halfWebModel.url = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewHalfAddress;
halfWebModel.clickBlank = YES;
halfWebModel.transparency = YES;
halfWebModel.heightR = @(82).stringValue;
......
......@@ -334,7 +334,8 @@
self.webpMotorImageView.alpha = 0;
__weak typeof(self) weakSelf = self;
[[YYWebImageManager sharedManager] requestImageWithURL:[NSURL URLWithString:[FUSConfig.sharedInstanced.pathConfigs downloadPath:motorModel.darkRes]] options:0 progress:nil transform:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
NSString *filePath = [[FUSGiftDataCenter sharedCenter] fus_fetchWebpResourceWithResourceUrl:motorModel.darkRes resourceMd5:motorModel.darkMd5 completion:^(YYImage *yyImage) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
......
......@@ -329,7 +329,7 @@
FUSHalfWebViewModel *halfWebModel = [[FUSHalfWebViewModel alloc] init];
halfWebModel.popupType = FUSHalfWebViewPopupTypeHalfWeb;
halfWebModel.url = URL_WEB_DEW_EXCHANGE_DEW_HALF;
halfWebModel.url = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewHalfAddress;
halfWebModel.clickBlank = YES;
halfWebModel.transparency = YES;
halfWebModel.heightR = @(82).stringValue;
......
......@@ -353,7 +353,7 @@
if (buttonIndex == 0) {
FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
exchangeDewVC.webUrlString = URL_WEB_DEW_EXCHANGE_DEW;
exchangeDewVC.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress;
exchangeDewVC.needShowReload = YES;
exchangeDewVC.shouldIncludeIdentifyInfo = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:exchangeDewVC animated:YES];
......
......@@ -89,11 +89,11 @@
rechargeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&method=%@&lang=%@",URL_WEB_RECHARGE,uid,token,lang];
}else if (_recordType == FUSRecordTypeDew) {
[FUSTalkingData fus_trackEvent:EVENT_ME_DEW_CONSUMERECORD];
consumeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&token=%@&lang=%@",URL_WEB_DEW_CONSUM,uid,token,lang];
consumeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&token=%@&lang=%@",FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.chipTradeAddress,uid,token,lang];
rechargeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&token=%@&lang=%@",URL_WEB_DEW_MONEY,uid,token,lang];
} else if (_recordType == FUSRecordTypeJewelAndDew) {
consumeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&method=%@&lang=%@",URL_WEB_DIAMOND_RECORD,uid,token,lang];
rechargeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&method=%@&lang=%@",URL_WEB_DEW_RECORD,uid,token,lang];
consumeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&method=%@&lang=%@",FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.gemTradeAddress,uid,token,lang];
rechargeVc.webUrlString = [NSString stringWithFormat:@"%@?uid=%@&method=%@&lang=%@",FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.chipTradeAddress,uid,token,lang];
}
......
......@@ -19,7 +19,7 @@
- (instancetype)init {
self = [super init];
if (self) {
self.webUrlString = URL_WEB_DEW_EXCHANGE_DEW;
self.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress;
self.needShowReload = YES;
self.shouldIncludeIdentifyInfo = YES;
}
......
......@@ -247,7 +247,7 @@
{
//talkingdata埋点
[FUSTalkingData fus_trackEvent:EVENT_ME_CASH_TOTAL];
[self loadWebControllerWithUrl:URL_WEB_TOTAL_FIREFLY];
[self loadWebControllerWithUrl:FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.accumulateAddress];
}
/**
......
......@@ -313,7 +313,7 @@
// _dewAccountItem.itemClick = ^(FUSCustomSettingItem *item) {
// [FUSTalkingData fus_trackEvent:EVENT_ME_DEW];
//// FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
//// exchangeDewVC.webUrlString = URL_WEB_DEW_EXCHANGE_DEW;
//// exchangeDewVC.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress;
//// exchangeDewVC.needShowReload = YES;
//// exchangeDewVC.shouldIncludeIdentifyInfo = YES;
////
......
......@@ -1038,14 +1038,14 @@ static NSString *FUSWebRightBtnExtraInfoKey = @"FUSWebRightBtnExtraInfoKey";
if (FUSConfig.sharedInstanced.liveConfigs.isInRoom) {
FUSHalfWebViewModel *halfWebModel = [[FUSHalfWebViewModel alloc] init];
halfWebModel.popupType = FUSHalfWebViewPopupTypeHalfWeb;
halfWebModel.url = URL_WEB_DEW_EXCHANGE_DEW_HALF;
halfWebModel.url = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewHalfAddress;
halfWebModel.clickBlank = YES;
halfWebModel.transparency = YES;
halfWebModel.heightR = @(82).stringValue;
[FUSLiveHelper.shareInstance.currentFunctionView fus_showHalfWebView:halfWebModel];
} else {
FUSWKWebViewController *exchangeDewVC = [[FUSWKWebViewController alloc] init];
exchangeDewVC.webUrlString = URL_WEB_DEW_EXCHANGE_DEW;
exchangeDewVC.webUrlString = FUSCacheDataShare.shareStore.settingInitDataModel.fusiConfig.dewFullfAddress;
exchangeDewVC.needShowReload = YES;
exchangeDewVC.shouldIncludeIdentifyInfo = YES;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -88,7 +88,6 @@
#import "FUSDownloadResourceModel.h"
#import "FUSDownloadTaskModel.h"
#import "FUSResourceDownloader.h"
#import "FUSResourceModel.h"
#import "FUSEventTrack.h"
#import "FUSTalkingData.h"
#import "FUSLog.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment