@liujitcn/kratos-taro-app-system 0.0.52 → 0.0.53
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/package.json +3 -3
- package/src/index.ts +1 -1
- package/src/notification.ts +3 -2
- package/src/rpc/base/v1/ai_search.ts +37 -0
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.
|
|
10
|
+
"version": "0.0.53",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@tarojs/components": "4.2.1",
|
|
39
39
|
"@tarojs/taro": "4.2.1",
|
|
40
40
|
"react": "18.3.1",
|
|
41
|
-
"@liujitcn/kratos-taro-app-core": "^0.0.
|
|
42
|
-
"@liujitcn/kratos-taro-app-ui": "^0.0.
|
|
41
|
+
"@liujitcn/kratos-taro-app-core": "^0.0.53",
|
|
42
|
+
"@liujitcn/kratos-taro-app-ui": "^0.0.53"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "pnpm run build:entries && pnpm pack --pack-destination ../../../dist/npm",
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,6 @@ registerUserStoreExtension({
|
|
|
13
13
|
onSilentLogout: stopNotificationPolling,
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
export { pauseNotificationPolling, resumeNotificationPolling }
|
|
16
|
+
export { pauseNotificationPolling, resumeNotificationPolling, startNotificationPolling }
|
|
17
17
|
export { systemModule }
|
|
18
18
|
export default systemModule
|
package/src/notification.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setAppMenuBadge } from '@liujitcn/kratos-taro-app-core/navigation'
|
|
2
2
|
import { getToken } from '@liujitcn/kratos-taro-app-core/utils/auth'
|
|
3
|
-
import { getRequestAccessToken } from '@liujitcn/kratos-taro-app-core/utils/http'
|
|
3
|
+
import { getRequestAccessToken, requestBaseURL } from '@liujitcn/kratos-taro-app-core/utils/http'
|
|
4
4
|
import { defNotificationService } from './api/base/v1/notification'
|
|
5
5
|
|
|
6
6
|
/** System 模块共享的站内信未读数。 */
|
|
@@ -71,7 +71,8 @@ function startNotificationSse(): () => void {
|
|
|
71
71
|
try {
|
|
72
72
|
const token = await getRequestAccessToken()
|
|
73
73
|
if (!token || controller.signal.aborted) return
|
|
74
|
-
const
|
|
74
|
+
const sseBaseURL = requestBaseURL.replace(/\/api\/?$/, '') || window.location.origin
|
|
75
|
+
const response = await fetch(`${sseBaseURL}/events/base.notification`, {
|
|
75
76
|
headers: { Accept: 'text/event-stream', Authorization: token },
|
|
76
77
|
signal: controller.signal,
|
|
77
78
|
})
|
|
@@ -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
|
+
}
|