请上传宽度大于 1200px,高度大于 164px 的封面图片
    调整图片尺寸与位置
    滚轮可以放大缩小图片尺寸,按住图片拖动可调整位置,多余的会自动被裁剪掉
取消
mingqi(uid:236184)
职业资格认证:尚未取得认证
非微信服务号集成下获取自有公众号用户OpenID
效果: 实现步骤: 1、外链表单开启微信增强; 2、将获取的用户简道云微信OpenID拼到授权页Url参数内; 3、弹窗按钮设置在新页面打开授权页(如果以弹窗形式会导致iframe内部的授权与外部的授权产生冲突); 4、授权页获取Url参数即简道云的微信OpenID,打开页面的同时静默授权,获取自有公众号下的用户OpenID; 5、使用简道云API将两个字段数据写入辅助表单,完成后跳转回外链表单。 6、外链表单使用简道云OpenID关联获取辅助表单内的自有微信OpenID,填充回外链表单字段,设置显隐条件,如果OpenID不为空则隐藏授权按钮,并显示后续字段。   授权页: :)本废物用ivx做的,方便又省钱........
腾讯云健康码、行程卡OCR 接口封装 利用前端事件解决防疫资料信息收集
准备:1、购买腾讯云服务器(腾讯云轻量服务器 centOS),这里我选择的是已经部署了宝塔面板的。2、在文字识别控制台开通对应服务。3、在API Explorer查看健康码OCR API的示例 以下为腾讯云给到的 健康码 Python SDK import json from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.ocr.v20181119 import ocr_client, models try: cred = credential.Credential("SecretId", "SecretKey") httpProfile = HttpProfile() httpProfile.endpoint = "ocr.tencentcloudapi.com" clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile client = ocr_client.OcrClient(cred, "", clientProfile) req = models.RecognizeTravelCardOCRRequest() params = { } req.from_json_string(json.dumps(params)) resp = client.RecognizeTravelCardOCR(req) print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) 给到的代码不需要做太多更改,直接贴出改好后的(实际项目中用到了海外护照的OCR接口,海外护照的传入只能用base64,所以此处传入图片也用的是base64的 别问,问就是懒.....)。 import json import base64 import requests from flask import Flask from flask import request from flask import render_template from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException from tencentcloud.ocr.v20181119 import ocr_client, models app = Flask(__name__) cred = credential.Credential(" ", " ") httpProfile = HttpProfile() httpProfile.endpoint = "ocr.tencentcloudapi.com" clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile client = ocr_client.OcrClient(cred, " ", clientProfile) @app.route('/RecognizeTravelCardOCR', methods=) def RecognizeTravelCardOCR(): try: r = requests.get(json.loads(request.get_data(as_text=True))) base64_str = base64.b64encode(r.content).decode() req = models.RecognizeTravelCardOCRRequest() params = { "ImageBase64": base64_str } req.from_json_string(json.dumps(params)) resp = client.RecognizeTravelCardOCR(req) print(resp.to_json_string()) return resp.to_json_string() except TencentCloudSDKException as err: print(err) return None @app.route('/RecognizeHealthCodeOCR', methods=) def RecognizeHealthCodeOCR(): try: r = requests.get(json.loads(request.get_data(as_text=True))) base64_str = base64.b64encode(r.content).decode() req = models.RecognizeHealthCodeOCRRequest() params = { "ImageBase64": base64_str } req.from_json_string(json.dumps(params)) resp = client.RecognizeHealthCodeOCR(req) print(resp.to_json_string()) return resp.to_json_string() except TencentCloudSDKException as err: print(err) return None @app.route('/QrcodeOCR', methods=) def QrcodeOCR(): try: r = requests.get(json.loads(request.get_data(as_text=True))) base64_str = base64.b64encode(r.content).decode() req = models.QrcodeOCRRequest() params = { "ImageBase64": base64_str } req.from_json_string(json.dumps(params)) resp = client.QrcodeOCR(req) print(resp.to_json_string()) return resp.to_json_string() except TencentCloudSDKException as err: print(err) return None if __name__ == '__main__': app.run(debug=True, host="0.0.0.0", port=3400) 登录宝塔面板,将接口文档上传到服务器,在软件商店搜索“Python项目管理”安装,点击“添加项目”配置好文件路径、Python版本、端口号及配置开机启动。 启动项目如有报错,可以在日志文档查看报错内容。 实际项目中外部提交的都是粤康码,粤康码的二维码识别后可以返回部分脱敏的明文字段,为了防止有人更改截图信息,利用二维码识别的API,将健康码OCR返回的信息与健康码二维码识别的内容进行对比,可以在一定程度上防止提交伪造的健康码 配置到简道云表单后提交的效果:
个人成就
内容被浏览10,141
加入社区5年202天
返回顶部