mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
Fix: API UUID Err
This commit is contained in:
parent
5557f69dec
commit
1a51f39a59
@ -24,7 +24,8 @@ router.get(
|
||||
try {
|
||||
const daemonId = String(ctx.query.daemonId);
|
||||
const instanceUuid = String(ctx.query.uuid);
|
||||
if (!isHaveInstanceByUuid(getUserUuid(ctx), daemonId, instanceUuid)) return;
|
||||
if (!isHaveInstanceByUuid(getUserUuid(ctx), daemonId, instanceUuid))
|
||||
throw new Error($t("TXT_CODE_permission.forbidden"));
|
||||
const remoteService = RemoteServiceSubsystem.getInstance(daemonId);
|
||||
const result = await new RemoteRequest(remoteService).request("instance/detail", {
|
||||
instanceUuid
|
||||
|
@ -148,7 +148,7 @@ export function getUserUuid(ctx: Koa.ParameterizedContext): string {
|
||||
if (isApiRequest(ctx)) {
|
||||
const user = getUuidByApiKey(getApiKey(ctx));
|
||||
if (user && user.uuid) {
|
||||
return user.userName;
|
||||
return user.uuid;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user