1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // AppDelegate.m
- // UUTUtils2.1
- //
- // Created by 刘玉涛 on 2018/4/10.
- // Copyright © 2018年 dym. All rights reserved.
- //
- #import "AppDelegate.h"
- #import "ProjectListWC.h"
- #import "DataUtils.h"
- #import "ZGWebUtils.h"
- #import "AdWorthJsonGenerator.h"
- #import "UrlCrptyUtils.h"
- #import "ZGJsonUtils.h"
- @class AMPathPopUpButton;
- @interface AppDelegate ()
- @property (weak) IBOutlet NSWindow *window;
- @property (strong) ProjectListWC *ProjectListWC;
- @end
- @implementation AppDelegate
- - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
- // Insert code here to initialize your application
- if (NO) {
- NSMutableDictionary *md = [NSMutableDictionary dictionaryWithCapacity:0];
- // cfg = @"zhuge test";
- md[@"packname"] = @"com.billiards.shooting.ball.pool";
- md[@"sdkVersion"] = @(1);
-
- NSString *cfg = [NSString stringWithContentsOfFile:@"/Users/zhuge/workspace/git/Billiards/Billiards/Resources/ad.json" encoding:NSUTF8StringEncoding error:nil];
- // NSDictionary *dicAd = [ZGJsonUtils stringToObject:cfg];
- // NSMutableDictionary *mdAd = [NSMutableDictionary dictionaryWithCapacity:0];
- // mdAd[@"ad"] = dicAd;
- // mdAd[@"parameters"] = @"{\"LSR\":\"1000\",\"GTSR\":\"1000\"}";
-
- // cfg = [ZGJsonUtils dictionaryToString:cfg];
-
- cfg = [UrlCrptyUtils encrypt:cfg];
- md[@"adJson"] = cfg;
- md[@"group"] = @(1);
- NSString *url = [NSString stringWithFormat:@"http://adsaccount.appcpi.net/adsaccount/www/gateway.php?act=205"];
- NSString *post = [NSString stringWithFormat:@"data=%@", [ZGJsonUtils dictionaryToString:md]];
- NSLog(@"%@&%@", url, post);
- NSData *data = [post dataUsingEncoding:NSUTF8StringEncoding];
- NSString *ret = [ZGWebUtils stringOfURLByPost:url postData:data];
- NSLog(@"%@", ret);
- } else {
- if ([DataUtils isRootPathConfiged]) {
- [self showProjectListWindow];
- } else {
- self.dropView.delegate = self;
- }
- }
- }
- - (void)applicationWillTerminate:(NSNotification *)aNotification {
- // Insert code here to tear down your application
- }
- #pragma mark window change
- - (void) showProjectListWindow {
- self.ProjectListWC = [[ProjectListWC alloc] initWithWindowNibName:@"ProjectListWC"];
- [self.ProjectListWC showWindow:self.window];
- [self.ProjectListWC.window makeMainWindow];
- [self.window close];
- }
- #pragma mark btn
- - (IBAction)onSaveBtn:(id)sender {
- [self showProjectListWindow];
- }
- #pragma mark dropview delegate
- - (void)dropImageView:(DropImageView *)dropImageView didSelectFile:(NSString *)filePath {
-
- }
- - (void)dropImageView:(DropImageView *)dropImageView didSelectDirectory:(NSString *)dirPath {
- }
- @end
|