iOS直接緩存數(shù)據(jù)的網(wǎng)絡(luò)請求庫封裝(利用AF3.0&YYCache)

前言:
開發(fā)中我們經(jīng)常需要緩存某個(gè)界面的數(shù)據(jù),那么我們?nèi)绻诿總€(gè)界面都去寫這樣的緩存代碼就會變得非常繁瑣...于是,一直在考慮封裝一個(gè)自己的自帶緩存功能的網(wǎng)絡(luò)請求庫.....
首先說明下,需要用到哪些第三方庫...主要是AFNetWoking 3.0(主要用于請求網(wǎng)絡(luò)數(shù)據(jù)),YYCache(主要用于生成緩存到內(nèi)存和硬盤,更新和刪除緩存等操作).
這里的YYCache底層實(shí)現(xiàn),他會將數(shù)據(jù)緩存在內(nèi)存中,和磁盤上,當(dāng)數(shù)據(jù)量少的時(shí)候,是直接存在本地?cái)?shù)據(jù)庫.db中,數(shù)據(jù)量大的話,會以文件的形式存放
下面只是部分代碼實(shí)現(xiàn)....詳細(xì)的,請看我gitHub上的demo 希望大家多多指教
鏈接地址如下
https://github.com/BrightMoment/D-Y/tree/master/HttpWithCacheDemo

1.先看下網(wǎng)絡(luò)請求類的.h文件(HttpRequestWithCache.h)

#import <Foundation/Foundation.h>

//連接可自己替換
#define urlStr @"http://192.168.0.199:8888/yuyue_m/"

@protocol HttpRequestCacheDelegate <NSObject>

@optional
-(void)httpSuccess:(id)response bindTag:(NSString *)bindTag;

-(void)httpError:(NSString *)error bindTag:(NSString *)bindTag;

@end

@interface HttpRequestWithCache : NSObject

-(instancetype)initWithDelegate:(id)requestDelegate bindTag:(NSString *)bindTag needToken:(NSInteger)needToken;

@property (nonatomic,assign)  id requestDelegate;
@property (nonatomic,copy)  NSString *bindTag;
@property (nonatomic,assign)  NSInteger needToken;

#pragma mark - Get方法(默認(rèn)方法)
//不帶緩存
-(void)httpGetRequest:(NSString *)api params:(NSMutableDictionary *)params;
-(void)httpGetCacheRequest:(NSString *)api params:(NSMutableDictionary *)params;
#pragma mark - Post方法
//不帶緩存
-(void)httpPostRequest:(NSString *)api params:(NSMutableDictionary *)params;
-(void)httpPostCacheRequest:(NSString *)api params:(NSMutableDictionary *)params;

#pragma mark - 上傳文件方法
//上傳單張圖片
-(void)upLoadDataWithUrlStr:(NSString *)api params:(NSMutableDictionary *)params imageKey:(NSString *)name withData:(NSData *)data;
//上傳多張圖片
-(void)upLoadDataWithUrlStr:(NSString *)api params:(NSMutableDictionary *)params  withDataArray:(NSArray *)dataArray;

@end

上面代碼中方法寫的很明確,攜帶Cache的方法,就是可以對從服務(wù)器拿到的數(shù)據(jù)進(jìn)行緩存的方法,
2.這些方法的具體實(shí)現(xiàn),我們來看下.m文件

#import "HttpRequestWithCache.h"
#import "AFNetworking.h"
#import "YYCache.h"

//YYCache緩存文件存放的文件夾
NSString * const HttpCache = @"HttpRequestCache";
#define DYLog(...) NSLog(__VA_ARGS__)  //如果不需要打印數(shù)據(jù), 注釋掉NSLog

// 請求方式
typedef NS_ENUM(NSInteger, RequestType) {
    RequestTypeGet,
    RequestTypePost,
    RequestTypeUpLoad,//單個(gè)上傳
    RequestTypeMultiUpload,//多個(gè)上傳
    RequestTypeDownload
};

@implementation HttpRequestWithCache
{
    __weak HttpRequestWithCache *weakSelf;

}
-(instancetype)initWithDelegate:(id)requestDelegate bindTag:(NSString *)bindTag needToken:(NSInteger)needToken
{
    if (self =[super init]) {
        self.requestDelegate=requestDelegate;
        self.bindTag=bindTag;
        self.needToken=needToken;
        weakSelf=self;
    }
    return self;
}

#pragma mark - Get方法(默認(rèn)方法)

//不帶緩存
-(void)httpGetRequest:(NSString *)api params:(NSMutableDictionary *)params
{
    [self httpRequestWithUrlStr:api params:params requestType:RequestTypeGet isCache:NO cacheKey:nil imageKey:nil withData:nil withDataArray:nil];
}

-(void)httpGetCacheRequest:(NSString *)api params:(NSMutableDictionary *)params
{
   [self httpRequestWithUrlStr:api params:params requestType:RequestTypeGet isCache:YES cacheKey:[urlStr stringByAppendingString:api] imageKey:nil withData:nil withDataArray:nil];
}

#pragma mark - Post方法
//不帶緩存
-(void)httpPostRequest:(NSString *)api params:(NSMutableDictionary *)params
{
    [self httpRequestWithUrlStr:api params:params requestType:RequestTypePost isCache:NO cacheKey:nil imageKey:nil withData:nil withDataArray:nil];
}

-(void)httpPostCacheRequest:(NSString *)api params:(NSMutableDictionary *)params
{
    [self httpRequestWithUrlStr:api params:params requestType:RequestTypePost isCache:YES cacheKey:[urlStr stringByAppendingString:api] imageKey:nil withData:nil withDataArray:nil];
}

#pragma mark - 上傳文件方法
//上傳單張圖片 name一般寫file
-(void)upLoadDataWithUrlStr:(NSString *)api params:(NSMutableDictionary *)params imageKey:(NSString *)name withData:(NSData *)data
{
   [self httpRequestWithUrlStr:api params:params requestType:RequestTypeUpLoad isCache:NO cacheKey:[urlStr stringByAppendingString:api] imageKey:name withData:data withDataArray:nil];
}

//上傳多張圖片
-(void)upLoadDataWithUrlStr:(NSString *)api params:(NSMutableDictionary *)params  withDataArray:(NSArray *)dataArray
{
    [self httpRequestWithUrlStr:api params:params requestType:RequestTypeUpLoad isCache:NO cacheKey:[urlStr stringByAppendingString:api] imageKey:nil withData:nil withDataArray:dataArray];
}

#pragma mark - 網(wǎng)絡(luò)請求統(tǒng)一處理
/**
 *
 *
 *  @param api         后臺的接口名
 *  @param params      參數(shù)dict
 *  @param requestType 請求類型
 *  @param isCache     是否緩存標(biāo)志
 *  @param cacheKey    緩存的對應(yīng)key值
 *  @param name        圖片上傳的名字(upload)
 *  @param data        圖片的二進(jìn)制數(shù)據(jù)(upload)
 *  @param dataArray   多圖片上傳時(shí)的imageDataArray
 */
-(void)httpRequestWithUrlStr:(NSString *)api params:(NSMutableDictionary *)params requestType:(RequestType)requestType isCache:(BOOL)isCache cacheKey:(NSString *)cacheKey imageKey:(NSString *)name withData:(NSData *)data withDataArray:(NSArray *)dataArray
{
    NSString *url=[NSString stringWithFormat:@"%@%@",urlStr,api];
    url=[url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    
    if (params==nil) {
        params=[NSMutableDictionary dictionary];
    }
    
    NSString *token=[[NSUserDefaults standardUserDefaults] objectForKey:@"token"];
    NSLog(@"token:%@",token);
    token=(token==nil)?@"":token;
    
    //是否需要token
    if(self.needToken)
    {
        //未登錄提示登錄操作
//        if([token isEqualToString:@""])
//        {
//            
//            
//            [[AppDelegate sharedAppDelegate]presentToLoginView:self._delegate success:^{
//                //登錄成功之后,繼續(xù)剛才未完成的 接口操作
//                [weakSelf updateImage:api params:params WithImageData:imageData];
//            }];
//            return;
//        }
        [params setObject:token forKey:@"token"];
    }
    
    NSString *allUrl=[self urlDictToStringWithUrlStr:url WithDict:params];
    DYLog(@"\\n\\n 網(wǎng)址 \\n\\n      %@    \\n\\n 網(wǎng)址 \\n\\n",allUrl);
    
    //設(shè)置YYCache屬性
    YYCache *cache = [[YYCache alloc] initWithName:HttpCache];
    
    cache.memoryCache.shouldRemoveAllObjectsOnMemoryWarning = YES;
    cache.memoryCache.shouldRemoveAllObjectsWhenEnteringBackground = YES;
    
    id cacheData;
    /* 此處要修改為,服務(wù)端不要求重新拉取數(shù)據(jù)時(shí)執(zhí)行;注意當(dāng)緩存沒取到時(shí),重新訪問接口
    if (isCache) {
        
        //根據(jù)網(wǎng)址從Cache中取數(shù)據(jù)
        cacheData = [cache objectForKey:cacheKey];
        if(cacheData!=nil)
        {
            //將數(shù)據(jù)統(tǒng)一處理
            [self returnDataWithRequestData:cacheData];
        }
    }
    */
    //進(jìn)行網(wǎng)絡(luò)檢查
    if (![self requestBeforeJudgeConnect])
    {
        //斷網(wǎng)
//        [self showError:@"請檢查網(wǎng)絡(luò)連接"];
       DYLog(@"\\n\\n----%@------\\n\\n",@"沒有網(wǎng)絡(luò)");
        //斷網(wǎng)后,根據(jù)網(wǎng)址從Cache中取數(shù)據(jù)進(jìn)行顯示
       id cacheData = [cache objectForKey:cacheKey];
        if(cacheData!=nil)
        {
            //將數(shù)據(jù)統(tǒng)一處理
            [self returnDataWithRequestData:cacheData];
        }
        return;
    }
    
    
    AFHTTPSessionManager *session=[AFHTTPSessionManager manager];
    session.responseSerializer.acceptableContentTypes=[NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html", nil];
    //超時(shí)時(shí)間
    session.requestSerializer.timeoutInterval=10;
    session.responseSerializer=[AFHTTPResponseSerializer serializer];
    //Get請求
    if (requestType==RequestTypeGet)
    {
        [session GET:url parameters:params progress:^(NSProgress * _Nonnull downloadProgress) {
            
        } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            
            [weakSelf dealWithResponseObject:responseObject cacheUrl:allUrl cacheData:cacheData isCache:isCache cache:cache cacheKey:cacheKey];
            
        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
            [weakSelf showError:@"請檢查網(wǎng)絡(luò)設(shè)置"];
        }];
    }
    else if (requestType==RequestTypePost)
    {
        [session POST:url parameters:params progress:^(NSProgress * _Nonnull downloadProgress) {
            
        } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            
            [weakSelf dealWithResponseObject:responseObject cacheUrl:allUrl cacheData:cacheData isCache:isCache cache:cache cacheKey:cacheKey];
            
        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
            [weakSelf showError:@"請檢查網(wǎng)絡(luò)設(shè)置"];
        }];

    }
    else if (requestType==RequestTypeUpLoad)
    {
        [session POST:url parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
            NSTimeInterval timeInterVal = [[NSDate date] timeIntervalSince1970];
            NSString * fileName = [NSString stringWithFormat:@"%@.png",@(timeInterVal)];
            [formData appendPartWithFileData:data name:name fileName:fileName mimeType:@"image/png"];
            
        } progress:^(NSProgress * _Nonnull uploadProgress) {
           //(float)uploadProgress.completedUnitCount/(float)uploadProgress.totalUnitCount
        } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            
            [weakSelf dealWithResponseObject:responseObject cacheUrl:allUrl cacheData:cacheData isCache:isCache cache:nil cacheKey:nil];
            
        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
            [weakSelf showError:@"上傳文件出錯(cuò)"];
        }];
     }
    else if (requestType==RequestTypeMultiUpload)
    {
        [session POST:url parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
            
            for (NSInteger i = 0; i < dataArray.count; i++)
            {
                NSData *imageData = [dataArray objectAtIndex:i];
                //name和服務(wù)端約定好
                [formData appendPartWithFileData:imageData name:@"file" fileName:[NSString stringWithFormat:@"%zi.jpg",i] mimeType:@"image/jpeg"];
            }
            
        } progress:^(NSProgress * _Nonnull uploadProgress) {
            //(float)uploadProgress.completedUnitCount/(float)uploadProgress.totalUnitCount
        } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
            
            [weakSelf dealWithResponseObject:responseObject cacheUrl:allUrl cacheData:cacheData isCache:isCache cache:nil cacheKey:nil];
            
        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
            [weakSelf showError:@"上傳文件出錯(cuò)"];
        }];
    }

}
#pragma mark  統(tǒng)一處理請求到的數(shù)據(jù)
-(void)dealWithResponseObject:(NSData *)responseData cacheUrl:(NSString *)cacheUrl cacheData:(id)cacheData isCache:(BOOL)isCache cache:(YYCache*)cache cacheKey:(NSString *)cacheKey  //cacheData暫不理會
{
    dispatch_async(dispatch_get_main_queue(), ^{
        [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;// 關(guān)閉網(wǎng)絡(luò)指示器
    });
    
    
    NSString * dataString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    dataString = [self deleteSpecialCodeWithStr:dataString];
    DYLog(@"response\\n%@\\n",dataString);
    NSData *requestData = [dataString dataUsingEncoding:NSUTF8StringEncoding];
    
    if (isCache) {
        //需要緩存,就進(jìn)行緩存
        [cache setObject:requestData forKey:cacheKey];
        
    }
    /*
    //如果不緩存 或 數(shù)據(jù)不相同,就把網(wǎng)絡(luò)返回的數(shù)據(jù)顯示
    if (!isCache || ![cacheData isEqual:requestData]) {
        
        [self returnDataWithRequestData:requestData];
    }
     */
    //不管緩不緩存都要顯示數(shù)據(jù)
    [self returnDataWithRequestData:requestData];
}

#pragma mark - 根據(jù)返回的數(shù)據(jù)進(jìn)行統(tǒng)一的格式處理-requestData 網(wǎng)絡(luò)或者是緩存的數(shù)據(jù)-
- (void)returnDataWithRequestData:(NSData *)requestData
{
    id myResult = [NSJSONSerialization JSONObjectWithData:requestData options:NSJSONReadingMutableContainers error:nil];
    
    
    //判斷是否為字典
    if ([myResult isKindOfClass:[NSDictionary  class]]) {
        NSDictionary *  response = (NSDictionary *)myResult;
        
//        //根據(jù)返回的接口內(nèi)容來變
        id success = [response objectForKey:@"success"];
        NSString* message = [response objectForKey:@"message"];
        //success存在,并且為0時(shí)
        if(success && ![success boolValue])//處理掉0的情況,直接進(jìn)報(bào)錯(cuò)處理
        {
            if([message isKindOfClass:[NSString class]] && message.length>0)
            {
                //message不為空
            } else
            {
                message = @"";
            }
            
            [self showError:message];
            
            return;
        }
        
        NSLog(@"返回Json\\n%@\\n",response);
        //把data層剝掉
        NSDictionary *dict=[response objectForKey:@"data"];
        
        [self showSuccess:dict];
    }

}
#pragma mark - 拼接請求的網(wǎng)絡(luò)地址
/**
 *  拼接請求的網(wǎng)絡(luò)地址
 *
 *  @param urlStr     基礎(chǔ)網(wǎng)址
 *  @param parameters 拼接參數(shù)
 *
 *  @return 拼接完成的網(wǎng)址
 */
-(NSString *)urlDictToStringWithUrlStr:(NSString *)urlString WithDict:(NSDictionary *)parameters
{
    if (!parameters) {
        return urlString;
    }
    
    
    NSMutableArray *parts = [NSMutableArray array];
    //enumerateKeysAndObjectsUsingBlock會遍歷dictionary并把里面所有的key和value一組一組的展示給你花盐,每組都會執(zhí)行這個(gè)block 這其實(shí)就是傳遞一個(gè)block到另一個(gè)方法揽惹,在這個(gè)例子里它會帶著特定參數(shù)被反復(fù)調(diào)用敲茄,直到找到一個(gè)ENOUGH的key,然后就會通過重新賦值那個(gè)BOOL *stop來停止運(yùn)行,停止遍歷同時(shí)停止調(diào)用block
    [parameters enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
        //字符串處理
        key=[NSString stringWithFormat:@"%@",key];
        obj=[NSString stringWithFormat:@"%@",obj];
        
        //接收key
        NSString *finalKey = [key stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        //接收值
        NSString *finalValue = [obj stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        
        
        NSString *part =[NSString stringWithFormat:@"%@=%@",finalKey,finalValue];
        
        [parts addObject:part];
        
    }];
    
    NSString *queryString = [parts componentsJoinedByString:@"&"];
    
    queryString = queryString.length!=0 ? [NSString stringWithFormat:@"?%@",queryString] : @"";
    
    NSString *pathStr = [NSString stringWithFormat:@"%@%@",urlString,queryString];
    
    return pathStr;
    
}
#pragma mark -- 處理json格式的字符串中的換行符兄春、回車符
- (NSString *)deleteSpecialCodeWithStr:(NSString *)str {
    NSString *string = [str stringByReplacingOccurrencesOfString:@"\\r" withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@"\\n" withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@"\\n" withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@"\\t" withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@" " withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@"(" withString:@""];
    string = [string stringByReplacingOccurrencesOfString:@")" withString:@""];
    return string;
}

#pragma mark  網(wǎng)絡(luò)判斷
-(BOOL)requestBeforeJudgeConnect
{
    struct sockaddr zeroAddress;
    bzero(&zeroAddress, sizeof(zeroAddress));
    zeroAddress.sa_len = sizeof(zeroAddress);
    zeroAddress.sa_family = AF_INET;
    SCNetworkReachabilityRef defaultRouteReachability =
    SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress);
    SCNetworkReachabilityFlags flags;
    BOOL didRetrieveFlags =
    SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags);
    CFRelease(defaultRouteReachability);
    if (!didRetrieveFlags) {
        printf("Error. Count not recover network reachability flags\\n");
        return NO;
    }
    BOOL isReachable = flags & kSCNetworkFlagsReachable;
    BOOL needsConnection = flags & kSCNetworkFlagsConnectionRequired;
    BOOL isNetworkEnable  =(isReachable && !needsConnection) ? YES : NO;
    dispatch_async(dispatch_get_main_queue(), ^{
        [UIApplication sharedApplication].networkActivityIndicatorVisible =isNetworkEnable;/*  網(wǎng)絡(luò)指示器的狀態(tài): 有網(wǎng)絡(luò) : 開  沒有網(wǎng)絡(luò): 關(guān)  */
    });
    return isNetworkEnable;
}

#pragma mark - 返回?cái)?shù)據(jù)的調(diào)度顯示
-(void)showSuccess:(id)response
{
    if(!self.requestDelegate) return;
    
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored"-Wundeclared-selector"
    
    if ([self.requestDelegate respondsToSelector:@selector(httpSuccess:tag:)])
    {
        [self.requestDelegate performSelector:@selector(httpSuccess:tag:) withObject:response withObject:self.bindTag];
        return;
    }
    
    #pragma clang diagnostic pop
}

-(void)showError:(NSString *)error
{
    if(!self.requestDelegate) return;
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored"-Wundeclared-selector"
    
    if ([self.requestDelegate respondsToSelector:@selector(httpError:tag:)])
    {
        [self.requestDelegate performSelector:@selector(httpError:tag:) withObject:error withObject:self.bindTag];
        return;
    }
    
    #pragma clang diagnostic pop
}
@end

上面代碼著重注意下面的幾行

    //設(shè)置YYCache屬性
    YYCache *cache = [[YYCache alloc] initWithName:HttpCache];
    
    cache.memoryCache.shouldRemoveAllObjectsOnMemoryWarning = YES;
    cache.memoryCache.shouldRemoveAllObjectsWhenEnteringBackground = YES;
    
    id cacheData;
    /* 此處要修改為,服務(wù)端不要求重新拉取數(shù)據(jù)時(shí)執(zhí)行;注意當(dāng)緩存沒取到時(shí),重新訪問接口
    if (isCache) {
        
        //根據(jù)網(wǎng)址從Cache中取數(shù)據(jù)
        cacheData = [cache objectForKey:cacheKey];
        if(cacheData!=nil)
        {
            //將數(shù)據(jù)統(tǒng)一處理
            [self returnDataWithRequestData:cacheData];
        }
    }
    */
    //進(jìn)行網(wǎng)絡(luò)檢查
    if (![self requestBeforeJudgeConnect])
    {
        //斷網(wǎng)
//        [self showError:@"請檢查網(wǎng)絡(luò)連接"];
       DYLog(@"\\n\\n----%@------\\n\\n",@"沒有網(wǎng)絡(luò)");
        //斷網(wǎng)后,根據(jù)網(wǎng)址從Cache中取數(shù)據(jù)進(jìn)行顯示
       id cacheData = [cache objectForKey:cacheKey];
        if(cacheData!=nil)
        {
            //將數(shù)據(jù)統(tǒng)一處理
            [self returnDataWithRequestData:cacheData];
        }
        return;
    }

作用在于我們在拿到服務(wù)器數(shù)據(jù)之后,我們是不是把數(shù)據(jù)緩存到本地(需要服務(wù)器配合),但是在斷網(wǎng)的情況下,我們是直接取緩存中的數(shù)據(jù)進(jìn)行使用的...

存放網(wǎng)絡(luò)數(shù)據(jù)到緩存的代碼是

    NSString * dataString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    dataString = [self deleteSpecialCodeWithStr:dataString];
    DYLog(@"response\\n%@\\n",dataString);
    NSData *requestData = [dataString dataUsingEncoding:NSUTF8StringEncoding];
    
    if (isCache) {
        //需要緩存,就進(jìn)行緩存
        [cache setObject:requestData forKey:cacheKey];
        
    }

上面只是部分代碼實(shí)現(xiàn)....詳細(xì)的,請看我gitHub上的demo 希望大家多多指教
鏈接地址為
https://github.com/BrightMoment/D-Y/tree/master/HttpWithCacheDemo

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子倘要,更是在濱河造成了極大的恐慌,老刑警劉巖力惯,帶你破解...
    沈念sama閱讀 206,839評論 6 482
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件碗誉,死亡現(xiàn)場離奇詭異,居然都是意外死亡父晶,警方通過查閱死者的電腦和手機(jī)哮缺,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,543評論 2 382
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來甲喝,“玉大人尝苇,你說我怎么就攤上這事。” “怎么了糠溜?”我有些...
    開封第一講書人閱讀 153,116評論 0 344
  • 文/不壞的土叔 我叫張陵淳玩,是天一觀的道長。 經(jīng)常有香客問我非竿,道長蜕着,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,371評論 1 279
  • 正文 為了忘掉前任红柱,我火速辦了婚禮承匣,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘锤悄。我一直安慰自己韧骗,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,384評論 5 374
  • 文/花漫 我一把揭開白布零聚。 她就那樣靜靜地躺著袍暴,像睡著了一般。 火紅的嫁衣襯著肌膚如雪隶症。 梳的紋絲不亂的頭發(fā)上政模,一...
    開封第一講書人閱讀 49,111評論 1 285
  • 那天,我揣著相機(jī)與錄音蚂会,去河邊找鬼览徒。 笑死,一個(gè)胖子當(dāng)著我的面吹牛颂龙,可吹牛的內(nèi)容都是我干的习蓬。 我是一名探鬼主播,決...
    沈念sama閱讀 38,416評論 3 400
  • 文/蒼蘭香墨 我猛地睜開眼措嵌,長吁一口氣:“原來是場噩夢啊……” “哼躲叼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起企巢,我...
    開封第一講書人閱讀 37,053評論 0 259
  • 序言:老撾萬榮一對情侶失蹤枫慷,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后浪规,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體或听,經(jīng)...
    沈念sama閱讀 43,558評論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,007評論 2 325
  • 正文 我和宋清朗相戀三年笋婿,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了誉裆。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,117評論 1 334
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡缸濒,死狀恐怖足丢,靈堂內(nèi)的尸體忽然破棺而出粱腻,到底是詐尸還是另有隱情,我是刑警寧澤斩跌,帶...
    沈念sama閱讀 33,756評論 4 324
  • 正文 年R本政府宣布绍些,位于F島的核電站,受9級特大地震影響耀鸦,放射性物質(zhì)發(fā)生泄漏柬批。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,324評論 3 307
  • 文/蒙蒙 一袖订、第九天 我趴在偏房一處隱蔽的房頂上張望萝快。 院中可真熱鬧,春花似錦著角、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,315評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至冰更,卻和暖如春产徊,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背蜀细。 一陣腳步聲響...
    開封第一講書人閱讀 31,539評論 1 262
  • 我被黑心中介騙來泰國打工舟铜, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人奠衔。 一個(gè)月前我還...
    沈念sama閱讀 45,578評論 2 355
  • 正文 我出身青樓谆刨,卻偏偏與公主長得像,于是被迫代替她去往敵國和親归斤。 傳聞我的和親對象是個(gè)殘疾皇子痊夭,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,877評論 2 345

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 171,519評論 25 707
  • 雙搶記 (朱家稻花香) “打起谷子呦呵,挑起擔(dān)子呦呵脏里,割禾的...
    朱家稻花香閱讀 988評論 3 16
  • 昨天跑去裝修公司確定最后的設(shè)計(jì)方案并簽合同她我,在一堆動線優(yōu)化功能分區(qū)風(fēng)格選擇色調(diào)搭配以及螺螄殼里做道場的燒腦間隙,瞅...
    慢慢飛奔閱讀 430評論 1 1
  • 迫横,
    五角錢的小布丁閱讀 257評論 0 0
  • “繪本”番舆,大家都不陌生的詞語,怎樣讓繪本發(fā)揮極致呢矾踱? 現(xiàn)在很多家長注意到了這一點(diǎn)恨狈,從小給孩子看書可以培養(yǎng)孩子的閱讀...
    初見小A閱讀 250評論 0 0