门店账户多账号

This commit is contained in:
2026-07-12 12:24:34 +08:00
parent 06b1cb22e0
commit 54a15d6da7
39 changed files with 1962 additions and 311 deletions
@@ -0,0 +1,15 @@
import { CanActivate, ExecutionContext, ForbiddenException, Injectable } from '@nestjs/common';
import type { AuthUser } from './jwt-auth.guard';
/** Shop business APIs require JWT claim storeId (after select-store). */
@Injectable()
export class ShopStoreGuard implements CanActivate {
canActivate(context: ExecutionContext): boolean {
const req = context.switchToHttp().getRequest();
const user = req.user as AuthUser | undefined;
if (!user?.storeId) {
throw new ForbiddenException('请先选择门店');
}
return true;
}
}