Skip to content

Commit

Permalink
Merge pull request #14 from KennethHoo/master
Browse files Browse the repository at this point in the history
chinese
  • Loading branch information
muskf authored Oct 24, 2024
2 parents 08070d4 + a8898e8 commit 8295c61
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public ResponseEntity<String> auth(HttpServletRequest request) throws Exception
log.info("Successfully authed with the gateway {} ({})", gateway.getName(), gateway.getId());
token = authorize.getToken();
} else {
log.error("Gateway {} ({}) is not available. Authorizing with this server...", gateway.getName(), gateway.getId());
log.error("子节点 {} ({}) 当前不可用. 正在尝试认证服务器中...", gateway.getName(), gateway.getId());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public VapeRestBean<AuthorizationDTO> onAuthenticated(@PathVariable String token
.build()
); // return fake data
}
log.info("User {} login to the fake online service (token={})", user.getUsername(), token);
log.info("User {} 连接了在线服务 (token={})", user.getUsername(), token);
return VapeRestBean.success(AuthorizationDTO.builder()
.accountCreation(formatUtil.formatVapeTime(user.getRegisterTime()))
.userId(114514)
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/fuck/manthe/nmsl/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public ResponseEntity<RestBean<String>> redeem(@RequestBody RedeemDTO dto) throw
User user = userService.addUser(User.builder().password(passwordEncoder.encode(password)).username(username).role("USER").expire(expire).build());
if (user != null) {
if (redeemService.useCode(redeemCode.getCode(), user)) {
log.info("User {} registered it's account with the code {} ({}d).", username, redeemCode.getCode(), redeemCode.getDate());
log.info("User {} 使用兑换码 {} ({}d) 注册了账户.", username, redeemCode.getCode(), redeemCode.getDate());
}
// push to webhooks
UserRegisterMessage message = new UserRegisterMessage();
Expand All @@ -70,7 +70,7 @@ public ResponseEntity<RestBean<String>> redeem(@RequestBody RedeemDTO dto) throw
} else if (userService.isValid(username, password) && userService.renew(username, redeemCode.getDate())) {
User existUser = userService.findByUsername(username);
if (redeemService.useCode(redeemCode.getCode(), existUser)) {
log.info("User {} renewed it's account with the code {} ({}d).", username, redeemCode.getCode(), redeemCode.getDate());
log.info("User {} 使用兑换码 {} ({}d) 续费了他的账户.", username, redeemCode.getCode(), redeemCode.getDate());
}
// Push to webhooks
UserRenewMessage message = new UserRenewMessage();
Expand All @@ -80,9 +80,9 @@ public ResponseEntity<RestBean<String>> redeem(@RequestBody RedeemDTO dto) throw
message.setExpireAt(userService.findByUsername(username).getExpire());
message.setContent("用户 %s 使用%s 兑换了%s 天订阅".formatted(username, redeemCode.getCode(), redeemCode.getDate()));
webhookService.pushAll("renew", message);
return ResponseEntity.ok(RestBean.success("Renewed."));
return ResponseEntity.ok(RestBean.success("续费成功!"));
}
return new ResponseEntity<>(RestBean.failure(409, "User exists or wrong password"), HttpStatus.CONFLICT);
return new ResponseEntity<>(RestBean.failure(409, "用户名已被占用或密码错误!"), HttpStatus.CONFLICT);
}

@PostMapping("forgetPassword")
Expand All @@ -96,10 +96,10 @@ public ResponseEntity<RestBean<String>> forgetPassword(@RequestBody ForgetPasswo
if (redeemCode == null || redeemCode.isAvailable() || redeemCode.getRedeemer() == null || !redeemCode.getRedeemer().getId().equals(user.getId())) {
// 邀请码找不到或者根本没被人用过
// 写到一起是为了防止被刷API
return new ResponseEntity<>(RestBean.failure(404, "Code not found."), HttpStatus.NOT_FOUND);
return new ResponseEntity<>(RestBean.failure(404, "兑换码不存在"), HttpStatus.NOT_FOUND);
}
user.setPassword(passwordEncoder.encode(dto.getPassword()));
userService.save(user);
return ResponseEntity.ok(RestBean.success("Password reset successfully"));
return ResponseEntity.ok(RestBean.success("密码重置成功!"));
}
}
122 changes: 67 additions & 55 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,80 @@
<title>顶真租号平台 - 为玩家打造的共享体验</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;700&display=swap" rel="stylesheet">
<link href="/style.css" rel="stylesheet">
<script>
// async function checkConnection() {
// let domains = [
// "http://vape.gg",
// "http://www.vape.gg",
// // "http://chink2.vape.gg",
// // "http://online.vape.gg"
// ]
// for (let domain of domains) {
// let url = `${domain}/check`
// try {
// const response = await fetch(url, { method: 'GET', mode: 'cors' });
// if (response.ok) {
// document.getElementById('hosts').innerHTML = 'OK';
// } else {
// document.getElementById('hosts').innerHTML = '已配置hosts,但是某些服务器的返回值不正确';
// }
// } catch (error) {
// document.getElementById('hosts').innerHTML = '配置错误';
// console.error('Network error:', error);
// }
// }
// }
</script>
<style>
body {
font-family: 'Noto Sans SC', sans-serif;
background-color: #f0f4f8;
position: relative;
}
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
background: rgba(255, 255, 255, 0.8);
backdrop-filter: blur(10px);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
z-index: 10;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.navbar h1 {
font-size: 24px;
}
.navbar a {
text-decoration: none;
color: #007bff;
padding: 10px 15px;
border-radius: 5px;
transition: background 0.3s;
}
.navbar a:hover {
background: rgba(0, 123, 255, 0.1);
}
.container {
margin-top: 80px;
padding: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>欢迎来到顶真租号平台</h1>
<div class="navbar">
<h1>顶真租号平台</h1>
<a href="/login">登录</a>
</div>

<p class="highlight">恭喜!
你已成功运行顶真租号玩。这是CubeWhyMC为无法承担顶针客户端高昂费用的玩家打造的顶尖顶针体验平台。</p>
<div class="container">
<h1>欢迎来到顶真租号平台</h1>
<p class="highlight">恭喜! 你已成功运行顶真租号玩。这是CubeWhyMC为无法承担顶针客户端高昂费用的玩家打造的顶尖顶针体验平台。</p>

<h2>平台介绍</h2>
<a href="https://discord.lunarclient.top">
<img alt="Discord"
src="https://img.shields.io/discord/1047866655033802802?logo=discord&label=Discord&color=blue">
</a>
<a href="https://t.me/qbychannel">
<img alt="Static Badge"
src="https://img.shields.io/badge/channel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kxPSIwIiB4Mj0iMTEuOTkiIHkyPSIyMy44MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiMyQUFCRUUiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMyMjlFRDkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4K&label=Telegram">
</a>
<a href="https://github.com/CubeWhyMC/DingZhenServlet">
<img alt="Static Badge"
src="https://img.shields.io/github/stars/CubeWhyMC/DingZhenServlet">
</a>
<p class="highlight">这是一个Minecraft Cheat服务, 不要DDoS我们的服务, 谢谢</p>
<h2>平台介绍</h2>
<a href="https://discord.lunarclient.top">
<img alt="Discord" src="https://img.shields.io/discord/1047866655033802802?logo=discord&label=Discord&color=blue">
</a>
<a href="https://t.me/qbychannel">
<img alt="Static Badge" src="https://img.shields.io/badge/channel-Telegram?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZD0iTTEyIDI0YzYuNjI3IDAgMTItNS4zNzMgMTItMTJTMTguNjI3IDAgMTIgMCAwIDUuMzczIDAgMTJzNS4zNzMgMTIgMTIgMTJaIiBmaWxsPSJ1cmwoI2EpIi8%2BPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01LjQyNSAxMS44NzFhNzk2LjQxNCA3OTYuNDE0IDAgMCAxIDYuOTk0LTMuMDE4YzMuMzI4LTEuMzg4IDQuMDI3LTEuNjI4IDQuNDc3LTEuNjM4LjEgMCAuMzIuMDIuNDcuMTQuMTIuMS4xNS4yMy4xNy4zMy4wMi4xLjA0LjMxLjAyLjQ3LS4xOCAxLjg5OC0uOTYgNi41MDQtMS4zNiA4LjYyMi0uMTcuOS0uNSAxLjE5OS0uODE5IDEuMjI5LS43LjA2LTEuMjI5LS40Ni0xLjg5OC0uOS0xLjA2LS42ODktMS42NDktMS4xMTktMi42NzgtMS43OTgtMS4xOS0uNzgtLjQyLTEuMjA5LjI2LTEuOTA4LjE4LS4xOCAzLjI0Ny0yLjk3OCAzLjMwNy0zLjIyOC4wMS0uMDMuMDEtLjE1LS4wNi0uMjEtLjA3LS4wNi0uMTctLjA0LS4yNS0uMDItLjExLjAyLTEuNzg4IDEuMTQtNS4wNTYgMy4zNDgtLjQ4LjMzLS45MDkuNDktMS4yOTkuNDgtLjQzLS4wMS0xLjI0OC0uMjQtMS44NjgtLjQ0LS43NS0uMjQtMS4zNDktLjM3LTEuMjk5LS43OS4wMy0uMjIuMzMtLjQ0Ljg5LS42NjlaIiBmaWxsPSIjZmZmIi8%2BPGRlZnM%2BPGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iMTEuOTkiIHkxPSIwIiB4Mj0iMTEuOTkiIHkyPSIyMy44MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiMyQUFCRUUiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMyMjlFRDkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4K&label=Telegram">
</a>
<a href="https://github.com/CubeWhyMC/DingZhenServlet">
<img alt="Static Badge" src="https://img.shields.io/github/stars/CubeWhyMC/DingZhenServlet">
</a>
<p class="highlight">这是一个Minecraft Cheat服务, 不要DDoS我们的服务, 谢谢</p>

<p>
顶真租号平台旨在为广大游戏玩家提供一个经济实惠的游戏体验方案。我们深知很多玩家渴望体验高级游戏功能,但可能受限于预算。通过我们的共享账号服务,你可以以极具竞争力的价格享受到顶级游戏体验。</p>
<p>顶真租号平台旨在为广大游戏玩家提供一个经济实惠的游戏体验方案。我们深知很多玩家渴望体验高级游戏功能,但可能受限于预算。通过我们的共享账号服务,你可以以极具竞争力的价格享受到顶级游戏体验。</p>

<h2>使用说明</h2>
<a class="next-inject" href="/user/colddown">下一次发车时间</a>
<p>1. 设置hosts: 完成赞助后,你只需要按照指引进行设置即可开始游玩。</p>
<p>2. 享受游戏: 设置完成后,你就可以畅享各种高级功能,提升你的游戏体验。</p>
<h2>使用说明</h2>
<a class="next-inject" href="/user/colddown">下一次发车时间</a>
<p>1. 设置hosts: 完成赞助后,你只需要按照指引进行设置即可开始游玩。</p>
<p>2. 享受游戏: 设置完成后,你就可以畅享各种高级功能,提升你的游戏体验。</p>

<h2>注意事项</h2>
<!-- <a onclick="checkConnection()" id="hosts" class="next-inject">点击这里检查hosts配置(自动)</a>-->
<p>1. 请遵守游戏规则和道德准则,共同维护良好的游戏环境。</p>
<p>2. 定期查看我们的更新公告,了解最新的功能和改进。</p>
<p>3. 如遇到任何问题,请及时与我们的客户支持团队联系。</p>
<h2>注意事项</h2>
<p>1. 请遵守游戏规则和道德准则,共同维护良好的游戏环境。</p>
<p>2. 定期查看我们的更新公告,了解最新的功能和改进。</p>
<p>3. 如遇到任何问题,请及时与我们的客户支持团队联系。</p>

<a class="github-link" href="https://github.com/CubeWhyMC/DingZhenServlet" target="_blank">访问 GitHub 项目</a>
</div>
<a class="github-link" href="https://github.com/CubeWhyMC/DingZhenServlet" target="_blank">访问 GitHub 项目</a>
</div>
</body>
</html>

0 comments on commit 8295c61

Please sign in to comment.