|
|
@@ -3,7 +3,6 @@ import {
|
|
|
RefreshToken,
|
|
|
PackageName,
|
|
|
ProductId,
|
|
|
- IosUrl,
|
|
|
SandboxIosUrl,
|
|
|
Account,
|
|
|
ClientSecret,
|
|
|
@@ -659,7 +658,38 @@ class ApiController {
|
|
|
async getServerList(ctx) {
|
|
|
let tag = ctx.query.tag || 'default'
|
|
|
const servers = (await Server.getServerList(tag))
|
|
|
- ctx.body = servers
|
|
|
+ let data = []
|
|
|
+ let ip = ctx.request.ip
|
|
|
+ if (ip.startsWith('::ffff:')) {
|
|
|
+ ip = ip.substring('::ffff:'.length);
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.info("区服接口", { "ip": ctx.request.ip })
|
|
|
+ if (servers.length > 0) {
|
|
|
+ servers.forEach(function (element) {
|
|
|
+ let status = element.status
|
|
|
+ if (status == 0 && element.white_list) {
|
|
|
+ const list = element.white_list.split(",");
|
|
|
+
|
|
|
+ if (list.length > 0) {
|
|
|
+ if (list.includes(ip)) {
|
|
|
+ status = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ data.push({
|
|
|
+ "id": element.server_id,
|
|
|
+ "name": element.name,
|
|
|
+ "ip": element.ip,
|
|
|
+ "port": element.port,
|
|
|
+ "tips": element.tips,
|
|
|
+ "status": status,
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ ctx.body = data
|
|
|
}
|
|
|
|
|
|
async getAllServerList(ctx) {
|