Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tokcos-socket-web-ts
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
小豪
tokcos-socket-web-ts
Commits
1d93209b
提交
1d93209b
authored
6月 29, 2024
作者:
Hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
父级
0da2ba73
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
21 行增加
和
17 行删除
+21
-17
.env.development
+3
-2
.env.production
+3
-2
src/axios/index.ts
+1
-1
src/components/AutomaticPrompt.vue
+12
-8
src/utils/websocket.ts
+1
-1
src/views/HomeView.vue
+1
-3
没有找到文件。
.env.development
浏览文件 @
1d93209b
NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.120
\ No newline at end of file
VITE_USER_APP_API_URL=http://im.wei-it.com/api
VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
\ No newline at end of file
.env.production
浏览文件 @
1d93209b
NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
VITE_USER_APP_API_URL=http://im.wei-it.com/api
VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
\ No newline at end of file
src/axios/index.ts
浏览文件 @
1d93209b
...
...
@@ -2,7 +2,7 @@
import
{
useUserStore
}
from
'../store/modules/user'
import
axios
from
"axios"
;
const
instance
=
axios
.
create
({
baseURL
:
`
http://
${
import
.
meta
.
env
.
VITE_USER_APP_API_URL
}
:8080
`
,
// 设置基础 URL
baseURL
:
`
${
import
.
meta
.
env
.
VITE_USER_APP_API_URL
}
`
,
// 设置基础 URL
timeout
:
1000
,
// 设置请求超时时间
});
instance
.
interceptors
.
request
.
use
(
...
...
src/components/AutomaticPrompt.vue
浏览文件 @
1d93209b
...
...
@@ -10,7 +10,7 @@
/>
<img
src=
"../assets/icon_image_s1_01.png"
@
click=
"upfile"
@
click=
"up
Img
file"
class=
"icon emoji"
alt=
""
/>
...
...
@@ -21,7 +21,7 @@
alt=
""
/>
</div>
<div
class=
"chat-bar-right"
>
<
!--
<
div
class=
"chat-bar-right"
>
<img
src=
"../assets/icon_folder_s1_01.png"
@
click=
"upfile"
...
...
@@ -29,7 +29,7 @@
alt=
""
/>
快捷回复
</div>
</div>
-->
</div>
<div
class=
"el-autocomplete textarea"
...
...
@@ -56,14 +56,13 @@
type=
"file"
@
change=
"fileImgChange"
/>
<!-- accept="image/*" -->
<!--
<input
ref=
"file"
<input
ref=
"imgFile"
style=
"display: none;"
type=
"file"
accept=
"image/*"
type=
"file"
@
change=
"fileImgChange"
/>
-->
/>
</div>
</
template
>
...
...
@@ -75,6 +74,7 @@ import { upLoadFilesHander } from '../minxins/UploadMixin'
const
inputVal
=
ref
(
''
)
const
elAutocomplete
=
ref
<
any
>
(
null
)
const
file
=
ref
<
any
>
(
null
)
const
imgFile
=
ref
<
any
>
(
null
)
const
imgShowWidth
=
ref
<
number
>
(
50
)
const
imgShowHeight
=
ref
<
number
>
(
50
)
const
showEmotion
=
ref
<
boolean
>
(
false
)
...
...
@@ -87,6 +87,10 @@ const handleEmotion = (i: any) => {
const
upfile
=
()
=>
{
file
.
value
.
click
()
}
const
upImgfile
=
()
=>
{
imgFile
.
value
.
click
()
}
//上传的数据
const
fileImgChange
=
async
()
=>
{
var
e
:
any
=
window
.
event
||
event
...
...
src/utils/websocket.ts
浏览文件 @
1d93209b
...
...
@@ -64,7 +64,7 @@ function websocketOpen() {
// 数据接收
function
websocketonmessage
(
e
:
MessageEvent
<
any
>
)
{
const
res
=
JSON
.
parse
(
e
.
data
);
// 解析JSON格式的数据
console
.
log
(
res
,
"
res
"
);
console
.
log
(
res
,
"
打印数据接受
"
);
if
(
res
.
command
==
11
)
{
//将数据放在store中
// 下面的判断则是后台返回的接收到的数据 如何处理自己决定
...
...
src/views/HomeView.vue
浏览文件 @
1d93209b
...
...
@@ -419,9 +419,7 @@ const defaultStyle: {
}
let
queryParams
=
ref
({})
const
connectMsg
=
()
=>
{
const
toUrl
=
`ws://
${
import
.
meta
.
env
.
VITE_USER_APP_API_URL
}
:8081?type=kf&code=
${
getUseUserStore
.
userInfo
?.
username
}
`
const
toUrl
=
`
${
import
.
meta
.
env
.
VITE_USER_APP_WS_API_URL
}
?type=kf&code=
${
getUseUserStore
.
userInfo
?.
username
}
`
getUseUserStore.connect()
initWebSocket(toUrl)
getUserList()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论