官方文档
https://open.dingtalk.com/document/orgapp-client/logon-free-process
实验过程
demo我这样写的:
打开链接后,拿到了code:
code能转换为对应的用户:
html代码
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script src="https://g.alicdn.com/dingding/dingtalk-jsapi/2.13.42/dingtalk.open.js"></script>
<script type="text/javascript" >
//alert(dd);
dd.ready(function() {
//alert(dd.version);
dd.runtime.permission.requestAuthCode({
corpId: "dingf0d4d7ea88f6eea64ac5d6980864d335",
onSuccess : function(res) {
location.href="https://www.baidu.com/s?ie=UTF-8&wd="+res.code
// 调用成功时回调
console.log(res)
},
onFail : function(err) {
// 调用失败时回调
console.log(err)
}
});
});
</script>
</head>
<body>
</body>
</html>