Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
76fdde43
authored
Apr 01, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://gitee.com/yudaocode/yudao-ui-admin-vue3
# Conflicts: # src/utils/index.ts
parents
16a98e5a
0d51ef70
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
src/utils/index.ts
+9
-9
src/views/mall/promotion/kefu/index.vue
+2
-2
No files found.
src/utils/index.ts
View file @
76fdde43
...
@@ -517,22 +517,22 @@ export function jsonParse(str: string) {
...
@@ -517,22 +517,22 @@ export function jsonParse(str: string) {
try
{
try
{
return
JSON
.
parse
(
str
)
return
JSON
.
parse
(
str
)
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
`str[
${
str
}
] 不是一个 JSON 字符串`
)
console
.
warn
(
`str[
${
str
}
] 不是一个 JSON 字符串`
)
return
''
return
str
}
}
}
}
/**
/**
* 截取字符串
* 截取字符串
*
*
* @param
str 字符串
* @param
name
* @param start
开始位置
* @param start
* @param end
结束位置
* @param end
*/
*/
export
const
s
ubString
=
(
str
:
string
,
start
:
number
,
end
:
number
)
=>
{
export
const
s
liceName
=
(
name
:
string
,
start
:
number
,
end
:
number
)
=>
{
if
(
str
.
length
>
end
)
{
if
(
name
.
length
>
end
)
{
return
str
.
slice
(
start
,
end
)
return
name
.
slice
(
start
,
end
)
}
}
return
str
return
name
}
}
src/views/mall/promotion/kefu/index.vue
View file @
76fdde43
...
@@ -16,7 +16,6 @@ import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
...
@@ -16,7 +16,6 @@ import { KeFuConversationRespVO } from '@/api/mall/promotion/kefu/conversation'
import
{
getRefreshToken
}
from
'@/utils/auth'
import
{
getRefreshToken
}
from
'@/utils/auth'
import
{
useWebSocket
}
from
'@vueuse/core'
import
{
useWebSocket
}
from
'@vueuse/core'
import
{
useMallKefuStore
}
from
'@/store/modules/mall/kefu'
import
{
useMallKefuStore
}
from
'@/store/modules/mall/kefu'
import
{
jsonParse
}
from
'@/utils'
defineOptions
({
name
:
'KeFu'
})
defineOptions
({
name
:
'KeFu'
})
...
@@ -66,7 +65,8 @@ watch(
...
@@ -66,7 +65,8 @@ watch(
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
// 2.3 消息类型:KEFU_MESSAGE_ADMIN_READ
if
(
type
===
WebSocketMessageTypeConstants
.
KEFU_MESSAGE_ADMIN_READ
)
{
if
(
type
===
WebSocketMessageTypeConstants
.
KEFU_MESSAGE_ADMIN_READ
)
{
// 更新会话已读
// 更新会话已读
kefuStore
.
updateConversationStatus
(
jsonParse
(
jsonMessage
.
content
))
const
message
=
JSON
.
parse
(
jsonMessage
.
content
)
kefuStore
.
updateConversationStatus
(
message
.
conversationId
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
error
)
console
.
error
(
error
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment