代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
<script src="static/js/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<meta charset="utf-8">
<title></title>
<style>
*{margin: 0;padding: 0;}
.mid{
margin: 0 auto;
}
.main1{
border-radius: 3px;
margin-top: 20px;
width: 96%;
height: 100%;
-moz-box-shadow: 5px 5px 5px #888888; /* 老的 Firefox */
box-shadow: 5px 5px 5px #888888;
background-color: #e2e2e2;
}
.main2{
width: 100%;
height: 80px;
line-height: 80px;
}
.main3{
width: 100%;
}
.main4{
width: 100%;
height: 50px;
line-height: 50px;
}
.left{
float: left;
width: 100px;
height: 49px;
border: 1px solid #d0d0d0;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
margin-left: 10px;
text-align: center;
line-height: 50px;
}
.right{
float: left;
width: 100px;
height: 49px;
border: 1px solid #d0d0d0;
border-left: none;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
text-align: center;
line-height: 50px;
}
.mainp1{
font-size: 40px;
margin: 10px 10px;
}
.mainp2{
font-size: 30px;
margin: 10px 10px;
color: #545454;
}
.all{
width: 100%;
height: 100%;
margin-top: 30px;
}
.mr{
float: right;
}
tr{
height: 40px;
}
td th{
font-size: 20px;
}
.left:hover{
background-color: #d0d0d0;
}
.right:hover{
background-color: #d0d0d0;
cursor: pointer;
}
a{
cursor: pointer;
}
</style>
</head>
<body>
<div class="main1 mid" id="admin2">
<div class="main2">
<span class="mainp1">用户管理</span><span class="mainp2">全部用户</span>
</div>
<div class="main3">
<div class="main4">
<input type="search" style="height: 30px;width: 250px;float: right;border: none;outline: none;margin-right: 30px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;" placeholder="搜索用户名" v-model="userHao">
<button style="background-color: #3B9970;border: none;outline:none;width: 60px;color: white;float: right;height: 30px;line-height: 30px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;" @click="serh()">搜索</button>
</div>
<table class="table table-hover all">
<tr>
<!-- <th style="width: 10%;text-align: center;line-height: 40px;">密码</th> -->
<th style="width: 20%;text-align: center;line-height: 40px;">账号</th>
<th style="width: 20%;text-align: center;line-height: 40px;">昵称</th>
<th style="width: 20%;text-align: center;line-height: 40px;">邮箱</th>
<th style="width: 20%;text-align: center;line-height: 40px;">级别</th>
<th style="width: 20%;text-align: center;line-height: 40px;">修改信息</th>
</tr>
<template v-for="user,index in users">
<tr>
<td style="width: 20%;text-align: center;line-height: 40px;">{{user.userHao}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;">{{user.userName}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;">{{user.email}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;" v-if="user.userProtecd == 1">普通用户</td>
<td style="width: 20%;text-align: center;line-height: 40px;" v-else>禁用用户</td>
<td style="width: 20%;text-align: center;line-height: 40px;"><a :href="sherf+user.userId" style="display: inline-block;background-color: #3B9970;border: none;outline:none;width: 60px;color: white;text-decoration: none;">修改</a></td>
</tr>
</template>
<!-- <tr>
<td style="width: 10%;text-align: center;line-height: 40px;">123456789</td>
<td style="width: 20%;text-align: center;line-height: 40px;">hehonghui</td>
<td style="width: 30%;text-align: center;line-height: 40px;">123456789</td>
<td style="width: 30%;text-align: center;line-height: 40px;">2501140176@qq.com</td>
<td style="width: 20%;text-align: center;line-height: 40px;"><a href="page3.html" style="display: inline-block;background-color: #3B9970;border: none;outline:none;width: 60px;color: white;text-decoration: none;">修改</a></td>
</tr>
<tr>
<td style="width: 10%;text-align: center;line-height: 40px;">123456789</td>
<td style="width: 20%;text-align: center;line-height: 40px;">liuxiangyun</td>
<td style="width: 30%;text-align: center;line-height: 40px;">123456789</td>
<td style="width: 30%;text-align: center;line-height: 40px;">2501140176@qq.com</td>
<td style="width: 20%;text-align: center;line-height: 40px;"><a href="page3.html" style="display: inline-block;background-color: #3B9970;border: none;outline:none;width: 60px;color: white;text-decoration: none;">修改</a></td>
</tr> -->
</table>
</div>
</div>
<div style="width: 100%;height: 100px;"></div>
</body>
<script type="text/javascript" src="static/js/vue.js"></script>
<script type="text/javascript" src="static/js/axios.min.js"></script>
<script type="text/javascript" src="static/js/base.js"></script>
<script type="text/javascript" src="static/js/cookie_utils.js"></script>
<script type="text/javascript">
var burl=Baseurl+"/prouser/findall";
var hurl=Baseurl+"/prouser/finduser";
var vm=new Vue({
el:"#admin2",
data:{
users:[],
userHao:"",
sherf:"page3.html?userId="
},
created() {
var token=getCookieValue("token");
axios({
method:"get",
url:burl,
headers:{
//设置请求头
token:token
}
}).then((res)=>{
var vo=res.data;
if(vo.code==10001){
vm.users=vo.data;
}else{
if(vo.code==20002){
setTimeout(function(){
window.location.href="adminload.html";
},50)
}else{
alert("暂时还没有用户!");
}
}
});
},
methods:{
serh:function(){
var token=getCookieValue("token");
axios({
method:"get",
url:hurl+"/"+vm.userHao,
headers:{
//设置请求头
token:token
}
}).then((res)=>{
var vo=res.data;
if(vo.code==10001){
vm.users=[];
vm.users=vo.data;
console.log(vo.data);
}else{
alert(vo.msg);
}
})
}
}
})
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。