Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
4cbad14c98 | |||
6c6bcb7dce | |||
7d3d47a63c | |||
c00d5da7d7 | |||
32aa5f7d81 | |||
78009bc5e7 | |||
451974a84f |
13
env/.env.prod
vendored
13
env/.env.prod
vendored
@ -3,5 +3,14 @@ ENV = 'production'
|
||||
|
||||
VITE_BASE=/
|
||||
VITE_ROUTER_MODE=history
|
||||
VITE_BASE_API=https://xxxx.xxx.com
|
||||
VITE_SOCKET_API=wss://xxxx.xxxx.com
|
||||
VUE_APP_PREVIEW=false
|
||||
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": {
|
||||
"dev:test": "vite --mode test --port 5273",
|
||||
"dev:prod": "vite --mode prod --port 5273",
|
||||
"dev:prod:out": "vite --mode prodOut --port 5273",
|
||||
"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",
|
||||
"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",
|
||||
|
@ -296,7 +296,7 @@ import fileType_EXCEL from '@/assets/image/excel-text.png'
|
||||
import fileType_WORD from '@/assets/image/word-text.png'
|
||||
import fileType_PDF from '@/assets/image/pdf-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 searchItem from './searchItem.vue'
|
||||
import { ServeFindTalkRecords } from '@/api/chat.js'
|
||||
@ -315,10 +315,12 @@ const emits = defineEmits([
|
||||
])
|
||||
|
||||
const dialogueStore = useDialogueStore()
|
||||
const userStore = useUserStore()
|
||||
// 当前对话参数
|
||||
const dialogueParams = reactive({
|
||||
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)
|
||||
@ -739,11 +741,16 @@ const downloadAndOpenFile = (item) => {
|
||||
//跳转到对应的记录位置
|
||||
const toDialogueByMember = async (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
|
||||
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||
JSON.stringify({
|
||||
talk_type: msgInfo.talk_type,
|
||||
receiver_id: msgInfo.receiver_id,
|
||||
receiver_id: receiver_id_,
|
||||
msg_id: msgInfo.msg_id,
|
||||
cursor: msgInfo.sequence - 15 > 0 ? msgInfo.sequence - 15 : 0,
|
||||
direction: 'down',
|
||||
|
@ -280,7 +280,8 @@ class Talk extends Base {
|
||||
useTalkStore().updateMessage({
|
||||
index_name: this.getIndexName(),
|
||||
msg_text: this.getTalkText(),
|
||||
updated_at: parseTime(new Date())
|
||||
updated_at: parseTime(new Date()),
|
||||
isCurrSender: this.isCurrSender()
|
||||
})
|
||||
//收到新消息时,同时判断是否有人@我
|
||||
if (this.resource.msg_type === 1 && this.resource?.extra?.mentions?.length > 0) {
|
||||
|
@ -62,10 +62,10 @@ const router = createRouter({
|
||||
// 设置中间件,权限验证
|
||||
router.beforeEach((to) => {
|
||||
if (to.meta?.auth && !isLoggedIn()) {
|
||||
return {
|
||||
path: '/auth/login',
|
||||
query: { redirect: to.fullPath }
|
||||
}
|
||||
// return {
|
||||
// path: '/auth/login',
|
||||
// query: { redirect: to.fullPath }
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -103,7 +103,10 @@ export const useTalkStore = defineStore('talk', {
|
||||
const item = this.items.find((item) => item.index_name === params.index_name)
|
||||
|
||||
if (item) {
|
||||
item.unread_num++
|
||||
if (!params?.isCurrSender) {
|
||||
//如果消息不是自己发的,才更新未读数量
|
||||
item.unread_num++
|
||||
}
|
||||
item.msg_text = params.msg_text
|
||||
item.updated_at = params.updated_at
|
||||
|
||||
|
@ -18,7 +18,7 @@ export function isLoggedIn() {
|
||||
*/
|
||||
export function getAccessToken() {
|
||||
// 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) {
|
||||
// 账户另一处登录 此处踢下线
|
||||
message.error('您的账号已在其他设备登录')
|
||||
$router.push("/login");
|
||||
// $router.push("/login");
|
||||
return;
|
||||
}
|
||||
if (response && response.data.code === 401) {
|
||||
@ -88,7 +88,7 @@ const getRefreshToken = async (response) => {
|
||||
return Promise.resolve(service(response.config));
|
||||
} else {
|
||||
// 跳转登录页
|
||||
$router.push("/login");
|
||||
// $router.push("/login");
|
||||
res.message = res.message || res.msg;
|
||||
return Promise.reject(res);
|
||||
}
|
||||
@ -100,7 +100,7 @@ const getRefreshToken = async (response) => {
|
||||
refreshSubscribers = [];
|
||||
}
|
||||
} else {
|
||||
$router.push("/login");
|
||||
// $router.push("/login");
|
||||
return Promise.reject(response);
|
||||
}
|
||||
} else {
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
nextTick
|
||||
} from 'vue'
|
||||
import { onBeforeRouteUpdate } from 'vue-router'
|
||||
import { useDialogueStore, useTalkStore } from '@/store'
|
||||
import { useDialogueStore, useTalkStore, useUserStore } from '@/store'
|
||||
import {
|
||||
NDropdown,
|
||||
NIcon,
|
||||
@ -62,6 +62,10 @@ const {
|
||||
|
||||
const dialogueStore = useDialogueStore()
|
||||
const talkStore = useTalkStore()
|
||||
const userStore = useUserStore()
|
||||
const userParams = reactive({
|
||||
uid: computed(() => userStore.uid)
|
||||
})
|
||||
const isShowGroup = ref(false)
|
||||
const searchKeyword = ref('')
|
||||
const topItems = computed((): ISession[] => talkStore.topItems)
|
||||
@ -602,6 +606,11 @@ const onTabTalk = (item: ISession, follow = false) => {
|
||||
console.log('item.index_name === indexName.value', item.index_name === indexName.value)
|
||||
if (item.index_name === indexName.value) return
|
||||
|
||||
if (dialogueStore.isOpenMultiSelect) {
|
||||
//切换会话时,如果多选模式开启,则关闭多选模式
|
||||
dialogueStore.closeMultiSelect()
|
||||
}
|
||||
|
||||
searchKeyword.value = ''
|
||||
|
||||
dialogueStore.isManualSwitch = true
|
||||
@ -968,11 +977,16 @@ const handleClickSearchItem = (searchText, searchResultKey, talk_type, receiver_
|
||||
const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, receiver_id, res) => {
|
||||
const result = JSON.parse(decodeURIComponent(res))
|
||||
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
|
||||
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||
JSON.stringify({
|
||||
talk_type,
|
||||
receiver_id,
|
||||
receiver_id: receiver_id_,
|
||||
msg_id: result.msg_id,
|
||||
cursor: result.sequence - 15 > 0 ? result.sequence - 15 : 0,
|
||||
direction: 'down',
|
||||
@ -981,7 +995,7 @@ const handleClickSearchResultItem = (searchText, searchResultKey, talk_type, rec
|
||||
})
|
||||
)
|
||||
console.error(dialogueStore.specifiedMsg, 'dialogueStore.specifiedMsg')
|
||||
talkStore.toTalk(talk_type, receiver_id, router)
|
||||
talkStore.toTalk(talk_type, receiver_id_, router)
|
||||
state.isShowSearchRecordModal = false
|
||||
state.searchRecordText = ''
|
||||
searchKeyword.value = ''
|
||||
|
Loading…
Reference in New Issue
Block a user