135 lines
4.2 KiB
HTML
135 lines
4.2 KiB
HTML
{extend name="public/base" /}
|
||
{block name="body"}
|
||
<style>
|
||
.clinhei{width:100%;height:25px;}
|
||
.inp{width:200px;}
|
||
.inpdiv{width:25%;float:left;}
|
||
.inpdivbut{width:10%;float:left;}
|
||
.so{width:80px;height:30px;border:0;margin-top:25px;text-align:center;line-height:30px;cursor: pointer;}
|
||
.tdinp{width:100%;border:0;}
|
||
.up{border:0;cursor: pointer;}
|
||
</style>
|
||
<div class="alert alert-danger alert-dismissable" id="alertmgs" style="display:none;position:fixed;top:10;">
|
||
<button type="button" class="close" data-dismiss="alert"
|
||
aria-hidden="true">
|
||
×
|
||
</button>
|
||
<p>错误!请进行一些更改。</p>
|
||
</div>
|
||
<div class="alert alert-success alert-dismissable" id="alertyes" style="display:none;position:fixed;top:10;">
|
||
<button type="button" class="close" data-dismiss="alert"
|
||
aria-hidden="true">
|
||
×
|
||
</button>
|
||
成功!
|
||
</div>
|
||
<div class="main-box clearfix">
|
||
<header class="main-box-header clearfix">
|
||
<div class="pull-left">
|
||
<h2>回传配置</h2>
|
||
</div>
|
||
|
||
</header>
|
||
<div class="main-box-body clearfix">
|
||
<div class="clinhei"></div>
|
||
<div class="container">
|
||
<table class="table table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th>ID</th>
|
||
<th>用户名称</th>
|
||
<th>阅读币</th>
|
||
<th>VIP</th>
|
||
<th>是否在线</th>
|
||
<th>正在看书籍</th>
|
||
<th>正在看章节</th>
|
||
<th>时间</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody id="tables">
|
||
|
||
<tr data-id="">
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
</table>
|
||
<!-- 分页 -->
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<input type="hidden" id="userip">
|
||
{/block}
|
||
{block name="script"}
|
||
<script type="text/javascript" src="https://index.bowenzw.com/public/js/jquery.js"></script>
|
||
<script>
|
||
getJavaIp()
|
||
setTimeout(function(){
|
||
var ip = localStorage.getItem("userip");
|
||
alert(ip)
|
||
}, 800);
|
||
/* 封装ajax函数
|
||
* @param {string}opt.type http连接的方式,包括POST和GET两种方式
|
||
* @param {string}opt.url 发送请求的url
|
||
* @param {boolean}opt.async 是否为异步请求,true为异步的,false为同步的
|
||
* @param {object}opt.data 发送的参数,格式为对象类型
|
||
* @param {function}opt.success ajax发送并接收成功调用的回调函数
|
||
*/
|
||
function ajax(opt) {
|
||
opt = opt || {};
|
||
opt.method = opt.method.toUpperCase() || 'POST';
|
||
opt.url = opt.url || '';
|
||
opt.async = opt.async || true;
|
||
opt.data = opt.data || null;
|
||
opt.success = opt.success || function () {};
|
||
var xmlHttp = null;
|
||
if (XMLHttpRequest) {
|
||
xmlHttp = new XMLHttpRequest();
|
||
}
|
||
else {
|
||
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
|
||
}var params = [];
|
||
for (var key in opt.data){
|
||
params.push(key + '=' + opt.data[key]);
|
||
}
|
||
var postData = params.join('&');
|
||
if (opt.method.toUpperCase() === 'POST') {
|
||
xmlHttp.open(opt.method, opt.url, opt.async);
|
||
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
|
||
xmlHttp.send(postData);
|
||
}
|
||
else if (opt.method.toUpperCase() === 'GET') {
|
||
xmlHttp.open(opt.method, opt.url + '?' + postData, opt.async);
|
||
xmlHttp.send(null);
|
||
}
|
||
xmlHttp.onreadystatechange = function () {
|
||
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
|
||
opt.success(xmlHttp.responseText);//如果不是json数据可以去掉json转换
|
||
}
|
||
};
|
||
}
|
||
|
||
function getJavaIp(){
|
||
ajax({
|
||
method: 'GET',
|
||
url: 'http://bowenzw.com:8080/getip',
|
||
success: function (ip) {
|
||
localStorage.setItem("userip", ip);
|
||
}
|
||
})
|
||
}
|
||
|
||
|
||
</script>
|
||
{/block}
|