From 0d90e20ec20f0aeee642756a7ebf9e8514174124 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期一, 26 十月 2026 21:15:20 +0800
Subject: [PATCH] 微信小程序插件支持
---
src/modules/cs/service/session.ts | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/modules/cs/service/session.ts b/src/modules/cs/service/session.ts
index 3994ad7..237025d 100644
--- a/src/modules/cs/service/session.ts
+++ b/src/modules/cs/service/session.ts
@@ -1,5 +1,5 @@
import { Provide } from '@midwayjs/core';
-import { BaseService } from '@cool-midway/core';
+import { BaseService, CoolCommException } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { CsSessionEntity } from '../entity/session';
@@ -26,6 +26,9 @@
* @returns
*/
async create(userId: number) {
+ if (!userId) {
+ throw new CoolCommException('鐢ㄦ埛涓嶅瓨鍦�');
+ }
const check = await this.detail(userId);
if (check) {
return check;
--
Gitblit v1.9.1