<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="eFrameWork.DingTalk.Login" %>
<!DOCTYPE html>
<html>
<head>
    <title><%= EKETEAM.FrameWork.eConfig.systemName() %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
</head>
<script src="http://g.alicdn.com/ilw/ding/0.7.5/scripts/dingtalk.js"></script>
<body>
<%if( Request.QueryString["code"]==null){ %>
<script>
    dd.ready(function () {
        dd.runtime.permission.requestAuthCode({
            corpId: "<%=eBase.DingTalkAccount.getValue("CorpId")%>",
            onSuccess: function (result) {
                var code = result.code;
                //将code 发往后台处理
                document.location.assign("?code=" + code + "&fromurl=<%=redirect_uri.HtmlEncode()%>");
            },
            onFail: function (err) {
                //alert(JSON.stringify(err));
            }
        });
    });
</script>
<%} %>
</body>
</html>