Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gyteng committed May 15, 2020
1 parent dd14e37 commit 90b94c1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions plugins/account/index.js
Expand Up @@ -5,6 +5,7 @@ const config = appRequire('services/config').all();
const macAccount = appRequire('plugins/macAccount/index');
const orderPlugin = appRequire('plugins/webgui_order');
const accountFlow = appRequire('plugins/account/accountFlow');
const webguiTag = appRequire('plugins/webgui_tag');

const runCommand = async cmd => {
const exec = require('child_process').exec;
Expand Down Expand Up @@ -800,10 +801,17 @@ const getAccountForSubscribe = async (token, ip) => {
account.server = JSON.parse(account.server);
}
const servers = await serverManager.list({ status: false });
const validServers = servers.filter(server => {
if(!account.server) { return true; }
return account.server.indexOf(server.id) >= 0;
});
const validServers = [];
for(const server of servers) {
const tags = await webguiTag.getTags('server', server.id);
if(tags.includes('#_hide') || tags.includes('#hide')) {
continue;
}
if(!account.server || account.server.includes(server.id)) {
validServers.push(server);
continue;
}
}
return { server: validServers, account };
};

Expand Down

0 comments on commit 90b94c1

Please sign in to comment.