Exemple #1
0
<?php

/**
 * Created by PhpStorm.
 * User: 337962552@qq.com
 * Date: 2016/1/21
 * Time: 11:45
 */
header("content-type:text/html;charset=utf8");
include_once 'config.php';
include_once 'sky.class.php';
$re = new SkyHandle(WB_AKEY, WB_SKEY, $_COOKIE['token']);
if (empty($_COOKIE['token'])) {
    echo "<script>alert('access_token的值不能为空');location.href='http://www.sky.com/index.php';</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>接口调用列表</title>
    <style>
        h2 {color:blue;}
        h3 {color:red;}
        ul {color:blue;}
        .file {color:blue; align-content: center;text-align: center}
    </style>
</head>
<body>
Exemple #2
0
<?php

/**
 * Created by PhpStorm.
 * User: 337962552@qq.com
 * Date: 2016/1/22
 * Time: 11:21
 */
header("content-type:text/html;charset=utf8");
include_once 'config.php';
include_once 'sky.class.php';
$re = new SkyHandle(WB_AKEY, WB_SKEY, $_COOKIE['token']);
//获取文件ID
$id = $_REQUEST['fileId'];
if ($_REQUEST['act'] == "upload_url") {
    //获取文件下载地址
    if (!empty($id) && isset($id)) {
        echo $re->getFileDownloadUrl($_COOKIE['token'], $id);
    }
} elseif ($_REQUEST['act'] == "delete_file") {
    //删除文件
    if (!empty($id) && isset($id)) {
        echo $re->deleteFile($_COOKIE['token'], $id);
    }
}