集成微信公众号原创
金蝶云社区-云社区用户6QzL0379
云社区用户6QzL0379
4人赞赏了该文章 792次浏览 未经作者许可,禁止转载编辑于2023年01月30日 15:35:54

注册微信测试公众号

http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index

配置域名

image.png

image.png

获取测试号的token

https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=???&secret=???

调用接口创建公众号菜单

https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html

image.png

URL格式:

https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf0e81c3bee622d60&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect

其中STATE应替换为wxgzh_split_appID_split_appsecret这种格式的值,例如:
wxgzh_split_wxaa0e1232154586e4_split_25488d1231545165654f8b8c72fc0d
REDIRECT_URI为把需要跳转的URL进行urlencode编码后的字符串,可以百度urlencode在线编码工具进行编码。
苍穹移动端的url格式大致为:http://访问域名/ierp/mobile.html?formId=er_tripreqbill(注意这里微信规定不能用ip+端口的方式,注意这里不能用类似pc端首页的地址,不能在后面加#/dform?formId=单据编码)

image.png

配置苍穹租户管理中心


微信公众号的登录验证(免登)

编码:authtication.apps 值:kd.bos.login.thirdauth.app.tencent.WxgzhAuthtication

image.png

同步用户信息到苍穹(绑定关联关系,需要能访问外网否者获取不到微信的openID)

编码:login.after.handle.classes 值:kd.bos.login.thirdauth.app.tencent.WxgzhLoginAfter

image.png

这里可以使用企业微信同步用户,也可以直接在系统库中t_bas_immapping表插入数据,需要苍穹中用户的主键和微信中用户的openId,可以在苍穹的系统库使用sql

insert into t_bas_immapping (fid, FIMTYPEID, FOPENID) value (主键, 类型(暂时随便给值也可以), '微信公众号用户的openId');

update t_bas_immapping SET FUSERID = (select fid from t_sec_user where fphone = '用户手机号') where fid = '用户手机号';

如果没有同步用户,即t_bas_immapping表中查不到数据,则会跳转到苍穹登陆界面

 

 

可参考苍穹文档:

https://dev.kingdee.com/index/docsNew/d004ecf6-1b02-4376-bc3a-a835d8ba776e

 


赞 4