代码拉取完成,页面将自动刷新
同步操作将从 ThinkPHP/oschina-apicloud-app 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>开源中国</title>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript" src="./script/zepto.min.js"></script>
<script type="text/javascript" src="./script/config.js"></script>
<script type="text/javascript" src="./script/common.js"></script>
<style>
html {
height: 100%;
background-color: #FFFFFF;
}
body {
background-color: #fff;
padding: 0;
margin: 0;
display: -webkit-box;
display: -webkit-flex;
display: flex;
height: 100%;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
flex-flow: column;
}
</style>
</head>
<body>
<script>
var client_id, client_secret, redirect_uri;
apiready = function () {
if($api.getStorage('access_token')) {
api.openSlidLayout({
type: 'left',
leftEdge: api.winWidth / 3,
fixedPane: {
name: 'home_fixed',
url: './html/home_fixed.html'
},
slidPane: {
name: 'home_slide',
url: './html/home_slide.html'
}
}, function (ret) {
});
}else{
api.openFrame({
name: 'login',
url: './html/frm_login.html',
rect:{
x:0,
y:0,
w:'auto',
h:'auto'
},
bounces: false,
opaque: false,
vScrollBarEnabled:false,
hScrollBarEnabled:false
});
}
}
// 刷新 access_token
function refreshToken(){
log(client_id+' '+client_secret+' '+$api.getStorage('refresh_token'));
api.ajax({
url: OpenAPI.access_token,
method: 'post',
timeout: 30,
dataType: 'json',
data:{
values: {
client_id: client_id,
client_secret: client_secret,
grant_type: 'refresh_token',
redirect_uri: redirect_uri,
refresh_token:$api.getStorage('refresh_token'),
dataType:OpenAPI.dataType,
callback:'json',
},
},
returnAll:false,
},function(ret,err){
if (ret) {
$api.setStorage('access_token',ret.access_token);
$api.setStorage('refresh_token',ret.refresh_token);
$api.setStorage('token_type',ret.token_type);
$api.setStorage('expires_in',ret.expires_in);
$api.setStorage('uid',ret.uid);
log('刷新 access_token成功');
}else {
log('错误码:'+err.code+';错误信息:'+err.msg+'网络状态码:'+err.statusCode);
/*
$api.rmStorage('access_token');
$api.rmStorage('refresh_token');
$api.rmStorage('token_type');
$api.rmStorage('expires_in');
$api.rmStorage('uid');
*/
};
});
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。