api 구조 변경
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { LoginCtx } from "./ReqLogin.js";
|
||||
import type { SessionCtx } from "./StartSession.js";
|
||||
import type { DecoratorResult, ProcDecoratorGenerator } from "./base.js";
|
||||
import type { ProcDecoratorGenerator } from "./base.js";
|
||||
|
||||
export type GameLoginCtx = {
|
||||
generalID: number;
|
||||
|
||||
@@ -8,10 +8,11 @@ export type LoginCtx = {
|
||||
allowServerAction: Record<string, number>;
|
||||
loginDate: Date;
|
||||
}
|
||||
export const loginCtxSessionKey = 'loginCtx';
|
||||
|
||||
export function ReqLogin<Q extends SessionCtx>(): ProcDecorator<LoginCtx & Q, Q> {
|
||||
return (ctx) => {
|
||||
const loginCtx = ctx.session.getItem<LoginCtx>('loginCtx');
|
||||
const loginCtx = ctx.session.getItem<LoginCtx>(loginCtxSessionKey);
|
||||
if(!loginCtx){
|
||||
return [{
|
||||
result: false,
|
||||
|
||||
Reference in New Issue
Block a user