修改项目名称为“IM”,更新相关文件中的标题和版权信息,优化文件下载功能,调整部分组件的显示内容。
This commit is contained in:
parent
0fe1119789
commit
46644626e7
@ -1,6 +1,6 @@
|
|||||||
# LumenIM - 在线即时通讯应用
|
# IM - 在线即时通讯应用
|
||||||
|
|
||||||
LumenIM 是一个基于 Vue 3 开发的现代化在线即时通讯应用,提供实时聊天、消息管理、笔记等功能。
|
IM 是一个基于 Vue 3 开发的现代化在线即时通讯应用,提供实时聊天、消息管理、笔记等功能。
|
||||||
|
|
||||||
## 功能特性
|
## 功能特性
|
||||||
|
|
||||||
@ -101,4 +101,4 @@ src/
|
|||||||
|
|
||||||
## 许可证
|
## 许可证
|
||||||
|
|
||||||
Copyright © 2023 LumenIM
|
Copyright © 2023 IM
|
||||||
|
2
env/.env.test
vendored
2
env/.env.test
vendored
@ -5,4 +5,4 @@ VUE_APP_PREVIEW=false
|
|||||||
VITE_BASE_API=http://114.218.158.24:8503
|
VITE_BASE_API=http://114.218.158.24:8503
|
||||||
VITE_EPR_BASEURL=http://114.218.158.24:9020
|
VITE_EPR_BASEURL=http://114.218.158.24:9020
|
||||||
VITE_SOCKET_API=ws://114.218.158.24:8504
|
VITE_SOCKET_API=ws://114.218.158.24:8504
|
||||||
VUE_APP_WEBSITE_NAME="Lumen IM"
|
VUE_APP_WEBSITE_NAME=""
|
@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="./src/assets/image/favicon.png" />
|
<link rel="icon" href="./src/assets/image/favicon.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Lumen IM 在线聊天</title>
|
<title> 在线聊天</title>
|
||||||
<style>
|
<style>
|
||||||
.outer,
|
.outer,
|
||||||
.middle,
|
.middle,
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "LumenIM",
|
"name": "IM",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "LumenIM",
|
"name": "IM",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@highlightjs/vue-plugin": "^2.1.0",
|
"@highlightjs/vue-plugin": "^2.1.0",
|
||||||
|
18
package.json
18
package.json
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "LumenIM",
|
"name": "IM",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -71,15 +71,15 @@
|
|||||||
"wait-on": "^6.0.1"
|
"wait-on": "^6.0.1"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.gzydong.lumenim",
|
"appId": "com.gzydong.im",
|
||||||
"productName": "LumenIM",
|
"productName": "IM",
|
||||||
"copyright": "Copyright © 2023 LumenIM",
|
"copyright": "Copyright © 2023 IM",
|
||||||
"mac": {
|
"mac": {
|
||||||
"category": "public.app-category.utilities",
|
"category": "public.app-category.utilities",
|
||||||
"icon": "build/icons/lumen-im-mac.png"
|
"icon": "build/icons/-im-mac.png"
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "build/icons/lumen-im-mac.png",
|
"icon": "build/icons/-im-mac.png",
|
||||||
"target": [
|
"target": [
|
||||||
{
|
{
|
||||||
"target": "nsis"
|
"target": "nsis"
|
||||||
@ -89,9 +89,9 @@
|
|||||||
"nsis": {
|
"nsis": {
|
||||||
"oneClick": false,
|
"oneClick": false,
|
||||||
"allowToChangeInstallationDirectory": true,
|
"allowToChangeInstallationDirectory": true,
|
||||||
"installerIcon": "build/icons/lumen-im-win.ico",
|
"installerIcon": "build/icons/-im-win.ico",
|
||||||
"uninstallerIcon": "build/icons/lumen-im-win.ico",
|
"uninstallerIcon": "build/icons/-im-win.ico",
|
||||||
"installerHeaderIcon": "build/icons/lumen-im-win.ico",
|
"installerHeaderIcon": "build/icons/-im-win.ico",
|
||||||
"createDesktopShortcut": true,
|
"createDesktopShortcut": true,
|
||||||
"createStartMenuShortcut": true,
|
"createStartMenuShortcut": true,
|
||||||
"shortcutName": "lumeim-icon"
|
"shortcutName": "lumeim-icon"
|
||||||
|
@ -93,10 +93,46 @@ const handleClick = () => {
|
|||||||
'width=1200,height=900,left=200,top=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no'
|
'width=1200,height=900,left=200,top=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 触发浏览器下载文件,通常会显示下载进度。
|
||||||
|
* @param {string} resourceUrl 文件的URL地址。
|
||||||
|
* @param {string} [filename] 可选参数,指定下载文件的名称。如果未提供,浏览器会尝试从URL或响应头中推断。
|
||||||
|
*/
|
||||||
|
function downloadFileWithProgress(resourceUrl, filename) {
|
||||||
|
// 1. 创建一个 <a> 元素
|
||||||
|
const link = document.createElement('a');
|
||||||
|
|
||||||
|
// 2. 设置 href 属性为资源 URL
|
||||||
|
link.href = resourceUrl;
|
||||||
|
|
||||||
|
// 3. 设置 download 属性
|
||||||
|
// 如果提供了 filename,则使用它;否则,让浏览器自行决定文件名。
|
||||||
|
// 设置 download 属性会提示浏览器下载链接指向的资源,而不是导航到它。
|
||||||
|
if (filename) {
|
||||||
|
link.download = filename;
|
||||||
|
} else {
|
||||||
|
// 你也可以选择不设置 download,或者尝试从 resourceUrl 中提取文件名
|
||||||
|
// 例如: link.download = resourceUrl.substring(resourceUrl.lastIndexOf('/') + 1);
|
||||||
|
// 但最可靠的方式是服务器在 Content-Disposition 响应头中指定文件名
|
||||||
|
link.download = ''; // 设置为空字符串也通常会触发下载行为
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 将 <a> 元素添加到文档中(某些浏览器需要这样才能触发点击)
|
||||||
|
document.body.appendChild(link);
|
||||||
|
|
||||||
|
// 5. 编程方式点击链接以开始下载
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// 6. 从文档中移除 <a> 元素(完成任务后清理)
|
||||||
|
document.body.removeChild(link);
|
||||||
|
|
||||||
|
console.log(`已为 "${resourceUrl}" 发起下载请求。`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 处理下载事件
|
// 处理下载事件
|
||||||
const handleDownload = () => {
|
const handleDownload = () => {
|
||||||
download(props.data.msg_id)
|
downloadFileWithProgress(props.extra.path,props.extra.name)
|
||||||
// const url = props.extra.path;
|
// const url = props.extra.path;
|
||||||
// if (!url) return;
|
// if (!url) return;
|
||||||
// const a = document.createElement('a');
|
// const a = document.createElement('a');
|
||||||
@ -162,7 +198,7 @@ const handleDownload = () => {
|
|||||||
<!-- 文件大小信息 -->
|
<!-- 文件大小信息 -->
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div class="file-size">{{ fileFormatSize(extra.size) }}</div>
|
<div class="file-size">{{ fileFormatSize(extra.size) }}</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center" v-if="!extra.is_uploading">
|
||||||
<div class="flex items-center" @click.stop="handleDownload"> <img class="w-11.7px h-11.74px mr-7px" src="@/assets/image/dofd.png" alt=""> <span class="text-12px text-#46299D">下载</span></div>
|
<div class="flex items-center" @click.stop="handleDownload"> <img class="w-11.7px h-11.74px mr-7px" src="@/assets/image/dofd.png" alt=""> <span class="text-12px text-#46299D">下载</span></div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class Talk extends Base {
|
|||||||
*/
|
*/
|
||||||
showMessageNocice() {
|
showMessageNocice() {
|
||||||
if (useSettingsStore().isLeaveWeb) {
|
if (useSettingsStore().isLeaveWeb) {
|
||||||
const notification = new Notification('LumenIM 在线聊天', {
|
const notification = new Notification('IM 在线聊天', {
|
||||||
dir: 'auto',
|
dir: 'auto',
|
||||||
lang: 'zh-CN',
|
lang: 'zh-CN',
|
||||||
body: '您有新的消息请注意查收'
|
body: '您有新的消息请注意查收'
|
||||||
|
@ -131,7 +131,7 @@ const isActive = (menu) => {
|
|||||||
|
|
||||||
<footer class="menu-footer">
|
<footer class="menu-footer">
|
||||||
<div>
|
<div>
|
||||||
<a class="pointer" href="https://github.com/gzydong/LumenIM" target="_blank">
|
<a class="pointer" href="https://github.com/gzydong/IM" target="_blank">
|
||||||
<github-one theme="outline" size="22" :fill="color" :strokeWidth="2" />
|
<github-one theme="outline" size="22" :fill="color" :strokeWidth="2" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d22201760cb2a37a6703ccf06c9d5a5752e0c3798b552c606065aa0079caa2737c431030be4871e931d3dcb27c239d70b4ba5f2e533a36a0b9b784388409ccd3ad8c62c1de535f4fd865b4f3bf37d260ccc'
|
return JSON.parse(localStorage.getItem('token'))||'79b5c732d96d2b27a48a99dfd4a5566c43aaa5796242e854ebe3ffc198d6876b9628e7b764d9af65ab5dbb2d517ced88170491b74b048c0ba827c0d3741462cb89dc59ed46653a449af837a8262941caaef1334d640773710f8cd96473bacfb190cba595a5d6a9c87d70f0999a3ebb41147213b31b4bdccffca66a56acf3baab5af0154f0dce360079f37709f78e13711036899344bddb0fb4cf0f2890287cb62c3fcbe33368caa5e213624577be8b8420ab75b1f50775ee16142a4321c5d56995f37354a66a969da98d95ba6e65d142ed097e04b411c1ebad2f62866d0ec7e1838420530a9941dbbcd00490199f8b89eb1ea28c6224649ca60080b7243593f7462085111e3bd3868564aa9a65a16e171ba833d4955a4555f3376cb64b66eb2304dafb03f182fe1719d09e84d345954edbf75b17358196e1378893c8c97b56a6'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,14 +3,14 @@ import { isElectronMode } from '@/utils/common'
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="logo-name" v-if="!isElectronMode()">Lumen IM</div>
|
<div id="logo-name" v-if="!isElectronMode()"></div>
|
||||||
|
|
||||||
<section class="section">
|
<section class="section">
|
||||||
<router-view />
|
<router-view />
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
<span>©2020 - 2023 Lumen IM 在线聊天</span>
|
<span>©2020 - 2023 在线聊天</span>
|
||||||
<span><a href="http://beian.miit.gov.cn" target="_blank">黔ICP备20006767号-2</a></span>
|
<span><a href="http://beian.miit.gov.cn" target="_blank">黔ICP备20006767号-2</a></span>
|
||||||
<span>Github源码</span>
|
<span>Github源码</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="amicable flex-center">
|
<div class="amicable flex-center">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<img src="@/assets/image/welcome.svg" alt="" />
|
<img src="@/assets/image/welcome.svg" alt="" />
|
||||||
<p>LumenIM 欢迎您 (*^__^*)</p>
|
<p>IM 欢迎您 (*^__^*)</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -10,9 +10,11 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
import { DocumentEditor } from "@onlyoffice/document-editor-vue"
|
import { DocumentEditor } from "@onlyoffice/document-editor-vue"
|
||||||
|
|
||||||
const documentServerUrl = 'https://onlyoffice.fontree.cn'
|
const documentServerUrl = 'https://onlyoffice.fontree.cn'
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 动态插入 Content-Security-Policy meta 标签,只在本页面生效
|
// 动态插入 Content-Security-Policy meta 标签,只在本页面生效
|
||||||
@ -24,14 +26,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取 URL 参数
|
|
||||||
function getUrlParameter(name) {
|
|
||||||
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
|
|
||||||
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)')
|
|
||||||
const results = regex.exec(window.location.search)
|
|
||||||
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断文件类型
|
// 判断文件类型
|
||||||
function getDocumentTypes(url) {
|
function getDocumentTypes(url) {
|
||||||
const extension = url.split('.').pop().toLowerCase()
|
const extension = url.split('.').pop().toLowerCase()
|
||||||
@ -47,7 +41,7 @@ function getDocumentTypes(url) {
|
|||||||
return types[extension] || { fileType: 'docx', documentType: 'word' }
|
return types[extension] || { fileType: 'docx', documentType: 'word' }
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = getUrlParameter('url')
|
const url = route.query.url
|
||||||
if (!url) {
|
if (!url) {
|
||||||
alert('请提供文档 URL 参数')
|
alert('请提供文档 URL 参数')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user