/*dd.config({ //实现验证
	agentId: _config.agentId,
	corpId: _config.corpId,
	timeStamp: _config.timeStamp,
	nonceStr: _config.nonceStr,
	signature: _config.signature,
	jsApiList: [
		'runtime.info',
		'biz.contact.choose',
		'device.notification.confirm',
		'device.notification.alert',
		'device.notification.prompt',
		'biz.ding.post',
		'biz.util.openLink'
	]
});*/

dd.ready(function() { //验证成功  
	dd.runtime.permission.requestAuthCode({ //获取code码值  
		corpId: 'ding72f963ff8536545c35c2f4657eb6378f',
		onSuccess: function(info) {
			vdn.async = false;
			//页面信息初始化
			vdn.get({
					"method": "nvo_ding.accesstoken_json",
					"params": info.code
				}, function(data) {
					$(location).prop('href', data.Result.redirect);
				},
				function(err) {
					mui.toast(err.Message + "(" + err.Code.toString() + ")");
				}
			);
		},
		onFail: function(err) {
			alert('fail: ' + JSON.stringify(err));
		}
	});

});

dd.error(function(err) { //验证失败  
	alert('验证出错: ' + JSON.stringify(err));
});

