Example #1
0
function xt_ajax_api()
{
    $result = array('code' => 0, 'msg' => '', 'result' => array());
    $appKey = $_REQUEST['app_key'];
    $method = $_REQUEST['method'];
    $timestamp = $_REQUEST['timestamp'];
    $sign = $_REQUEST['sign'];
    if (empty($appKey)) {
        $result['code'] = 500;
        $result['msg'] = '未指定appKey';
        exit(json_encode($result));
    }
    if (empty($method)) {
        $result['code'] = 501;
        $result['msg'] = '未指定method';
        exit(json_encode($result));
    }
    if (!in_array($method, array('addCustomPage', 'getSysPages', 'getPageHeaderAndFooter', 'updatePageHeaderAndFooter', 'getPageHeaders', 'addPageHeader', 'updatePageHeader', 'getPageFooters', 'addPageFooter', 'updatePageFooter', 'getPageHeader', 'getPageFooter', 'getCustomPages', 'getCustomPage', 'getOption', 'updateOption', 'addOption', 'getCoreOptions', 'getPageOptions', 'updateThemes', 'updatePages', 'updateApp', 'updateBase', 'updateHelps', 'clearHelps', 'updateAutoCatalog', 'autoShare', 'refresh', 'importUser', 'refreshXTUser', 'getUserName'))) {
        $result['code'] = 502;
        $result['msg'] = '指定的method不存在';
        exit(json_encode($result));
    }
    if (empty($timestamp)) {
        $result['code'] = 503;
        $result['msg'] = '未指定时间参数';
        exit(json_encode($result));
    }
    $app = xt_get_app_xt();
    if (empty($app) || empty($app['appKey']) || empty($app['appSecret'])) {
        $result['code'] = 504;
        $result['msg'] = '尚未配置新淘网AppKey,AppSecret';
        exit(json_encode($result));
    }
    if ($app['appKey'] != $appKey) {
        $result['code'] = 505;
        $result['msg'] = 'AppKey不一致';
        exit(json_encode($result));
    }
    $api = new XTClient($app['appKey'], $app['appSecret']);
    $_sign = $api->generateSign($_REQUEST);
    if ($sign != $_sign) {
        $result['code'] = 506;
        $result['msg'] = '验证出错,请确认AppKey,AppSecret配置正确';
        exit(json_encode($result));
    }
    $result['result'] = $api->execute($method, $_REQUEST);
    exit(json_encode($result));
}
Example #2
0
                d = parseInt(maxtime / 3600 / 24);
                h = parseInt((maxtime / 3600) % 24);
                m = parseInt((maxtime / 60) % 60);
                s = parseInt(maxtime % 60);
                msg = d + "天" + h + "小时" + m + "分" + s + "秒";
                fn(msg);
                --maxtime;
            } else {
                clearInterval(timer);
                fn("已失效!");
            }
        }, 1000);
    }
</script>
<?php 
$app_xt = xt_get_app_xt();
$app_taobao = xt_get_app_taobao();
$app_paipai = xt_get_app_paipai();
$app_yiqifa = xt_get_app_yiqifa();
$app_weibo = xt_get_app_weibo();
$app_qq = xt_get_app_qq();
$_loginurl = $_loginurl = xt_platform_authorize_url('[PLATFORM]', 'authoritySuccess', 'admin');
?>
<div id="dashboard-widgets-wrap">
    <?php 
if (IS_CLOUD) {
    if (strpos(home_url(), 'sinaapp.com') !== false) {
        ?>
            <div class="updated" style="color:red;font-weight: bold;font-size:15px;padding:10px 5px;">
                建议绑定自己的独立域名后,再到以下平台用独立域名申请APP,<a href="http://plugin.xintaonet.com/help/?id=126#X_Help-4" target="_blank">新浪SAE域名绑定</a>