备份提交
This commit is contained in:
parent
b7b796a31b
commit
04ef81a8f2
@ -21,8 +21,8 @@ class UrlsController extends ControllerBase{
|
|||||||
$url = "http://127.0.0.1/tiffany/api/urls/shorturl?qaz=wsx";
|
$url = "http://127.0.0.1/tiffany/api/urls/shorturl?qaz=wsx";
|
||||||
$post_arr = array();
|
$post_arr = array();
|
||||||
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
|
$post_arr['appid'] = "0e355010-67b9-4aa6-a53f-c92c972094a7";
|
||||||
$post_arr['access_token'] = "ycq9t62einm7usfah1vk4z38djxp5gwl";
|
|
||||||
$post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c";
|
$post_arr['access_token'] = "9d21508a7531430c843cff8063dccb1c";
|
||||||
|
$post_arr['access_token'] = "ycq9t62einm7usfah1vk4z38djxp5gwl";
|
||||||
$post_arr['url'] = "https://www.baidu.com/";
|
$post_arr['url'] = "https://www.baidu.com/";
|
||||||
$post_json = json_encode($post_arr);
|
$post_json = json_encode($post_arr);
|
||||||
$result = $this->__http_post_request($url, $post_json, true);
|
$result = $this->__http_post_request($url, $post_json, true);
|
||||||
@ -199,6 +199,18 @@ class UrlsController extends ControllerBase{
|
|||||||
//如果以上判断都通过
|
//如果以上判断都通过
|
||||||
if(empty($rs['errcode'])){
|
if(empty($rs['errcode'])){
|
||||||
//{"errmsg":"ok","errcode":0,"data":{"shorturl":"weu.me/FUhGg"}}
|
//{"errmsg":"ok","errcode":0,"data":{"shorturl":"weu.me/FUhGg"}}
|
||||||
|
//设置转换长链接
|
||||||
|
$post_arr['urls'] = json_encode(array($request_arr['url']));
|
||||||
|
//设置转换TokenID
|
||||||
|
$post_arr['TokenID'] = "TH3UOn1Z4p7aJFS5q8eE6Kmt9xWQsocw";
|
||||||
|
//开发阶段转为使用测试TokenID
|
||||||
|
$post_arr['TokenID'] = "DAdlkwahhODpoiQPKwndkwaMDsdIN59P";
|
||||||
|
//准备转换短链接
|
||||||
|
$url = "https://weapp.wemediacn.com/we/surl/api/get";
|
||||||
|
//获取转换结果
|
||||||
|
$array = json_decode($this->__http_post_request($url, $post_arr), true);
|
||||||
|
echo "<pre>";
|
||||||
|
print_r($array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user