mirror of
https://github.com/wu736139669/WlianWorld.git
synced 2026-08-05 06:23:44 +00:00
删除小鱼的信息
This commit is contained in:
BIN
Binary file not shown.
-80
@@ -51,22 +51,6 @@
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "WlianWorld/Model/BaseEntity.m"
|
||||
timestampString = "469445592.484157"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "18"
|
||||
endingLineNumber = "18"
|
||||
landmarkName = "-encodePro"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
@@ -83,54 +67,6 @@
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "WlianWorld/View/LoginViewController.m"
|
||||
timestampString = "469421484.444389"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "59"
|
||||
endingLineNumber = "59"
|
||||
landmarkName = "-bindViewModel"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "WlianWorld/View/LoginViewController.m"
|
||||
timestampString = "469421484.444389"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "60"
|
||||
endingLineNumber = "60"
|
||||
landmarkName = "-bindViewModel"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "WlianWorld/Model/BaseEntity.m"
|
||||
timestampString = "469445757.876522"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "52"
|
||||
endingLineNumber = "52"
|
||||
landmarkName = "-encodePro"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
@@ -163,22 +99,6 @@
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "WlianWorld/View/LoginViewController.m"
|
||||
timestampString = "469443518.683421"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "69"
|
||||
endingLineNumber = "69"
|
||||
landmarkName = "-bindViewModel"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
|
||||
Vendored
BIN
Binary file not shown.
@@ -6,29 +6,28 @@
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AWordDefault.h"
|
||||
#import "BaseEntity.h"
|
||||
#import "BaseModel.h"
|
||||
#import "NSString+HXAddtions.h"
|
||||
#import "AWordDefault.h"
|
||||
@implementation proFile
|
||||
|
||||
@end
|
||||
static NSString* app_key = @"123456";
|
||||
static NSString* app_key_secret = @"z*~#@kR^*N";
|
||||
@implementation BaseEntity
|
||||
- (NSDictionary *)encodePro
|
||||
- (NSDictionary*)encodePro
|
||||
{
|
||||
|
||||
NSMutableDictionary* dic= [NSMutableDictionary dictionary];;
|
||||
|
||||
|
||||
|
||||
NSMutableDictionary* dic = [NSMutableDictionary dictionary];
|
||||
;
|
||||
|
||||
[dic setObject:_callback forKey:@"callback"];
|
||||
if(_pro)
|
||||
{
|
||||
if (_pro) {
|
||||
[dic setObject:_pro forKey:@"params"];
|
||||
}
|
||||
[dic setObject:@"1" forKey:@"devicecode"];
|
||||
|
||||
|
||||
NSString* uid = [AWordDefault getUid];
|
||||
if (uid) {
|
||||
[dic setObject:uid forKey:@"uid"];
|
||||
@@ -38,63 +37,7 @@ static NSString* app_key_secret = @"z*~#@kR^*N";
|
||||
if (token) {
|
||||
[dic setObject:token forKey:@"token"];
|
||||
}
|
||||
NSString* shopid = [AWordDefault getShopId];
|
||||
if (shopid) {
|
||||
[dic setObject:shopid forKey:@"shopid"];
|
||||
}
|
||||
NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
|
||||
[dic setObject:[NSString stringWithFormat:@"%f", timeStamp] forKey:@"timestamp"];
|
||||
|
||||
[dic setObject:[self getSignWithDic:dic] forKey:@"sign"];
|
||||
|
||||
|
||||
DLog(@"参数是:%@",dic);
|
||||
NSString* jsonKey = [NSString jsonStringWithDictionary:(NSDictionary*)dic];
|
||||
NSData *nsdata = [jsonKey
|
||||
dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSString *baseKey = [nsdata base64EncodedStringWithOptions:0];
|
||||
NSMutableString *key = [[NSMutableString alloc]initWithString:baseKey];
|
||||
[key stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
NSDictionary *resultDic = @{@"key":key};
|
||||
return resultDic;
|
||||
return dic;
|
||||
}
|
||||
|
||||
|
||||
-(NSString*)getSignWithDic:(NSDictionary*)dic
|
||||
{
|
||||
NSString* resultStr = [self getStrWithDic:dic];
|
||||
NSString* appkey = [NSString stringWithFormat:@"%@%@",app_key,app_key_secret];
|
||||
NSString* md5Appkey = [[appkey md5] substringWithRange:NSMakeRange(8, 18)];
|
||||
resultStr = [resultStr stringByAppendingString:md5Appkey];
|
||||
resultStr = [resultStr md5];
|
||||
return resultStr;
|
||||
}
|
||||
|
||||
-(NSString*)getStrWithDic:(NSDictionary*)dic
|
||||
{
|
||||
NSString* resultStr = @"";
|
||||
|
||||
for (NSString* key in [dic allKeys]) {
|
||||
NSObject* obj = [dic objectForKey:key];
|
||||
if ([obj isKindOfClass:[NSDictionary class]]) {
|
||||
obj = [self getStrWithDic:(NSDictionary*)obj];
|
||||
if ([resultStr isEqualToString:@""]) {
|
||||
resultStr = obj;
|
||||
|
||||
}else{
|
||||
resultStr = [NSString stringWithFormat:@"%@&%@",resultStr,obj];
|
||||
|
||||
} }else{
|
||||
if ([resultStr isEqualToString:@""]) {
|
||||
resultStr = [NSString stringWithFormat:@"%@=%@",key,obj];
|
||||
|
||||
}else{
|
||||
resultStr = [NSString stringWithFormat:@"%@&%@=%@",resultStr,key,obj];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return resultStr;
|
||||
}
|
||||
@end
|
||||
|
||||
Vendored
BIN
Binary file not shown.
@@ -6,89 +6,86 @@
|
||||
// Copyright © 2015年 ash. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AWordDefault.h"
|
||||
#import "LoginViewController.h"
|
||||
#import "LoginViewModel.h"
|
||||
#import "AWordDefault.h"
|
||||
@interface LoginViewController ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *passwordTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField *accountTextField;
|
||||
@property (nonatomic,strong)LoginViewModel* viewModel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton* sureBtn;
|
||||
@property (weak, nonatomic) IBOutlet UITextField* passwordTextField;
|
||||
@property (weak, nonatomic) IBOutlet UITextField* accountTextField;
|
||||
@property (nonatomic, strong) LoginViewModel* viewModel;
|
||||
@end
|
||||
|
||||
@implementation LoginViewController
|
||||
|
||||
-(id)init
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if (self)
|
||||
{
|
||||
|
||||
if (self) {
|
||||
_viewModel = [[LoginViewModel alloc] init];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
|
||||
|
||||
[self bindViewModel];
|
||||
}
|
||||
|
||||
|
||||
-(void)bindViewModel
|
||||
- (void)bindViewModel
|
||||
{
|
||||
self.title = _viewModel.model.title;
|
||||
RAC(self.viewModel,account) = self.accountTextField.rac_textSignal;
|
||||
RAC(self.viewModel,password) = self.passwordTextField.rac_textSignal;
|
||||
RAC(self.viewModel, account) = self.accountTextField.rac_textSignal;
|
||||
RAC(self.viewModel, password) = self.passwordTextField.rac_textSignal;
|
||||
self.sureBtn.rac_command = self.viewModel.executeLogin;
|
||||
|
||||
|
||||
@weakify(self);
|
||||
RAC(self.sureBtn, backgroundColor) = [self.viewModel.validLoginSignal map:^id(NSNumber* value) {
|
||||
return[value boolValue] ? [UIColor redColor ]:[UIColor grayColor];
|
||||
return [value boolValue] ? [UIColor redColor] : [UIColor grayColor];
|
||||
}];
|
||||
|
||||
[self.viewModel.executeLogin.executionSignals subscribeNext:^(id result) {
|
||||
@strongify(self)
|
||||
[self.accountTextField resignFirstResponder];
|
||||
[self.accountTextField resignFirstResponder];
|
||||
[self.passwordTextField resignFirstResponder];
|
||||
|
||||
}];
|
||||
[[self.sureBtn.rac_command executing] subscribeNext:^(NSNumber *executing) {
|
||||
@strongify(self)
|
||||
if([executing boolValue]){
|
||||
[[self.sureBtn.rac_command executing] subscribeNext:^(NSNumber* executing) {
|
||||
@strongify(self) if ([executing boolValue])
|
||||
{
|
||||
[MBProgressHUD showHUDAddedTo:self.view animated:YES].labelText = @"登陆中。。。";
|
||||
}
|
||||
}];
|
||||
[self.sureBtn.rac_command.executionSignals.flatten subscribeNext:^(id x) {
|
||||
@strongify(self)
|
||||
if (self.viewModel.model.status.intValue == 0) {
|
||||
@strongify(self) if (self.viewModel.model.status.intValue == 0)
|
||||
{
|
||||
[MBProgressHUD checkHudWithView:self.view label:self.viewModel.model.msg hidesAfter:1.0];
|
||||
//[nsde];
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
DLog(@"登陆成功,信息:%@",self.viewModel.model);
|
||||
|
||||
DLog(@"登陆成功,信息:%@", self.viewModel.model);
|
||||
|
||||
[AWordDefault setUid:self.viewModel.model.userid];
|
||||
[AWordDefault setToken:self.viewModel.model.token];
|
||||
[AWordDefault setShopId:self.viewModel.model.shopid];
|
||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
|
||||
|
||||
}
|
||||
}];
|
||||
[self.sureBtn.rac_command.errors subscribeNext:^(id x) {
|
||||
@strongify(self)
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络连接错误" hidesAfter:1.0];
|
||||
[MBProgressHUD errorHudWithView:self.view label:@"网络连接错误" hidesAfter:1.0];
|
||||
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
- (void)didReceiveMemoryWarning {
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginViewController">
|
||||
|
||||
Reference in New Issue
Block a user