|
|
|
@ -11,12 +11,24 @@
|
|
|
|
|
<script src="/js/jquery.min.js"></script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var _config = <?php echo $auth_config; ?>;
|
|
|
|
|
var ding;
|
|
|
|
|
function echo(){
|
|
|
|
|
ding.runtime.permission.requestAuthCode({
|
|
|
|
|
corpId: _config.corpId, //企业ID
|
|
|
|
|
onSuccess: function (info) {
|
|
|
|
|
console.log('auth success ');
|
|
|
|
|
window.location.href = "/info.php/apps/dingding_auth/index/authOnSuccess/" +_config.agentId+'/'+_config.accessToken+'/'+ info.code;
|
|
|
|
|
},
|
|
|
|
|
onFail: function (err) {
|
|
|
|
|
console.log(JSON.stringify(err));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var DingTalk = DingTalk || {};
|
|
|
|
|
(function (dt) {
|
|
|
|
|
var self = dt;
|
|
|
|
|
var ding;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dt.init = function () {
|
|
|
|
|
dt.isMobileClient = self.util.isMobileClient();
|
|
|
|
@ -42,19 +54,7 @@
|
|
|
|
|
|
|
|
|
|
ding.userid = 0;
|
|
|
|
|
|
|
|
|
|
ding.ready(function (res) {
|
|
|
|
|
ding.runtime.permission.requestAuthCode({
|
|
|
|
|
corpId: _config.corpId, //企业ID
|
|
|
|
|
onSuccess: function (info) {
|
|
|
|
|
console.log('auth success ');
|
|
|
|
|
window.location.href = "/info.php/apps/dingding_auth/index/authOnSuccess/" +_config.agentId+'/'+_config.accessToken+'/'+ info.code;
|
|
|
|
|
},
|
|
|
|
|
onFail: function (err) {
|
|
|
|
|
console.log(JSON.stringify(err));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
ding.ready(echo());
|
|
|
|
|
|
|
|
|
|
ding.error(function (error) {
|
|
|
|
|
console.log('dd error: ' + JSON.stringify(error));
|
|
|
|
|