File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
views/mall/promotion/kefu Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export function toAnyString() {
118
118
119
119
/**
120
120
* 根据支持的文件类型生成 accept 属性值
121
- *
121
+ *
122
122
* @param supportedFileTypes 支持的文件类型数组,如 ['PDF', 'DOC', 'DOCX']
123
123
* @returns 用于文件上传组件 accept 属性的字符串
124
124
*/
@@ -503,8 +503,8 @@ export function jsonParse(str: string) {
503
503
try {
504
504
return JSON . parse ( str )
505
505
} catch ( e ) {
506
- console . error ( `str[${ str } ] 不是一个 JSON 字符串` )
507
- return ''
506
+ console . warn ( `str[${ str } ] 不是一个 JSON 字符串` )
507
+ return str
508
508
}
509
509
}
510
510
@@ -516,7 +516,7 @@ export function jsonParse(str: string) {
516
516
* @param end
517
517
*/
518
518
519
- export const sliceName = ( name : string , start : number , end : number ) => {
519
+ export const sliceName = ( name : string , start : number , end : number ) => {
520
520
if ( name . length > end ) {
521
521
return name . slice ( start , end )
522
522
}
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
16
16
import { getRefreshToken } from ' @/utils/auth'
17
17
import { useWebSocket } from ' @vueuse/core'
18
18
import { useMallKefuStore } from ' @/store/modules/mall/kefu'
19
- import { jsonParse } from ' @/utils'
20
19
21
20
defineOptions ({ name: ' KeFu' })
22
21
66
65
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
67
66
if (type === WebSocketMessageTypeConstants .KEFU_MESSAGE_ADMIN_READ ) {
68
67
// 更新会话已读
69
- kefuStore .updateConversationStatus (jsonParse (jsonMessage .content ))
68
+ const message = JSON .parse (jsonMessage .content )
69
+ kefuStore .updateConversationStatus (message .conversationId )
70
70
}
71
71
} catch (error ) {
72
72
console .error (error )
You can’t perform that action at this time.
0 commit comments