先到www.weixin139.com开通接口权限
新建一个url.html代码如下
访问地址:url.html?user=yourname(此处为你的用户名)
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>loading</title> <script type=text/javascript src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $(function () { get_share(); }); function get_share(){ var user = getQueryString(‘user‘); var url = getQueryString(‘url‘); $.ajax({ type: "get", async: false, url: ‘http://api.weixin139.com/jumpurl/index/get_url.html‘, data:{user:user,url:url}, dataType: "jsonp", jsonp: "callback", jsonpCallback:"checkHandler", success: function(data){ window.location.href=data.url; }, }); } function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } </script> </body> </html>
html文件放置任意可在WEB端访问的文件夹下即可