From e838f3a03d53bc3f91061c8747f1bd677963f640 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期二, 09 七月 2019 17:15:06 +0800
Subject: [PATCH] fix url bug

---
 areaApi.go |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/areaApi.go b/areaApi.go
index 7ace60d..4bfae03 100644
--- a/areaApi.go
+++ b/areaApi.go
@@ -11,7 +11,7 @@
 //parentId 瑕佹煡瀵荤殑鐩綍鏍戠殑鏍硅妭鐐筰d
 //searchType(0:鍏ㄩ儴锛�1:鍒嗘瀽鎽勫儚鏈�,2:鐩戞帶鎽勫儚鏈�)
 //cameraName锛堟憚鍍忔満鍚嶇О锛�
-func (api AreaApi) GetLocalCameraTree(parentId string, searchType string, cameraName string) []TreeMenu {
+func (api AreaApi) GetLocalCameraTree(parentId string, searchType string, cameraName string,treeType string) []TreeMenu {
 	var result []TreeMenu
 
 	client := NewClient()
@@ -24,18 +24,17 @@
 
 	respBody, err := client.DoGetRequest(url, params, nil)
 	if err != nil {
-		return result
+		return nil
 	}
 
 	var res Result
 	if err = json.Unmarshal(respBody, &res); err != nil {
-		fmt.Println(err)
+		return nil
 	}
 
 	bytes, _ := json.Marshal(res.Data)
-	err = json.Unmarshal(bytes, &result)
-	if err != nil {
-		fmt.Println(err)
+	if err = json.Unmarshal(bytes, &result);err !=nil{
+		return nil
 	}
 	return result
 }
@@ -51,7 +50,6 @@
 	}
 	var res Result
 	if err = json.Unmarshal(respBody, &res); err != nil {
-		fmt.Println(err)
 		return flag
 	}
 	flag = res.Success
@@ -78,9 +76,9 @@
 }
 
 //鍒犻櫎鐩綍
-func (api AreaApi) AreaDelete(id int) bool {
+func (api AreaApi) AreaDelete(id string) bool {
 	flag := false
-	if id == 0 {
+	if id == "" {
 		return flag
 	}
 	url := BASIC_URL + DATA_URL_PREFIX + "/area/del"
@@ -93,7 +91,6 @@
 	}
 	var res Result
 	if err = json.Unmarshal(respBody, &res); err != nil {
-		fmt.Println(err)
 		return flag
 	}
 	flag = res.Success

--
Gitblit v1.8.0