系统优化

This commit is contained in:
hoteas 2022-04-20 18:36:05 +08:00
parent a37a33321f
commit 1d3bfcaee5
10 changed files with 1701 additions and 13 deletions

0
.tgitconfig Normal file
View File

View File

@ -25,12 +25,13 @@ var h5Program *officialaccount.OfficialAccount
func InitApp(app Application) {
weixin = wechat.NewWechat()
memory := cache.NewMemory()
memoryMini := cache.NewMemory()
cfg := &config.Config{
AppID: app.Config.GetString("wechatMiniAppID"),
AppSecret: app.Config.GetString("wechatMiniAppSecret"),
//Token: "xxx",
//EncodingAESKey: "xxxx",
Cache: memory,
Cache: memoryMini,
}
h5cfg := &h5config.Config{
AppID: app.Config.GetString("wechatAppID"),

29
example/app/sms.go Normal file
View File

@ -0,0 +1,29 @@
package app
import (
. "code.hoteas.com/golang/hotime"
)
var Sms = Ctr{
//只允许微信验证过的或者登录成功的发送短信
//"send": func(this *Context) {
//
// if len(this.Req.FormValue("token")) != 32 {
// this.Display(2, "没有授权")
// return
// }
//
// phone := this.Req.FormValue("phone")
// if len(phone) < 11 {
// this.Display(3, "手机号格式错误")
// return
// }
// code := getCode()
// this.Session("phone", phone)
// this.Session("code", code)
//
// ddsms.DDY.SendYZM(phone, this.Config.GetString("smsLogin"), map[string]string{"code": code})
//
// this.Display(0, "发送成功")
//},
}

View File

@ -9,23 +9,24 @@ import (
var Wechat = Ctr{
"login": func(that *Context) {
retoken := that.Req.FormValue("retoken")
sessionKey := that.Req.FormValue("sessionkey")
encryptedData := that.Req.FormValue("encryptedData")
iv := that.Req.FormValue("iv")
if retoken == "" || encryptedData == "" || iv == "" {
if sessionKey == "" || encryptedData == "" || iv == "" {
that.Display(3, "参数不足")
return
}
eny := miniProgram.GetEncryptor()
re, e := eny.Decrypt(retoken, encryptedData, iv)
re, e := eny.Decrypt(sessionKey, encryptedData, iv)
if e != nil {
that.Display(4, e)
return
}
that.Display(0, re.PhoneNumber)
},
"code": func(that *Context) {
code := that.Req.FormValue("code")
@ -42,10 +43,10 @@ var Wechat = Ctr{
return
}
wchat := Map{"openid": re.OpenID,
"appid": a.AppID,
"state": 0,
"retoken": re.SessionKey,
"unionid": re.UnionID,
"appid": a.AppID,
"state": 0,
"sessionkey": re.SessionKey,
"unionid": re.UnionID,
}
//wchat["id"] = that.Db.Insert("wechat", wchat)

View File

@ -27,14 +27,14 @@
},
"imgPath": "img/2006/01/02/",
"mode": 2,
"port": "8081",
"port": "8082",
"sessionName": "HOTIME",
"smsKey": "b0eb4bf0198b9983cffcb85b69fdf4fa",
"smsLogin": "【政策通】您的验证码为:{code}请在5分钟内使用切勿将验证码泄露于他人如非本人操作请忽略。",
"tpt": "tpt",
"wechatAppID": "wx6126460a528a20e5",
"wechatAppSecret": "1dfdd8079414c795950d71bc92d0f1bd",
"wechatMiniAppID": "wx6126460a528a20e5",
"wechatMiniAppSecret": "1dfdd8079414c795950d71bc92d0f1bd",
"wechatAppID": "wxdcc8d6360661a179",
"wechatAppSecret": "4d793683ca915264663a9c9a33530c3c",
"wechatMiniAppID": "wx1c795e883b5b54c4",
"wechatMiniAppSecret": "d2bec12d1fa4d8b5714ccbed1c0671e4",
"wxFilePath": "wxfile/2006/01/02/"
}

32
example/tpt/code.html Normal file
View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>微信登录</title>
<script type="text/javascript" src="js/hotime.js"></script>
</head>
<body>
<script>
function run() {
var data={"code":H.getParam("code")}
if(data.code==null){
location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdcc8d6360661a179&redirect_uri='+location.href+'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'
return
}
H.post("app/wechat/codeh5", data, function (res) {
if (res.status != 0) {
// alert(res.result.type)
return
}
// H.upUrl("https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzkwNTI4NTcyNA==#wechat_redirect");
})
}
run()
</script>
</body>
</html>

1240
example/tpt/js/hotime.js Normal file

File diff suppressed because one or more lines are too long

360
example/tpt/js/test.js Normal file
View File

@ -0,0 +1,360 @@
var x = {
form: [
{
"name": "IEDCXXXS",
"label": "纳税总额(2021",
"type": "数字",
"unit": "万元"
},
{
"name": "IEDCXXXS",
"label": "利润总额(2021)",
"type": "数字",
"unit": "万元"
},
{
"name": "IEDCXXXS",
"label": "营业收入2021)",
"type": "数字",
"unit": "万元"
},
{
"name": "IEDCXXXS",
"label": "是否有获得过市级荣誉称号/获奖证书/扶持资金",
"type": "是/否",
"unit": "",
"fileNum": 1,
"fileRemarks": "市级荣誉称号/获奖证书/扶持资金证明材料",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "是否有获得过省级荣誉称号/获奖证书/扶持资金",
"type": "是/否",
"unit": "",
"fileNum": 1,
"fileRemarks": "省级荣誉称号/获奖证书/扶持资金证明材料",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "是否有获得过国家级荣誉称号/获奖证书/扶持资金",
"type": "是/否",
"unit": "",
"fileNum": 1,
"fileRemarks": "国家级荣誉称号/获奖证书/扶持资金证明材料",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "新增投资情况",
"type": "数字",
"unit": "万元",
"remarks": "请填写新增投资情况金额"
},
{
"name": "IEDCXXXS",
"label": "获得融资",
"type": "数字",
"unit": "万元",
"remarks": "请填写获得融资金额"
},
{
"name": "IEDCXXXS",
"label": "获得银行贷款",
"type": "数字",
"unit": "万元",
"remarks": "请填写获得银行贷款金额"
},
{
"name": "IEDCXXXS",
"label": "企业为本地区重点企业的重要配套企业",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业为省、市重点企业(含成渝双城圈和成都都市圈内企业)的重要配套企业",
"type": "是/否",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业是否符合本地区重点发展产业",
"type": "是/否",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业或主要产品进入世界500强、中国500强企业生产产品供应商体系",
"type": "是/否",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业被确定为市级100户重点企业、区县重点企业",
"type": "否/市级100户重点企业/区(市)县重点企业",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业被确定为产业链链主企业、省级重点企业、市级30户龙头企业含5户省返企业",
"type": "否/产业链链主/省级重点/市级30户龙头企业",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业拥有职业健康与安全管理体系",
"type": "是/否",
"remarks": "",
"fileNum": 1,
"fileRemarks": "企业拥有职业健康与安全管理体系证书"
},
{
"name": "IEDCXXXS",
"label": "企业拥有环境管理体系",
"type": "是/否",
"remarks": "",
"fileNum": 1,
"fileRemarks": "企业拥有环境管理体系证书"
},
{
"name": "IEDCXXXS",
"label": "企业拥有质量管理体系",
"type": "是/否",
"remarks": "",
"fileNum": 1,
"fileRemarks": "企业拥有质量管理体系证书"
},
{
"name": "IEDCXXXS",
"label": "企业发生安全事故",
"type": "数字",
"unit": "次",
"remarks": "请填写企业发生安全事故次数"
},
{
"name": "IEDCXXXS",
"label": "企业在安全检查、安全抽查中被发现风险隐患并受到处理",
"type": "数字",
"unit": "次",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业是否为能耗重点监测企业",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "使用环保节能环保进行生产经营活动",
"type": "是/否",
"unit": "",
"remarks": "请填写改造项目名称"
},
{
"name": "IEDCXXXS",
"label": "使用智能制造装备进行生产经营活动",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业在环保检查、环保抽查中被发现问题并受到处理",
"type": "数字",
"unit": "次",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业实施减排技术升级改造",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业绿色生产供应链取得成效,作为国家级、省级、市级(绿色工厂)经验推广",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "PCT国际专利",
"type": "数字",
"unit": "件",
"remarks": "",
"fileNum": 1,
"fileRemarks": "上传PCT国际专利图片最多上传10张"
},
{
"name": "IEDCXXXS",
"label": "实用新型专利",
"type": "数字",
"unit": "件",
"remarks": "",
"fileNum": 1,
"fileRemarks": "上传实用新型专利图片最多上传10张"
},
{
"name": "IEDCXXXS",
"label": "发明专利",
"type": "数字",
"unit": "件",
"remarks": "",
"fileNum": 1,
"fileRemarks": "上传发明专利图片最多上传10张"
},
{
"name": "IEDCXXXS",
"label": "企业产品进入重大技术装备首台(套)、新材料首批次、软件首版次推广应用",
"type": "否/首台(套)/首批次/首版次",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "重大技术装备首台(套)、新材料首批次、软件首版次推广应用证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业产品进入国家级、省级、市级推广目录",
"type": "否/国家级/省级/市级",
"unit": "",
"remarks": "推广目录名称"
},
{
"name": "IEDCXXXS",
"label": "企业品牌为国家级、省级、市级知名品牌的(含地理标志保护)",
"type": "否/国家级/省级/市级",
"unit": "",
"remarks": "品牌名称",
"fileNum": 1,
"fileRemarks": "知名品牌证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业获得国家级高新技术企业认定",
"type": "是/否",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "高新技术企业证书"
},
{
"name": "IEDCXXXS",
"label": "企业研究与试验发展R&D投入在1000万元以上或投入强度在3%以上",
"type": "是/否",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业主导投资的在蓉工业项目总投资达到500万元、1亿元、5亿元、10亿元、30亿元、50亿元的",
"type": "否/500万元/1亿元/5亿元/10亿元/30亿元/50亿元",
"unit": "",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "企业获得国家级、省级、市级企业技术中心、工程技术中心",
"type": "否/国家级/省级/市级",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "“企业技术中心”证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业获得国家级、省级、市级企业工程技术中心",
"type": "否/国家级/省级/市级",
"unit": "",
"remarks": "拥有多项可只选最高级",
"fileNum": 1,
"fileRemarks": "“工程技术中心”证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业是否获得国家级、省级、市级“独角兽”企业称号",
"type": "是/否",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "“独角兽”证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业是否获得国家级、省级、市级“瞪羚”企业称号",
"type": "是/否",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "“瞪羚”证明材料"
},
{
"name": "IEDCXXXS",
"label": "企业是否拥有专精特新称号",
"type": "是/否",
"unit": "",
"remarks": "包括国家级、省级、市级专精特新“小巨人”企业等称号"
},
{
"name": "IEDCXXXS",
"label": "营业收入增长率",
"type": "数字",
"unit": "%",
"remarks": ""
},
{
"name": "IEDCXXXS",
"label": "营业收入1亿元以上",
"type": "是/否",
"unit": "",
"remarks": "2021年"
},
{
"name": "IEDCXXXS",
"label": "企业主导或参与过国际、“一带一路”区域、国家级、行业、省级等行业标准制定",
"type": "否/主导国际/参与国际/主导“一带一路”/参与“一带一路”/主导国家级/参与国家级/主导省级/参与省级/主导行业/参与行业",
"unit": "",
"remarks": "",
"fileNum": 1,
"fileRemarks": "标准书署名页"
},
{
"name": "IEDCXXXS",
"label": "产品是否获得国家“单项冠军产品”称号",
"type": "是/否",
"unit": "",
"remarks": "称号名称"
},
{
"name": "IEDCXXXS",
"label": "企业是否连续3年亏损",
"type": "是/否",
"unit": "",
"remarks": "即2019年、2020年、2021年三年均亏损利润为负"
},
{
"name": "IEDCXXXS",
"label": "企业利润率",
"type": "数字",
"unit": "%",
"remarks": "企业利润率=2021年利润总额/2021年营业收入"
},
{
"name": "IEDCXXXS",
"label": "企业是否连续3年盈利",
"type": "是/否",
"unit": "",
"remarks": "即2019年、2020年、2021年三年均盈利利润为正"
}
]
}

25
example/tpt/wx.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>测试</title>
<script type="text/javascript" src="js/hotime.js"></script>
</head>
<body>
<script>
function run() {
var data={"code":H.getParam("code")}
if(data.code==null){
location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdcc8d6360661a179&redirect_uri='+location.href+'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'
return
}
H.post("app/wechat/code", data, function (res) {
H.upUrl("/wx/");
})
}
run()
</script>
</body>
</html>

BIN
example/zct_wechat.exe Normal file

Binary file not shown.