diff --git a/app/user.go b/app/user.go index 8bcde80..907c2fc 100644 --- a/app/user.go +++ b/app/user.go @@ -3,7 +3,6 @@ package app import ( . "code.hoteas.com/golang/hotime" . "code.hoteas.com/golang/hotime/common" - "code.hoteas.com/golang/hotime/dri/download" "code.hoteas.com/golang/hotime/dri/tencent" "encoding/base64" "fmt" @@ -216,15 +215,15 @@ var User = Ctr{ } } else { data["create_time"] = t - if wechat != nil { - data["nickname"] = wechat.GetString("nickname") - path := time.Now().Format(this.Config.GetString("imgPath")) - filename := Md5(ObjToStr(t)) + ".jpg" - down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename) - if down { - data["avatar"] = path + filename - } - } + //if wechat != nil { + // data["nickname"] = wechat.GetString("nickname") + // path := time.Now().Format(this.Config.GetString("imgPath")) + // filename := Md5(ObjToStr(t)) + ".jpg" + // down := download.Down(wechat.GetString("avatar"), this.Config.GetString("tpt")+"/"+path, filename) + // if down { + // data["avatar"] = path + filename + // } + //} user = data user["id"] = this.Db.Insert("user", data) if user.GetCeilInt("id") == 0 { diff --git a/app/wechat.go b/app/wechat.go index 7c9991b..82bbb13 100644 --- a/app/wechat.go +++ b/app/wechat.go @@ -101,24 +101,24 @@ var Wechat = Ctr{ return } //getUserInfo - userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) - if err != nil { - this.Display(6, "微信个人信息无法获取") - return - } + //userInfo, err := auth.GetUserInfo(resToken.AccessToken, resToken.OpenID) + //if err != nil { + // this.Display(6, "微信个人信息无法获取") + // return + //} - fmt.Println(userInfo) + //fmt.Println(userInfo) //wechatInfo := ObjToMap(userInfo) t := time.Now().Unix() wechatInfo := Map{ - "openid": userInfo.OpenID, + "openid": resToken.OpenID, "acttoken": resToken.AccessToken, "retoken": resToken.RefreshToken, "appid": this.Config.GetString("wechatAppID"), - "unionid": userInfo.Unionid, - "nickname": userInfo.Nickname, - "avatar": userInfo.HeadImgURL, + "unionid": resToken.UnionID, + //"nickname": userInfo.Nickname, + //"avatar": userInfo.HeadImgURL, } if orgId != 0 { wechatInfo["org_id"] = orgId diff --git a/config/adminDB.json b/config/adminDB.json index f76b8a8..e0b6686 100644 --- a/config/adminDB.json +++ b/config/adminDB.json @@ -149,7 +149,7 @@ "show" ], "icon": "Setting", - "label": "行业分类", + "label": "企业调整", "menus": [ { "auth": [ @@ -160,8 +160,8 @@ "info", "download" ], - "label": "行业分类", - "table": "category" + "label": "企业调整", + "table": "company_tune" }, { "auth": [ @@ -172,11 +172,23 @@ "info", "download" ], - "label": "行业分析", - "table": "category_analyse" + "label": "历史信息", + "table": "company_history" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "企业管理", + "table": "company" } ], - "name": "sys:category" + "name": "sys:company" }, { "auth": [ @@ -212,142 +224,6 @@ ], "name": "sys:org" }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "系统管理", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "微信信息", - "table": "wechat" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "人员管理", - "table": "admin" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "城市管理", - "table": "city" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "企业用户", - "table": "user" - }, - { - "auth": [ - "show", - "download" - ], - "label": "日志管理", - "table": "logs" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "角色管理", - "table": "role" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "地区管理", - "table": "area" - } - ], - "name": "sys" - }, - { - "auth": [ - "show" - ], - "icon": "Setting", - "label": "历史信息", - "menus": [ - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "历史信息", - "table": "company_history" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "企业调整", - "table": "company_tune" - }, - { - "auth": [ - "show", - "add", - "delete", - "edit", - "info", - "download" - ], - "label": "企业管理", - "table": "company" - } - ], - "name": "sys:company" - }, { "auth": [ "show" @@ -382,6 +258,130 @@ ], "name": "sys:question" }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "系统管理", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "地区管理", + "table": "area" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "角色管理", + "table": "role" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "企业用户", + "table": "user" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "微信信息", + "table": "wechat" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "城市管理", + "table": "city" + }, + { + "auth": [ + "show", + "download" + ], + "label": "日志管理", + "table": "logs" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "人员管理", + "table": "admin" + } + ], + "name": "sys" + }, + { + "auth": [ + "show" + ], + "icon": "Setting", + "label": "行业分析", + "menus": [ + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "行业分析", + "table": "category_analyse" + }, + { + "auth": [ + "show", + "add", + "delete", + "edit", + "info", + "download" + ], + "label": "行业分类", + "table": "category" + } + ], + "name": "sys:category" + }, { "auth": [ "show" @@ -564,6 +564,10 @@ "name": "无", "value": null }, + { + "name": "手机号", + "value": "phone" + }, { "name": "ID", "value": "id" @@ -572,10 +576,6 @@ "name": "名称", "value": "name" }, - { - "name": "手机号", - "value": "phone" - }, { "name": "职位", "value": "title" @@ -895,14 +895,14 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, { "name": "行业代码", "value": "code" }, + { + "name": "ID", + "value": "id" + }, { "name": "名称", "value": "name" @@ -1072,10 +1072,6 @@ "name": "无", "value": null }, - { - "name": "名称", - "value": "name" - }, { "name": "ID", "value": "id" @@ -1083,6 +1079,10 @@ { "name": "分析结果", "value": "data" + }, + { + "name": "名称", + "value": "name" } ], "type": "search", @@ -1143,16 +1143,16 @@ "value": null }, { - "label": "组织", - "link": "org", - "name": "org_id", + "label": "行业", + "link": "category", + "name": "category_id", "type": "tree", "value": "name" }, { - "label": "行业", - "link": "category", - "name": "category_id", + "label": "组织", + "link": "org", + "name": "org_id", "type": "tree", "value": "name" }, @@ -1594,52 +1594,36 @@ "value": null }, { - "name": "id", - "value": "id" - }, - { - "name": "综合能耗", - "value": "zhnh" - }, - { - "name": "研发经费", - "value": "yfjf" - }, - { - "name": "企业画像", - "value": "analyse" - }, - { - "name": "企业名称", - "value": "name" + "name": "采集数据", + "value": "collect_data" }, { "name": "属地名称", "value": "unit" }, { - "name": "利润总额", - "value": "lrze" + "name": "应缴税金", + "value": "yjsj" }, { - "name": "主要污染物排放当量", - "value": "zywrwpfdl" + "name": "id", + "value": "id" }, { "name": "统一社会信用代码", "value": "sn" }, + { + "name": "企业地址", + "value": "address" + }, { "name": "营业收入", "value": "yysr" }, { - "name": "采集数据", - "value": "collect_data" - }, - { - "name": "应缴税金", - "value": "yjsj" + "name": "利润总额", + "value": "lrze" }, { "name": "职工人数", @@ -1650,12 +1634,28 @@ "value": "upload_data" }, { - "name": "企业地址", - "value": "address" + "name": "综合能耗", + "value": "zhnh" + }, + { + "name": "企业名称", + "value": "name" }, { "name": "占地面积", "value": "zdmj" + }, + { + "name": "企业画像", + "value": "analyse" + }, + { + "name": "研发经费", + "value": "yfjf" + }, + { + "name": "主要污染物排放当量", + "value": "zywrwpfdl" } ], "type": "search", @@ -1692,15 +1692,15 @@ "value": null }, { - "label": "状态", - "name": "state", + "label": "认证状态", + "name": "status", "options": [ { - "name": "已启用", + "name": "未认证", "value": "0" }, { - "name": "未启用", + "name": "已认证", "value": "1" }, { @@ -1715,27 +1715,6 @@ "type": "select", "value": null }, - { - "label": "企业规模", - "name": "gs", - "options": [ - { - "name": "规下", - "value": "0" - }, - { - "name": "规上", - "value": "1" - }, - { - "name": "全部", - "value": null - } - ], - "sortable": true, - "type": "select", - "value": null - }, { "add": false, "edit": false, @@ -1769,15 +1748,36 @@ "value": null }, { - "label": "认证状态", - "name": "status", + "label": "企业规模", + "name": "gs", "options": [ { - "name": "未认证", + "name": "规下", "value": "0" }, { - "name": "已认证", + "name": "规上", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", "value": "1" }, { @@ -2068,64 +2068,64 @@ "value": null }, { - "name": "主要污染物排放当量", - "value": "zywrwpfdl" - }, - { - "name": "上传数据", - "value": "upload_data" - }, - { - "name": "企业地址", - "value": "address" - }, - { - "name": "占地面积", - "value": "zdmj" - }, - { - "name": "研发经费", - "value": "yfjf" - }, - { - "name": "利润总额", - "value": "lrze" - }, - { - "name": "企业名称", - "value": "name" - }, - { - "name": "统一社会信用代码", - "value": "sn" + "name": "企业画像", + "value": "analyse" }, { "name": "综合能耗", "value": "zhnh" }, { - "name": "id", - "value": "id" + "name": "利润总额", + "value": "lrze" }, { - "name": "营业收入", - "value": "yysr" - }, - { - "name": "属地名称", - "value": "unit" + "name": "占地面积", + "value": "zdmj" }, { "name": "职工人数", "value": "zgrs" }, { - "name": "应缴税金", - "value": "yjsj" + "name": "id", + "value": "id" }, { - "name": "企业画像", - "value": "analyse" + "name": "上传数据", + "value": "upload_data" + }, + { + "name": "主要污染物排放当量", + "value": "zywrwpfdl" + }, + { + "name": "企业地址", + "value": "address" + }, + { + "name": "属地名称", + "value": "unit" + }, + { + "name": "统一社会信用代码", + "value": "sn" + }, + { + "name": "营业收入", + "value": "yysr" + }, + { + "name": "研发经费", + "value": "yfjf" + }, + { + "name": "企业名称", + "value": "name" + }, + { + "name": "应缴税金", + "value": "yjsj" }, { "name": "采集数据", @@ -2186,30 +2186,6 @@ "type": "select", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "add": false, "edit": false, @@ -2242,6 +2218,37 @@ "type": "select", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "行业类型", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + }, { "label": "城市", "link": "city", @@ -2255,13 +2262,6 @@ "name": "org_id", "type": "tree", "value": "name" - }, - { - "label": "行业类型", - "link": "category", - "name": "category_id", - "type": "tree", - "value": "name" } ], "table": "company_history" @@ -2375,21 +2375,21 @@ "name": "无", "value": null }, - { - "name": "调整级别", - "value": "level" - }, { "name": "调整理由", "value": "content" }, - { - "name": "ID", - "value": "id" - }, { "name": "名称", "value": "name" + }, + { + "name": "调整级别", + "value": "level" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -2701,14 +2701,14 @@ "name": "无", "value": null }, - { - "name": "名称", - "value": "name" - }, { "name": "ID", "value": "id" }, + { + "name": "名称", + "value": "name" + }, { "name": "分析结果", "value": "data" @@ -2894,10 +2894,6 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, { "name": "IP地址", "value": "ip" @@ -2905,6 +2901,10 @@ { "name": "其他内容", "value": "name" + }, + { + "name": "ID", + "value": "id" } ], "type": "search", @@ -3099,14 +3099,14 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, { "name": "组织名称", "value": "name" }, + { + "name": "ID", + "value": "id" + }, { "name": "联系方式", "value": "contact" @@ -3275,6 +3275,10 @@ "name": "无", "value": null }, + { + "name": "“N”项特色", + "value": "n_item_data" + }, { "name": "“6”项量化", "value": "six_item_data" @@ -3283,14 +3287,6 @@ "name": "“3”项定性", "value": "three_item_data" }, - { - "name": "“N”项特色", - "value": "n_item_data" - }, - { - "name": "首页分析", - "value": "home_data" - }, { "name": "ID", "value": "id" @@ -3298,6 +3294,10 @@ { "name": "分析名称", "value": "name" + }, + { + "name": "首页分析", + "value": "home_data" } ], "type": "search", @@ -3458,6 +3458,10 @@ "name": "无", "value": null }, + { + "name": "ID", + "value": "id" + }, { "name": "名称", "value": "name" @@ -3465,10 +3469,6 @@ { "name": "内容", "value": "question_data" - }, - { - "name": "ID", - "value": "id" } ], "type": "search", @@ -3670,14 +3670,14 @@ "name": "无", "value": null }, - { - "name": "名称", - "value": "name" - }, { "name": "ID", "value": "id" }, + { + "name": "名称", + "value": "name" + }, { "name": "填报内容", "value": "question_data" @@ -4076,28 +4076,28 @@ "value": null }, { - "name": "指标标志", - "value": "sn" - }, - { - "name": "ID", - "value": "id" + "name": "指标名", + "value": "name" }, { "name": "单位", "value": "unit" }, { - "name": "指标描述", - "value": "description" + "name": "ID", + "value": "id" + }, + { + "name": "指标标志", + "value": "sn" }, { "name": "运行命令", "value": "cmd" }, { - "name": "指标名", - "value": "name" + "name": "指标描述", + "value": "description" } ], "type": "search", @@ -4133,30 +4133,6 @@ "type": "search", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "已启用", - "value": "0" - }, - { - "name": "未启用", - "value": "1" - }, - { - "name": "异常", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "类型", "name": "type", @@ -4191,11 +4167,28 @@ "value": null }, { - "label": "组织名称", - "link": "org", - "name": "org_id", - "type": "tree", - "value": "name" + "label": "状态", + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null }, { "label": "指标分类", @@ -4203,6 +4196,13 @@ "name": "tag_ctg_id", "type": "tree", "value": "name" + }, + { + "label": "组织名称", + "link": "org", + "name": "org_id", + "type": "tree", + "value": "name" } ], "table": "tag" @@ -4385,16 +4385,16 @@ "value": null }, { - "label": "组织", - "link": "org", - "name": "org_id", + "label": "上级分类", + "link": "tag_ctg", + "name": "parent_id", "type": "tree", "value": "name" }, { - "label": "上级分类", - "link": "tag_ctg", - "name": "parent_id", + "label": "组织", + "link": "org", + "name": "org_id", "type": "tree", "value": "name" } @@ -4556,29 +4556,29 @@ "name": "无", "value": null }, - { - "name": "ID", - "value": "id" - }, - { - "name": "手机号码", - "value": "phone" - }, { "name": "用户姓名", "value": "name" }, - { - "name": "邮箱", - "value": "email" - }, { "name": "身份证号码", "value": "idcard" }, + { + "name": "邮箱", + "value": "email" + }, { "name": "昵称", "value": "nickname" + }, + { + "name": "ID", + "value": "id" + }, + { + "name": "手机号码", + "value": "phone" } ], "type": "search", @@ -4614,30 +4614,6 @@ "type": "search", "value": null }, - { - "label": "状态", - "name": "state", - "options": [ - { - "name": "正常", - "value": "0" - }, - { - "name": "异常", - "value": "1" - }, - { - "name": "隐藏", - "value": "2" - }, - { - "name": "全部", - "value": null - } - ], - "type": "select", - "value": null - }, { "label": "认证状态", "name": "status", @@ -4662,6 +4638,30 @@ "type": "select", "value": null }, + { + "label": "状态", + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "隐藏", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, { "label": "组织", "link": "org", @@ -4807,28 +4807,28 @@ "value": "appid" }, { - "name": "昵称", - "value": "nickname" - }, - { - "name": "access_token", - "value": "acttoken" + "name": "微信组id", + "value": "unionid" }, { "name": "openid", "value": "openid" }, { - "name": "微信组id", - "value": "unionid" + "name": "昵称", + "value": "nickname" + }, + { + "name": "refresh_token", + "value": "retoken" }, { "name": "ID", "value": "id" }, { - "name": "refresh_token", - "value": "retoken" + "name": "access_token", + "value": "acttoken" } ], "type": "search", diff --git a/iedc_go.exe b/iedc_go.exe index ec20765..11b9e04 100644 Binary files a/iedc_go.exe and b/iedc_go.exe differ