Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Y
yishuju-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
yishuju-ui
Commits
cd5986e5
Commit
cd5986e5
authored
Apr 10, 2025
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket
parent
808025bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
Message.vue
src/layouts/components/Header/components/Message.vue
+13
-8
index.vue
src/views/login/index.vue
+4
-4
vite.config.js
vite.config.js
+1
-0
No files found.
src/layouts/components/Header/components/Message.vue
View file @
cd5986e5
...
@@ -102,14 +102,19 @@
...
@@ -102,14 +102,19 @@
import
{
getAppEnvConfig
}
from
'@/utils/env'
;
import
{
getAppEnvConfig
}
from
'@/utils/env'
;
const
envs
=
getAppEnvConfig
();
const
envs
=
getAppEnvConfig
();
const
{
userInfo
}
=
useUserStore
();
const
{
userInfo
}
=
useUserStore
();
if
(
!
socketStore
.
ws
&&
userInfo
.
id
)
{
watch
(
let
url
=
`ws://8.152.205.9:8080/websocket/
${
userInfo
.
id
}
`
;
userInfo
,
console
.
log
(
'url'
,
url
);
(
newValue
,
oldValue
)
=>
{
socketStore
.
connection
(
url
);
console
.
log
(
'asdsa'
,
userInfo
)
}
if
(
userInfo
.
id
)
{
if
(
socketStore
.
ws
)
{
let
url
=
window
.
location
.
origin
?.
replace
(
'https://'
,
'wss://'
).
replace
(
'http://'
,
'ws://'
)
+
'/api/websocket/'
+
userInfo
.
id
;
socketStore
.
sendMsg
({
aa
:
44
});
socketStore
.
connection
(
url
);
}
}
if
(
socketStore
.
ws
)
{
socketStore
.
sendMsg
({
aa
:
44
});
}
}
,{
immediate
:
true
});
const
clickMsg
=
()
=>
{
const
clickMsg
=
()
=>
{
visible
.
value
=
false
;
visible
.
value
=
false
;
newMsgList
.
value
=
[];
newMsgList
.
value
=
[];
...
...
src/views/login/index.vue
View file @
cd5986e5
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
initDynamicRouter
}
from
'@/router/modules/dynamicRouter'
;
import
{
initDynamicRouter
}
from
'@/router/modules/dynamicRouter'
;
import
{
useUserStore
}
from
'@/stores/modules/user'
;
import
{
useUserStore
}
from
'@/stores/modules/user'
;
import
useSocketStore
from
'@/stores/modules/websocket'
;
//
import useSocketStore from '@/stores/modules/websocket';
import
{
useTabsStore
}
from
'@/stores/modules/tabs'
;
import
{
useTabsStore
}
from
'@/stores/modules/tabs'
;
import
{
useKeepAliveStore
}
from
'@/stores/modules/keepAlive'
;
import
{
useKeepAliveStore
}
from
'@/stores/modules/keepAlive'
;
import
{
HOME_URL
}
from
'@/config'
;
import
{
HOME_URL
}
from
'@/config'
;
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
import
{
getAppEnvConfig
}
from
'@/utils/env'
;
import
{
getAppEnvConfig
}
from
'@/utils/env'
;
const
envs
=
getAppEnvConfig
();
const
envs
=
getAppEnvConfig
();
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
const
socketStore
=
useSocketStore
();
//
const socketStore = useSocketStore();
const
tabsStore
=
useTabsStore
();
const
tabsStore
=
useTabsStore
();
const
keepAliveStore
=
useKeepAliveStore
();
const
keepAliveStore
=
useKeepAliveStore
();
const
tenantRef
=
ref
();
const
tenantRef
=
ref
();
...
@@ -142,8 +142,8 @@
...
@@ -142,8 +142,8 @@
const
{
result
:
userInfo
}
=
await
getUserInfo
();
const
{
result
:
userInfo
}
=
await
getUserInfo
();
userStore
.
setUserInfo
(
userInfo
);
userStore
.
setUserInfo
(
userInfo
);
let
url
=
`ws://8.152.205.9:8080/websocket/
${
userInfo
.
id
}
`
;
//
let url = `ws://8.152.205.9:8080/websocket/${userInfo.id}`;
socketStore
.
connection
(
url
);
//
socketStore.connection(url);
// 如果有多个调解中心,需要选择调解中心进入系统
// 如果有多个调解中心,需要选择调解中心进入系统
if
(
userInfo
.
tenants
.
length
>
1
)
{
if
(
userInfo
.
tenants
.
length
>
1
)
{
tenantRef
.
value
.
openModal
(
userInfo
.
tenants
);
tenantRef
.
value
.
openModal
(
userInfo
.
tenants
);
...
...
vite.config.js
View file @
cd5986e5
...
@@ -58,6 +58,7 @@ export default defineConfig(({ command, mode }) => {
...
@@ -58,6 +58,7 @@ export default defineConfig(({ command, mode }) => {
// target: 'http://192.168.31.187:8080',
// target: 'http://192.168.31.187:8080',
// target: 'http://192.168.31.128:8080',
// target: 'http://192.168.31.128:8080',
target
:
'http://8.152.205.9:8080'
,
target
:
'http://8.152.205.9:8080'
,
ws
:
true
,
changeOrigin
:
true
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
),
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
),
},
},
...
...
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