我这里采用前端获取免登录授权码,发给后端计算得到登录后的钉钉信息。
index.html
dd.ready(function() {
dd.runtime.permission.requestAuthCode({
corpId: "你的corpid",
onSuccess: function(info) {
code = info.code
//引入axios,ajax获取登录后的内容
axios.get('login.php?code='+code)
.then(function (response) {
//自行处理response
}).catch(function (error) {
alert('something wrong')
});
},onFail