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() {
118118
119119/**
120120 * 根据支持的文件类型生成 accept 属性值
121- *
121+ *
122122 * @param supportedFileTypes 支持的文件类型数组,如 ['PDF', 'DOC', 'DOCX']
123123 * @returns 用于文件上传组件 accept 属性的字符串
124124 */
@@ -503,8 +503,8 @@ export function jsonParse(str: string) {
503503 try {
504504 return JSON . parse ( str )
505505 } catch ( e ) {
506- console . error ( `str[${ str } ] 不是一个 JSON 字符串` )
507- return ''
506+ console . warn ( `str[${ str } ] 不是一个 JSON 字符串` )
507+ return str
508508 }
509509}
510510
@@ -516,7 +516,7 @@ export function jsonParse(str: string) {
516516 * @param end
517517 */
518518
519- export const sliceName = ( name : string , start : number , end : number ) => {
519+ export const sliceName = ( name : string , start : number , end : number ) => {
520520 if ( name . length > end ) {
521521 return name . slice ( start , end )
522522 }
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
1616import { getRefreshToken } from ' @/utils/auth'
1717import { useWebSocket } from ' @vueuse/core'
1818import { useMallKefuStore } from ' @/store/modules/mall/kefu'
19- import { jsonParse } from ' @/utils'
2019
2120defineOptions ({ name: ' KeFu' })
2221
6665 // 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
6766 if (type === WebSocketMessageTypeConstants .KEFU_MESSAGE_ADMIN_READ ) {
6867 // 更新会话已读
69- kefuStore .updateConversationStatus (jsonParse (jsonMessage .content ))
68+ const message = JSON .parse (jsonMessage .content )
69+ kefuStore .updateConversationStatus (message .conversationId )
7070 }
7171 } catch (error ) {
7272 console .error (error )
You can’t perform that action at this time.
0 commit comments