HJ_Server/src/api_s2c/slzd/ApiAim.ts
DESKTOP-15R5JU0\legu 97e070ea81 init
2023-11-17 12:02:12 +08:00

15 lines
523 B
TypeScript

import { ApiCall } from "tsrpc";
import { ReqAim, ResAim } from "../../shared/protocols/slzd/PtlAim";
export default async function (call: ApiCall<ReqAim, ResAim>) {
if (call.conn.gud.ghLevel > 2 || call.conn.gud.ghLevel == 0) return call.error(globalThis.lng.slzd_1);
if (!G.gc.slzd.forts[call.req.fort]) return call.error(globalThis.lng.shiwu_6);
G.mongodb.collection('slzdUser').updateMany(
{ ghid: call.conn.gud.ghId },
{ $set: { "data.aim": call.req.fort } }
);
call.succ({});
}