Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4cbad14c98 | |||
6c6bcb7dce | |||
7d3d47a63c | |||
c00d5da7d7 | |||
32aa5f7d81 | |||
78009bc5e7 |
13
env/.env.prod
vendored
13
env/.env.prod
vendored
@ -3,5 +3,14 @@ ENV = 'production'
|
|||||||
|
|
||||||
VITE_BASE=/
|
VITE_BASE=/
|
||||||
VITE_ROUTER_MODE=history
|
VITE_ROUTER_MODE=history
|
||||||
VITE_BASE_API=https://xxxx.xxx.com
|
VUE_APP_PREVIEW=false
|
||||||
VITE_SOCKET_API=wss://xxxx.xxxx.com
|
VUE_APP_WEBSITE_NAME=""
|
||||||
|
|
||||||
|
# baseUrl
|
||||||
|
VITE_BASE_API = 'https://chat.szjixun.cn' #体制内
|
||||||
|
#VITE_SOCKET_API
|
||||||
|
VITE_SOCKET_API = 'wss://chat.szjixun.cn' #体制内
|
||||||
|
# EPRAPI baseUrl
|
||||||
|
VITE_EPR_BASEURL = 'https://erpapi.fontree.cn' #体制内
|
||||||
|
# 文档查看器
|
||||||
|
VITE_PAGE_URL = https://chat-pc.szjixun.cn #体制内
|
16
env/.env.prodOut
vendored
Normal file
16
env/.env.prodOut
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# just a flag
|
||||||
|
ENV = 'production'
|
||||||
|
|
||||||
|
VITE_BASE=/
|
||||||
|
VITE_ROUTER_MODE=history
|
||||||
|
VUE_APP_PREVIEW=false
|
||||||
|
VUE_APP_WEBSITE_NAME=""
|
||||||
|
|
||||||
|
# baseUrl
|
||||||
|
VITE_BASE_API = 'https://chat-out.szjixun.cn' #体制外
|
||||||
|
#VITE_SOCKET_API
|
||||||
|
VITE_SOCKET_API = 'wss://chat-out.szjixun.cn' #体制外
|
||||||
|
# EPRAPI baseUrl
|
||||||
|
VITE_EPR_BASEURL = 'https://erpapi-out.szjixun.cn' #体制外
|
||||||
|
# 文档查看器
|
||||||
|
VITE_PAGE_URL = https://chat-pc-out.szjixun.cn #体制外
|
@ -6,8 +6,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:test": "vite --mode test --port 5273",
|
"dev:test": "vite --mode test --port 5273",
|
||||||
"dev:prod": "vite --mode prod --port 5273",
|
"dev:prod": "vite --mode prod --port 5273",
|
||||||
|
"dev:prod:out": "vite --mode prodOut --port 5273",
|
||||||
"build:test": "vite build --mode test",
|
"build:test": "vite build --mode test",
|
||||||
"build:prod": "vite build --mode test",
|
"build:prod": "vite build --mode prod",
|
||||||
|
"build:prod:out": "vite build --mode prodOut",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
|
@ -296,7 +296,7 @@ import fileType_EXCEL from '@/assets/image/excel-text.png'
|
|||||||
import fileType_WORD from '@/assets/image/word-text.png'
|
import fileType_WORD from '@/assets/image/word-text.png'
|
||||||
import fileType_PDF from '@/assets/image/pdf-text.png'
|
import fileType_PDF from '@/assets/image/pdf-text.png'
|
||||||
import fileType_Files from '@/assets/image/file-text.png'
|
import fileType_Files from '@/assets/image/file-text.png'
|
||||||
import { useDialogueStore } from '@/store'
|
import { useDialogueStore, useUserStore } from '@/store'
|
||||||
import { onMounted, reactive, computed, ref, nextTick, watch } from 'vue'
|
import { onMounted, reactive, computed, ref, nextTick, watch } from 'vue'
|
||||||
import searchItem from './searchItem.vue'
|
import searchItem from './searchItem.vue'
|
||||||
import { ServeFindTalkRecords } from '@/api/chat.js'
|
import { ServeFindTalkRecords } from '@/api/chat.js'
|
||||||
@ -315,10 +315,12 @@ const emits = defineEmits([
|
|||||||
])
|
])
|
||||||
|
|
||||||
const dialogueStore = useDialogueStore()
|
const dialogueStore = useDialogueStore()
|
||||||
|
const userStore = useUserStore()
|
||||||
// 当前对话参数
|
// 当前对话参数
|
||||||
const dialogueParams = reactive({
|
const dialogueParams = reactive({
|
||||||
talk_type: computed(() => dialogueStore.talk.talk_type),
|
talk_type: computed(() => dialogueStore.talk.talk_type),
|
||||||
receiver_id: computed(() => dialogueStore.talk.receiver_id)
|
receiver_id: computed(() => dialogueStore.talk.receiver_id),
|
||||||
|
uid: computed(() => userStore.uid)
|
||||||
})
|
})
|
||||||
|
|
||||||
let nowDay = new Date().setHours(0, 0, 0, 0)
|
let nowDay = new Date().setHours(0, 0, 0, 0)
|
||||||
@ -739,11 +741,16 @@ const downloadAndOpenFile = (item) => {
|
|||||||
//跳转到对应的记录位置
|
//跳转到对应的记录位置
|
||||||
const toDialogueByMember = async (msgInfo) => {
|
const toDialogueByMember = async (msgInfo) => {
|
||||||
console.error('====跳转到对应的记录位置====', msgInfo)
|
console.error('====跳转到对应的记录位置====', msgInfo)
|
||||||
|
let receiver_id_ = msgInfo.receiver_id
|
||||||
|
//单聊如果receiver_id为当前用户id,则使用user_id
|
||||||
|
if(msgInfo.talk_type === 1 && msgInfo.receiver_id === dialogueParams.uid){
|
||||||
|
receiver_id_ = msgInfo.user_id
|
||||||
|
}
|
||||||
// 根据搜索结果, 指定用于查询指定消息上下文的sequence
|
// 根据搜索结果, 指定用于查询指定消息上下文的sequence
|
||||||
dialogueStore.specifiedMsg = encodeURIComponent(
|
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
talk_type: msgInfo.talk_type,
|
talk_type: msgInfo.talk_type,
|
||||||
receiver_id: msgInfo.receiver_id,
|
receiver_id: receiver_id_,
|
||||||
msg_id: msgInfo.msg_id,
|
msg_id: msgInfo.msg_id,
|
||||||
cursor: msgInfo.sequence - 15 > 0 ? msgInfo.sequence - 15 : 0,
|
cursor: msgInfo.sequence - 15 > 0 ? msgInfo.sequence - 15 : 0,
|
||||||
direction: 'down',
|
direction: 'down',
|
||||||
|
@ -62,10 +62,10 @@ const router = createRouter({
|
|||||||
// 设置中间件,权限验证
|
// 设置中间件,权限验证
|
||||||
router.beforeEach((to) => {
|
router.beforeEach((to) => {
|
||||||
if (to.meta?.auth && !isLoggedIn()) {
|
if (to.meta?.auth && !isLoggedIn()) {
|
||||||
return {
|
// return {
|
||||||
path: '/auth/login',
|
// path: '/auth/login',
|
||||||
query: { redirect: to.fullPath }
|
// query: { redirect: to.fullPath }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export function isLoggedIn() {
|
|||||||
*/
|
*/
|
||||||
export function getAccessToken() {
|
export function getAccessToken() {
|
||||||
// return storage.get(AccessToken) || ''
|
// return storage.get(AccessToken) || ''
|
||||||
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d220365eb2ca93ef31880576e2aa3ca8c45a705b447d40e300a54644829e2da528ea463bd2581a396336ed74880960d35716f5f7594e5b8cbb597027c6133b97b12df23427ca728fd2625977a0658ab470d'
|
return JSON.parse(localStorage.getItem('token'))||''
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,7 @@ service.interceptors.response.use(
|
|||||||
if (response && response.data.status === 409) {
|
if (response && response.data.status === 409) {
|
||||||
// 账户另一处登录 此处踢下线
|
// 账户另一处登录 此处踢下线
|
||||||
message.error('您的账号已在其他设备登录')
|
message.error('您的账号已在其他设备登录')
|
||||||
$router.push("/login");
|
// $router.push("/login");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (response && response.data.code === 401) {
|
if (response && response.data.code === 401) {
|
||||||
@ -88,7 +88,7 @@ const getRefreshToken = async (response) => {
|
|||||||
return Promise.resolve(service(response.config));
|
return Promise.resolve(service(response.config));
|
||||||
} else {
|
} else {
|
||||||
// 跳转登录页
|
// 跳转登录页
|
||||||
$router.push("/login");
|
// $router.push("/login");
|
||||||
res.message = res.message || res.msg;
|
res.message = res.message || res.msg;
|
||||||
return Promise.reject(res);
|
return Promise.reject(res);
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ const getRefreshToken = async (response) => {
|
|||||||
refreshSubscribers = [];
|
refreshSubscribers = [];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$router.push("/login");
|
// $router.push("/login");
|
||||||
return Promise.reject(response);
|
return Promise.reject(response);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
nextTick
|
nextTick
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import { onBeforeRouteUpdate } from 'vue-router'
|
import { onBeforeRouteUpdate } from 'vue-router'
|
||||||
import { useDialogueStore, useTalkStore } from '@/store'
|
import { useDialogueStore, useTalkStore, useUserStore } from '@/store'
|
||||||
import {
|
import {
|
||||||
NDropdown,
|
NDropdown,
|
||||||
NIcon,
|
NIcon,
|
||||||
@ -62,6 +62,10 @@ const {
|
|||||||
|
|
||||||
const dialogueStore = useDialogueStore()
|
const dialogueStore = useDialogueStore()
|
||||||
const talkStore = useTalkStore()
|
const talkStore = useTalkStore()
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const userParams = reactive({
|
||||||
|
uid: computed(() => userStore.uid)
|
||||||
|
})
|
||||||
const isShowGroup = ref(false)
|
const isShowGroup = ref(false)
|
||||||
const searchKeyword = ref('')
|
const searchKeyword = ref('')
|
||||||
const topItems = computed((): ISession[] => talkStore.topItems)
|
const topItems = computed((): ISession[] => talkStore.topItems)
|
||||||
@ -973,11 +977,16 @@ const handleClickSearchItem = (searchText, searchResultKey, talk_type, receiver_
|
|||||||
const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
||||||
const result = JSON.parse(decodeURIComponent(res))
|
const result = JSON.parse(decodeURIComponent(res))
|
||||||
console.error(result, 'result')
|
console.error(result, 'result')
|
||||||
|
let receiver_id_ = receiver_id
|
||||||
|
//单聊如果receiver_id为当前用户id,则使用user_id
|
||||||
|
if(talk_type === 1 && receiver_id === userParams.uid){
|
||||||
|
receiver_id_ = result.user_id
|
||||||
|
}
|
||||||
// 根据搜索结果, 指定用于查询指定消息上下文的sequence
|
// 根据搜索结果, 指定用于查询指定消息上下文的sequence
|
||||||
dialogueStore.specifiedMsg = encodeURIComponent(
|
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
talk_type,
|
talk_type,
|
||||||
receiver_id,
|
receiver_id: receiver_id_,
|
||||||
msg_id: result.msg_id,
|
msg_id: result.msg_id,
|
||||||
cursor: result.sequence - 15 > 0 ? result.sequence - 15 : 0,
|
cursor: result.sequence - 15 > 0 ? result.sequence - 15 : 0,
|
||||||
direction: 'down',
|
direction: 'down',
|
||||||
@ -986,7 +995,7 @@ const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, rec
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
console.error(dialogueStore.specifiedMsg, 'dialogueStore.specifiedMsg')
|
console.error(dialogueStore.specifiedMsg, 'dialogueStore.specifiedMsg')
|
||||||
talkStore.toTalk(talk_type, receiver_id, router)
|
talkStore.toTalk(talk_type, receiver_id_, router)
|
||||||
state.isShowSearchRecordModal = false
|
state.isShowSearchRecordModal = false
|
||||||
state.searchRecordText = ''
|
state.searchRecordText = ''
|
||||||
searchKeyword.value = ''
|
searchKeyword.value = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user