@@ -83,15 +83,20 @@ import Message from '@/components/Message/index.vue'
import { ref, watch, onMounted, onUnmounted } from 'vue'
import { doRequest } from '@/utils/axios/request'
import { messageAccessLogs } from '@/api/customermanagement/customerList'
+import useAdminWebSocket from '@/hooks/websocket'
//获取当前账号角色
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const userInfoCurrent = ref('')
onMounted(() => {
- console.log(userInfo, 'userInfo?.permissions')
- // userInfoCurrent = userInfo?.roleCodes
userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString()
+ if (
+ userInfoCurrent.value === 'ROLE_SALESMAN' ||
+ userInfoCurrent.value === 'ROLE_STORE_SALESMAN'
+ ) {
+ useAdminWebSocket()
+ }
})
const visible = ref(false)
@@ -103,7 +108,7 @@ interface DataItem {
createTime: string
content: string
messageKey: string
- status: number | undefined
+ state: number | undefined
title: string
show: boolean
}
@@ -185,6 +190,7 @@ const getMessageList = () => {
{
onSuccess: (res: any) => {
newclueList.value = res.data.records
+ console.log(newclueList.value, 'newclueList.value')
newclueList.value.forEach(item => {
item.show = true
})
diff --git a/src/views/customermanagement/customerList/customerList.vue b/src/views/customermanagement/customerList/customerList.vue
index a498980..3477cb0 100644
--- a/src/views/customermanagement/customerList/customerList.vue
+++ b/src/views/customermanagement/customerList/customerList.vue
@@ -87,6 +87,7 @@ import CustomerListSearch from '@/views/customermanagement/customerList/customer
import CustomerListViewModal from '@/views/customermanagement/customerList/customerListModal.vue'
import CustomerListEditModal from '@/views/customermanagement/customerList/customerListEditModal.vue'
import { useRoute } from 'vue-router'
+// import useAdminWebSocket from '@/hooks/websocket'
//删除
// import { doRequest } from '@/utils/axios/request'
@@ -97,6 +98,7 @@ onMounted(() => {
if (customerId) {
searchTable({ clueId: customerId })
}
+ // useAdminWebSocket()
})
defineOptions({ name: 'CustomerList' })
@@ -160,7 +162,7 @@ const columns: ProColumns[] = [
dataIndex: 'index',
width: '80px',
customRender: function ({ index, record }: { index: number; record: any }) {
- if (record.clueStageName === '阶段二') {
+ if (record.isNewClue === true) {
return {
children: [
h('span', [
diff --git a/src/views/login/components/LoginContent.vue b/src/views/login/components/LoginContent.vue
index cb68558..4045a48 100644
--- a/src/views/login/components/LoginContent.vue
+++ b/src/views/login/components/LoginContent.vue
@@ -80,7 +80,7 @@ import { projectTitle, projectDesc, enableLoginCaptcha } from '@/config'
import { SliderCaptcha as LoginCaptcha } from '@/components/Captcha'
import { useI18n } from 'vue-i18n'
import { getCodeData } from '@/api/auth'
-import useAdminWebSocket from '@/hooks/websocket'
+// import useAdminWebSocket from '@/hooks/websocket'
const { t } = useI18n()
@@ -172,24 +172,26 @@ function handleSubmit(captchaId?: string) {
store(res)
const nextPath = (router.currentRoute.value.query.redirect as string) || '/'
router.push(nextPath)
+
// 获取 WebSocket 连接对象
- const webSocket = useAdminWebSocket()
-
- // 确保 WebSocket 连接已经建立
- if (webSocket && webSocket.status.value === 'OPEN') {
- // 要发送的消息数据
- const messageData = {
- type: 'chatMessage',
- content: 'Hello, WebSocket!'
- }
-
- // 发送消息
- webSocket.send(JSON.stringify(messageData))
- // 输出发送的消息内容
- console.log('Sent message:', JSON.stringify(messageData))
- } else {
- console.error('WebSocket connection is not open')
- }
+ // const webSocket =
+ // useAdminWebSocket()
+
+ // // 确保 WebSocket 连接已经建立
+ // if (webSocket && webSocket.status.value === 'OPEN') {
+ // // 要发送的消息数据
+ // const messageData = {
+ // type: 'chatMessage',
+ // content: 'Hello, WebSocket!'
+ // }
+
+ // // 发送消息
+ // webSocket.send(JSON.stringify(messageData))
+ // // 输出发送的消息内容
+ // console.log('Sent message:', JSON.stringify(messageData))
+ // } else {
+ // console.error('WebSocket connection is not open')
+ // }
})
.catch(err => {
// console.log(accountLoginFormRef.value, 'accountLoginFormRef')
diff --git a/vite.config.ts b/vite.config.ts
index 4014482..9167971 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -26,9 +26,9 @@ import { antdvStyleDeps } from './src/utils/resolvers'
//jt
// export const serverAddress = 'http://172.18.1.8:8000'
//ts
-// export const serverAddress = 'http://172.18.0.228:8000'
+export const serverAddress = 'http://172.18.0.228:8000'
//测试
-export const serverAddress = 'http://39.100.77.21:8000'
+// export const serverAddress = 'http://39.100.77.21:8000'
//线上ip
// export const serverAddress = 'http://175.27.212.74:80'
@@ -45,7 +45,7 @@ export default defineConfig({
'^/api': {
target: serverAddress,
changeOrigin: true,
- // ws: true,
+ ws: true,
rewrite: path => {
return path.replace(/^\/api/, '')
}