@liujitcn/kratos-uni-app-system 0.0.52 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { registerUserStoreExtension } from "@liujitcn/kratos-uni-app-core/stores
4
4
  // src/notification.ts
5
5
  import { ref } from "vue";
6
6
  import { setAppMenuBadge } from "@liujitcn/kratos-uni-app-core/navigation";
7
- import { getRequestAccessToken } from "@liujitcn/kratos-uni-app-core/utils/http";
7
+ import { getRequestAccessToken, requestBaseURL } from "@liujitcn/kratos-uni-app-core/utils/http";
8
8
 
9
9
  // src/api/base/v1/notification.ts
10
10
  import { http } from "@liujitcn/kratos-uni-app-core/utils/http";
@@ -170,7 +170,8 @@ function startNotificationSse() {
170
170
  const token = await getRequestAccessToken();
171
171
  if (!token || controller.signal.aborted)
172
172
  return;
173
- const response = await fetch(`${window.location.origin}/events?stream=base.notification`, {
173
+ const sseBaseURL = requestBaseURL.replace(/\/api\/?$/, "") || window.location.origin;
174
+ const response = await fetch(`${sseBaseURL}/events/base.notification`, {
174
175
  headers: { Accept: "text/event-stream", Authorization: token },
175
176
  signal: controller.signal
176
177
  });
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "type": "git",
8
8
  "url": "git@github.com:liujitcn/kratos-admin.git"
9
9
  },
10
- "version": "0.0.52",
10
+ "version": "0.0.54",
11
11
  "type": "module",
12
12
  "files": [
13
13
  "dist",
@@ -35,7 +35,7 @@
35
35
  "@dcloudio/uni-app": "3.0.0-5010520260709002",
36
36
  "@dcloudio/uni-ui": "^1.4.28",
37
37
  "vue": "^3.4.21",
38
- "@liujitcn/kratos-uni-app-core": "^0.0.52"
38
+ "@liujitcn/kratos-uni-app-core": "^0.0.54"
39
39
  },
40
40
  "devDependencies": {
41
41
  "esbuild": "^0.20.2",
@@ -1,6 +1,6 @@
1
1
  import { ref } from 'vue'
2
2
  import { setAppMenuBadge } from '@liujitcn/kratos-uni-app-core/navigation'
3
- import { getRequestAccessToken } from '@liujitcn/kratos-uni-app-core/utils/http'
3
+ import { getRequestAccessToken, requestBaseURL } from '@liujitcn/kratos-uni-app-core/utils/http'
4
4
  import { defNotificationService } from './api/base/v1/notification'
5
5
 
6
6
  /** System 模块共享的站内信未读数。 */
@@ -69,7 +69,8 @@ function startNotificationSse(): () => void {
69
69
  try {
70
70
  const token = await getRequestAccessToken()
71
71
  if (!token || controller.signal.aborted) return
72
- const response = await fetch(`${window.location.origin}/events?stream=base.notification`, {
72
+ const sseBaseURL = requestBaseURL.replace(/\/api\/?$/, '') || window.location.origin
73
+ const response = await fetch(`${sseBaseURL}/events/base.notification`, {
73
74
  headers: { Accept: 'text/event-stream', Authorization: token },
74
75
  signal: controller.signal,
75
76
  })
@@ -0,0 +1,37 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: base/v1/ai_search.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** AI 助手联网搜索请求 */
10
+ export interface SearchAiWebRequest {
11
+ /** 搜索关键词 */
12
+ query: string;
13
+ /** 返回结果数量:0 表示默认5条,最大10条 */
14
+ limit: number;
15
+ }
16
+
17
+ /** AI 助手联网搜索响应 */
18
+ export interface SearchAiWebResponse {
19
+ /** 搜索结果列表 */
20
+ items: SearchAiWebItem[];
21
+ }
22
+
23
+ /** AI 助手联网搜索结果 */
24
+ export interface SearchAiWebItem {
25
+ /** 结果标题 */
26
+ title: string;
27
+ /** 结果链接 */
28
+ url: string;
29
+ /** 结果摘要 */
30
+ snippet: string;
31
+ }
32
+
33
+ /** Base AI 助手联网搜索服务 */
34
+ export interface AiSearchService {
35
+ /** 联网搜索公开信息并返回结果摘要 */
36
+ SearchAiWeb(request: SearchAiWebRequest): Promise<SearchAiWebResponse>;
37
+ }