提交 8ab976c9 编写于 作者: 7 7wc98#14

Update

上级 ed9898ce
......@@ -19,6 +19,10 @@
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
......
//IntelliJ IDEA
//campus
//WebSocketConfig
//2020/6/15
// Author:御承扬
//E-mail:2923616405@qq.com
package com.pyc.campus.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/endpointPublicChat").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/publicChat");
}
}
//IntelliJ IDEA
//campus
//DataController
//2020/5/4
// Author:御承扬
//E-mail:2923616405@qq.com
package com.pyc.campus.controller;
import com.pyc.campus.dao.StudentRepository;
import com.pyc.campus.domain.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Controller
public class DataController {
@Autowired
StudentRepository studentRepository;
@RequestMapping("q1")
public Student q1(String name,String studentID){
return studentRepository.findByNameAndStudentID(name,studentID);
}
// @RequestMapping("/loginUp")
// public String loginUp(@Param("studentID")String studentID,
// @Param("password")String password){
// Student student = studentRepository.findPasswordByStudentID(studentID);
// String temp = student.getPassword();
// if(password.equals(temp)){
// return "page/Home.html";
// }
// return "page/Login.html";
// }
}
......@@ -159,7 +159,7 @@ public class WebController {
return "page/SignError";
}
Msg msg = new Msg("注册结果","恭喜"+studentID+",你成功注册,请使用刚刚注册的学号和密码进行登录","额外信息");
Student s = new Student(username, studentID, password, weChat, qq);
Student s = new Student(username, studentID, password, weChat, qq,0);
studentRepository.save(s);
int rs = (int) sysUserRepository.count();
SysUser user = new SysUser();
......@@ -406,4 +406,37 @@ public class WebController {
model.addAttribute("questions", questions);
return "page/BrowserQuestion";
}
@RequestMapping("/manageUser")
public String findUserExceptCurUser(Model model,HttpSession session){
SecurityContextImpl securityContext = (SecurityContextImpl)session.getAttribute("SPRING_SECURITY_CONTEXT");
String currentStudentId = ((UserDetails) securityContext.getAuthentication().getPrincipal()).getUsername();
Student s = studentRepository.findNameByStudentID(currentStudentId);
model.addAttribute("curUse",s);
List<Student> students = studentRepository.findAll();
model.addAttribute("students", students);
return "page/ManageUser";
}
@RequestMapping("/findUserByStudentIDLike")
public String findUserByStudentIDLike(Model model, HttpSession session,
@RequestParam(value = "ClassPrefix", required = false)String classPrefix){
SecurityContextImpl securityContext = (SecurityContextImpl)session.getAttribute("SPRING_SECURITY_CONTEXT");
String currentStudentId = ((UserDetails) securityContext.getAuthentication().getPrincipal()).getUsername();
Student s = studentRepository.findNameByStudentID(currentStudentId);
model.addAttribute("curUse",s);
List<Student> students = studentRepository.query01(classPrefix+'%');
model.addAttribute("students", students);
return "page/ManageUser";
}
@RequestMapping("/delStuByStuId")
public String delStuByStuId(Model model,HttpSession session,@RequestParam(value = "studentId", required = false)String stuId){
SecurityContextImpl securityContext = (SecurityContextImpl)session.getAttribute("SPRING_SECURITY_CONTEXT");
String currentStudentId = ((UserDetails) securityContext.getAuthentication().getPrincipal()).getUsername();
Student s = studentRepository.findNameByStudentID(currentStudentId);
model.addAttribute("curUse",s);
studentRepository.delByStudentID(stuId);
sysUserRepository.delByUsername(stuId);
List<Student> students = studentRepository.findAll();
model.addAttribute("students", students);
return "page/ManageUser";
}
}
......@@ -13,8 +13,9 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface StudentRepository extends JpaRepository<Student,Long> {
Student findByNameAndStudentID(String name,String studentID);
Student findPasswordByStudentID(String studentID);
Student findNameByStudentID(String studentID);
@Modifying
......@@ -25,4 +26,13 @@ public interface StudentRepository extends JpaRepository<Student,Long> {
@Transactional
@Query("update Student s set s.password=?1 where s.studentID=?2")
int saveChangePWD(String password, String studentID);
// 根据Student ID前缀查询
@Modifying
@Transactional
@Query("select s from Student s where s.studentID like ?1")
List<Student> query01(String classPrefix);
@Modifying
@Transactional
@Query("delete from Student where studentID=?1")
void delByStudentID(String studentId);
}
......@@ -19,4 +19,8 @@ public interface SysUserRepository extends JpaRepository<SysUser,Long> {
@Transactional
@Query("update SysUser s set s.password=?1 where s.username=?2")
int updatePassword(String password, String username);
@Modifying
@Transactional
@Query("delete from SysUser where username=?1")
void delByUsername(String username);
}
//IntelliJ IDEA
//campus
//PublishMessage
//2020/6/15
// Author:御承扬
//E-mail:2923616405@qq.com
package com.pyc.campus.domain;
public class PublishMessage {
}
......@@ -21,17 +21,28 @@ public class Student {
private String password;
private String weChat;
private String QQ;
private int admin;
public Student() {
super();
}
public Student(String name,String studentID, String password,String weChat,String QQ)
{
public Student(String name, String studentID, String password, String weChat, String QQ, int admin) {
super();
this.name=name;
this.studentID=studentID;
this.name = name;
this.studentID = studentID;
this.password = password;
this.weChat = weChat;
this.QQ = QQ;
this.admin = admin;
}
public void setAdmin(int admin) {
this.admin = admin;
}
public int getAdmin() {
return admin;
}
public void setId(Long id) {
......
此差异已折叠。
此差异已折叠。
// Generated by CoffeeScript 1.7.1
/*
Stomp Over WebSocket http://www.jmesnil.net/stomp-websocket/doc/ | Apache License V2.0
Copyright (C) 2010-2013 [Jeff Mesnil](http://jmesnil.net/)
Copyright (C) 2012 [FuseSource, Inc.](http://fusesource.com)
*/
(function(){var t,e,n,i,r={}.hasOwnProperty,o=[].slice;t={LF:"\n",NULL:"\x00"};n=function(){var e;function n(t,e,n){this.command=t;this.headers=e!=null?e:{};this.body=n!=null?n:""}n.prototype.toString=function(){var e,i,o,s,u;e=[this.command];o=this.headers["content-length"]===false?true:false;if(o){delete this.headers["content-length"]}u=this.headers;for(i in u){if(!r.call(u,i))continue;s=u[i];e.push(""+i+":"+s)}if(this.body&&!o){e.push("content-length:"+n.sizeOfUTF8(this.body))}e.push(t.LF+this.body);return e.join(t.LF)};n.sizeOfUTF8=function(t){if(t){return encodeURI(t).match(/%..|./g).length}else{return 0}};e=function(e){var i,r,o,s,u,a,c,f,h,l,p,d,g,b,m,v,y;s=e.search(RegExp(""+t.LF+t.LF));u=e.substring(0,s).split(t.LF);o=u.shift();a={};d=function(t){return t.replace(/^\s+|\s+$/g,"")};v=u.reverse();for(g=0,m=v.length;g<m;g++){l=v[g];f=l.indexOf(":");a[d(l.substring(0,f))]=d(l.substring(f+1))}i="";p=s+2;if(a["content-length"]){h=parseInt(a["content-length"]);i=(""+e).substring(p,p+h)}else{r=null;for(c=b=p,y=e.length;p<=y?b<y:b>y;c=p<=y?++b:--b){r=e.charAt(c);if(r===t.NULL){break}i+=r}}return new n(o,a,i)};n.unmarshall=function(n){var i;return function(){var r,o,s,u;s=n.split(RegExp(""+t.NULL+t.LF+"*"));u=[];for(r=0,o=s.length;r<o;r++){i=s[r];if((i!=null?i.length:void 0)>0){u.push(e(i))}}return u}()};n.marshall=function(e,i,r){var o;o=new n(e,i,r);return o.toString()+t.NULL};return n}();e=function(){var e;function r(t){this.ws=t;this.ws.binaryType="arraybuffer";this.counter=0;this.connected=false;this.heartbeat={outgoing:1e4,incoming:1e4};this.maxWebSocketFrameSize=16*1024;this.subscriptions={}}r.prototype.debug=function(t){var e;return typeof window!=="undefined"&&window!==null?(e=window.console)!=null?e.log(t):void 0:void 0};e=function(){if(Date.now){return Date.now()}else{return(new Date).valueOf}};r.prototype._transmit=function(t,e,i){var r;r=n.marshall(t,e,i);if(typeof this.debug==="function"){this.debug(">>> "+r)}while(true){if(r.length>this.maxWebSocketFrameSize){this.ws.send(r.substring(0,this.maxWebSocketFrameSize));r=r.substring(this.maxWebSocketFrameSize);if(typeof this.debug==="function"){this.debug("remaining = "+r.length)}}else{return this.ws.send(r)}}};r.prototype._setupHeartbeat=function(n){var r,o,s,u,a,c;if((a=n.version)!==i.VERSIONS.V1_1&&a!==i.VERSIONS.V1_2){return}c=function(){var t,e,i,r;i=n["heart-beat"].split(",");r=[];for(t=0,e=i.length;t<e;t++){u=i[t];r.push(parseInt(u))}return r}(),o=c[0],r=c[1];if(!(this.heartbeat.outgoing===0||r===0)){s=Math.max(this.heartbeat.outgoing,r);if(typeof this.debug==="function"){this.debug("send PING every "+s+"ms")}this.pinger=i.setInterval(s,function(e){return function(){e.ws.send(t.LF);return typeof e.debug==="function"?e.debug(">>> PING"):void 0}}(this))}if(!(this.heartbeat.incoming===0||o===0)){s=Math.max(this.heartbeat.incoming,o);if(typeof this.debug==="function"){this.debug("check PONG every "+s+"ms")}return this.ponger=i.setInterval(s,function(t){return function(){var n;n=e()-t.serverActivity;if(n>s*2){if(typeof t.debug==="function"){t.debug("did not receive server activity for the last "+n+"ms")}return t.ws.close()}}}(this))}};r.prototype._parseConnect=function(){var t,e,n,i;t=1<=arguments.length?o.call(arguments,0):[];i={};switch(t.length){case 2:i=t[0],e=t[1];break;case 3:if(t[1]instanceof Function){i=t[0],e=t[1],n=t[2]}else{i.login=t[0],i.passcode=t[1],e=t[2]}break;case 4:i.login=t[0],i.passcode=t[1],e=t[2],n=t[3];break;default:i.login=t[0],i.passcode=t[1],e=t[2],n=t[3],i.host=t[4]}return[i,e,n]};r.prototype.connect=function(){var r,s,u,a;r=1<=arguments.length?o.call(arguments,0):[];a=this._parseConnect.apply(this,r);u=a[0],this.connectCallback=a[1],s=a[2];if(typeof this.debug==="function"){this.debug("Opening Web Socket...")}this.ws.onmessage=function(i){return function(r){var o,u,a,c,f,h,l,p,d,g,b,m;c=typeof ArrayBuffer!=="undefined"&&r.data instanceof ArrayBuffer?(o=new Uint8Array(r.data),typeof i.debug==="function"?i.debug("--- got data length: "+o.length):void 0,function(){var t,e,n;n=[];for(t=0,e=o.length;t<e;t++){u=o[t];n.push(String.fromCharCode(u))}return n}().join("")):r.data;i.serverActivity=e();if(c===t.LF){if(typeof i.debug==="function"){i.debug("<<< PONG")}return}if(typeof i.debug==="function"){i.debug("<<< "+c)}b=n.unmarshall(c);m=[];for(d=0,g=b.length;d<g;d++){f=b[d];switch(f.command){case"CONNECTED":if(typeof i.debug==="function"){i.debug("connected to server "+f.headers.server)}i.connected=true;i._setupHeartbeat(f.headers);m.push(typeof i.connectCallback==="function"?i.connectCallback(f):void 0);break;case"MESSAGE":p=f.headers.subscription;l=i.subscriptions[p]||i.onreceive;if(l){a=i;h=f.headers["message-id"];f.ack=function(t){if(t==null){t={}}return a.ack(h,p,t)};f.nack=function(t){if(t==null){t={}}return a.nack(h,p,t)};m.push(l(f))}else{m.push(typeof i.debug==="function"?i.debug("Unhandled received MESSAGE: "+f):void 0)}break;case"RECEIPT":m.push(typeof i.onreceipt==="function"?i.onreceipt(f):void 0);break;case"ERROR":m.push(typeof s==="function"?s(f):void 0);break;default:m.push(typeof i.debug==="function"?i.debug("Unhandled frame: "+f):void 0)}}return m}}(this);this.ws.onclose=function(t){return function(){var e;e="Whoops! Lost connection to "+t.ws.url;if(typeof t.debug==="function"){t.debug(e)}t._cleanUp();return typeof s==="function"?s(e):void 0}}(this);return this.ws.onopen=function(t){return function(){if(typeof t.debug==="function"){t.debug("Web Socket Opened...")}u["accept-version"]=i.VERSIONS.supportedVersions();u["heart-beat"]=[t.heartbeat.outgoing,t.heartbeat.incoming].join(",");return t._transmit("CONNECT",u)}}(this)};r.prototype.disconnect=function(t,e){if(e==null){e={}}this._transmit("DISCONNECT",e);this.ws.onclose=null;this.ws.close();this._cleanUp();return typeof t==="function"?t():void 0};r.prototype._cleanUp=function(){this.connected=false;if(this.pinger){i.clearInterval(this.pinger)}if(this.ponger){return i.clearInterval(this.ponger)}};r.prototype.send=function(t,e,n){if(e==null){e={}}if(n==null){n=""}e.destination=t;return this._transmit("SEND",e,n)};r.prototype.subscribe=function(t,e,n){var i;if(n==null){n={}}if(!n.id){n.id="sub-"+this.counter++}n.destination=t;this.subscriptions[n.id]=e;this._transmit("SUBSCRIBE",n);i=this;return{id:n.id,unsubscribe:function(){return i.unsubscribe(n.id)}}};r.prototype.unsubscribe=function(t){delete this.subscriptions[t];return this._transmit("UNSUBSCRIBE",{id:t})};r.prototype.begin=function(t){var e,n;n=t||"tx-"+this.counter++;this._transmit("BEGIN",{transaction:n});e=this;return{id:n,commit:function(){return e.commit(n)},abort:function(){return e.abort(n)}}};r.prototype.commit=function(t){return this._transmit("COMMIT",{transaction:t})};r.prototype.abort=function(t){return this._transmit("ABORT",{transaction:t})};r.prototype.ack=function(t,e,n){if(n==null){n={}}n["message-id"]=t;n.subscription=e;return this._transmit("ACK",n)};r.prototype.nack=function(t,e,n){if(n==null){n={}}n["message-id"]=t;n.subscription=e;return this._transmit("NACK",n)};return r}();i={VERSIONS:{V1_0:"1.0",V1_1:"1.1",V1_2:"1.2",supportedVersions:function(){return"1.1,1.0"}},client:function(t,n){var r,o;if(n==null){n=["v10.stomp","v11.stomp"]}r=i.WebSocketClass||WebSocket;o=new r(t,n);return new e(o)},over:function(t){return new e(t)},Frame:n};if(typeof exports!=="undefined"&&exports!==null){exports.Stomp=i}if(typeof window!=="undefined"&&window!==null){i.setInterval=function(t,e){return window.setInterval(e,t)};i.clearInterval=function(t){return window.clearInterval(t)};window.Stomp=i}else if(!exports){self.Stomp=i}}).call(this);
\ No newline at end of file
......@@ -97,6 +97,9 @@
<div class="item-box list-group-item">
<a href="/toPublishQuestion">发布悬赏问题</a>
</div>
<div class="item-box list-group-item">
<a href="/manageUser">用户管理</a>
</div>
</div>
</div>
</div>
......
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
lang="en">
<head>
<meta charset="UTF-8">
<title>用户管理</title>
<link rel="stylesheet" type="text/css" href="../../static/css/oppo.css">
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- 可选的 Bootstrap 主题文件(一般不用引入) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<style>
body {
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color: #000;
margin: 0;
padding: 0;
background: #eee url("../../static/images/campus/logo.jpg") center no-repeat fixed;
}
.main{
margin: 10px auto;
width: 800px;
height: 700px;
}
.questions-list{
margin: 10px auto;
width: 800px;
height: auto;
}
</style>
</head>
<body>
<!--页面顶部-->
<div id="top">
<div class="container"></div>
</div>
<!-- 页面的头部 -->
<div id="header">
<div class="container">
<div class="header_left left">
<div class="xlwb"></div>
<div class="txwb"></div>
<div class="tel">150-1436-6986</div>
</div>
<ul class="right">
<li>
<form th:action="@{/logout}" method="post">
<input type="submit" class="btn btn-link" th:value="安全退出">
</form>
</li>
</ul>
</div>
</div>
<!-- 页面的导航 -->
<div id="nav">
<div class="container">
<div class="logo left">
<h1>Campus</h1>
</div>
<ul class="right">
<li><a href="/home">Home</a></li>
<li><a href="/learn">学习资源</a></li>
<li><a href="/news">校内新闻</a></li>
<li sec:authorize="hasRole('ROLE_USER')"><a href="/userCenter" style="color: red" th:text="${curUse.getName()}"></a>
</li>
<li sec:authorize="hasRole('ROLE_ADMIN')"><a href="/admin">网站管理</a></li>
<li sec:authorize="hasRole('ROLE_ADMIN')"><a href="/userCenter" style="color: red" th:text="${curUse.getName()}"></a>
</li>
</ul>
</div>
</div>
<div class="main">
<h1>用户管理</h1>
<form class="form-inline" name="form" method="post" th:action="@{/findUserByStudentIDLike}">
<div class="form-group">
<label for="ClassPrefix" class="sr-only">按学号中的班级前缀:</label>
<div class="input-group">
<input type="text" name="ClassPrefix" id="ClassPrefix" placeholder="10班级前缀">
</div>
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
<div class="table-box">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>姓名</th>
<th>学号</th>
<th>QQ</th>
<th>微信</th>
<th>是否管理员</th>
</tr>
</thead>
<tbody th:if="${not #lists.isEmpty(students)}">
<tr th:each="student:${students}">
<td th:text="${student.name}"></td>
<td th:text="${student.studentID}"></td>
<td th:text="${student.QQ}"></td>
<td th:text="${student.weChat}"></td>
<td th:text="${student.admin}"></td>
</tr>
</tbody>
</table>
</div>
<form class="form-inline" name="form2" method="post" th:action="@{/delStuByStuId}">
<div class="form-group">
<label for="studentId">学号</label>
<input type="text" class="form-control" id="studentId" name="studentId" placeholder="student id">
</div>
<button type="submit" class="btn btn-danger">删除</button>
</form>
</div>
<div id="serve">
<div class="container">
<ul>
<li>
<dl>
<dt></dt>
<dd class="dd1">正规网站</dd>
<dd class="dd2">所有的服务都是合法的</dd>
</dl>
</li>
<li>
<dl>
<dt></dt>
<dd class="dd1">正规网站</dd>
<dd class="dd2">所有的服务都是合法的</dd>
</dl>
</li>
<li>
<dl>
<dt></dt>
<dd class="dd1">正规网站</dd>
<dd class="dd2">所有的服务都是合法的</dd>
</dl>
</li>
<li>
<dl>
<dt></dt>
<dd class="dd1">正规网站</dd>
<dd class="dd2">所有的服务都是合法的</dd>
</dl>
</li>
<li>
<dl>
<dt></dt>
<dd class="dd1">正规网站</dd>
<dd class="dd2">所有的服务都是合法的</dd>
</dl>
</li>
</ul>
</div>
</div>
<div id="after_sale">
<div class="container">
<ul>
<li>
<ol>
<li><a href="#">联系方式</a></li>
<li><a href="#">15014366986</a></li>
<li><a href="#">2923616405</a></li>
<li><a href="#">pyc852164</a></li>
</ol>
</li>
<li>
<ol>
<li><a href="#">关于我</a></li>
<li><a href="https://blog.csdn.net/qq_42896653">CSDN</a></li>
<li><a href="https://github.com/pyc-ycy">Github</a></li>
<li><a href="https://gitee.com/pengyoucongcode">Gitee</a></li>
</ol>
</li>
<li>
<ol>
<li>关于我</li>
<li>我的博客文章,</li>
<li>我的代码托管平台,</li>
<li>也是代码托管平台,</li>
</ol>
</li>
<li>
<ol>
<li>关于我</li>
<li>可以了解我的所学</li>
<li>可以看到我的开源代码</li>
<li>为避免Github访问不了</li>
</ol>
</li>
</ul>
</div>
</div>
<div id="footer">
<div class="container">
<p style="color: white;text-align: center;">
@2020 御承扬Copyright&copy;2020-05-04
</p>
</div>
</div>
<a id="btn" href="javascript:;" style='position:fixed;right: 0px; bottom: 25%;font-size: 24px;'>
<img src="../../static/images/toTop1.png" alt="pic">
</a>
<script type="text/javascript" src="../../static/js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../../static/js/oppo.js"></script>
<script>
window.onload = function () {
let tp = document.getElementById("btn");
tp.style.display = "none";
let timer = null;
tp.onclick = function () {
timer = setInterval(function () {
let backTop = document.documentElement.scrollTop || document.body.scrollTop;
// 越滚月慢
let speedTop = backTop / 5;
document.documentElement.scrollTop -= backTop - speedTop;
if (backTop === 0) {
clearInterval(timer);
}
}, 30);
}
let pageHeight = 700;
let nav = document.getElementById("nav");
let navTop = nav.offsetTop;
window.onscroll = function () {
let backTop = document.documentElement.scrollTop || document.body.scrollTop;
if (backTop > pageHeight) {
tp.style.display = "block";
} else {
tp.style.display = "none";
}
if (backTop >= navTop) {
nav.style.position = "fixed";
nav.style.top = "0";
nav.style.left = "0";
nav.style.zIndex = "100";
} else {
nav.style.position = "";
}
}
}
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册