no message

This commit is contained in:
kuaifan 2024-01-03 19:23:18 +08:00
parent 2a864b6617
commit e8839974d4
3 changed files with 2 additions and 35 deletions

View File

@ -91,18 +91,6 @@ if (!isElectron && !isEEUiApp) {
ViewUI.LoadingBar._load = true;
ViewUI.LoadingBar.start();
}, 300)
//
if (to.query?.theme) {
store.dispatch("setTheme", typeof to.query?.theme == 'string' ? to.query?.theme : to.query?.theme[0])
}
if (to.query?.lang) {
let lang = typeof to.query?.lang == 'string' ? to.query?.lang : to.query?.lang[0]
if(lang && lang != getLanguage()){
setLanguage(lang, true)
return;
}
}
//
next();
});
router.afterEach(() => {

View File

@ -752,24 +752,10 @@ import {MarkdownPreview} from "../store/markdown";
text = text.replace(atReg, `<span class="mention me" data-id="${userid}">`)
// 处理内容连接
if (/https*:\/\//.test(text)) {
const urlMatch = $.apiUrl('../').match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im);
const isMentionFile = text.indexOf('class="mention file"') !== -1 && ($A.isEEUiApp || $A.isElectron)
const theme = isMentionFile ? $A.dark.isDarkEnabled() ? 'dark' : 'light' : '';
const lang = isMentionFile ? window.localStorage.getItem("__language:type__") : ''
text = text.split(/(<[^>]*>)/g).map(string => {
if (string && !/<[^>]*>/.test(string)) {
string = string.replace(/(^|[^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+))/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>")
}
//
const href = string.match(/href="([^"]+)"/)?.[1] || ''
if (urlMatch?.[1] && href.indexOf(urlMatch[1]) !== -1) {
const searchParams = new URLSearchParams()
theme && href.indexOf("theme=") === -1 && searchParams.append('theme', theme);
lang && href.indexOf("lang=") === -1 && searchParams.append('lang', lang);
const prefix = searchParams.toString() ? (href.indexOf("?") === -1 ? '?' : '&') : '';
string = string.replace(/(href="[^"]*)/g, '$1' + prefix + searchParams.toString())
}
//
return string;
}).join("")
}

View File

@ -2569,21 +2569,14 @@ export default {
value: $A.thumbRestore(event.target.currentSrc),
})
} else if (event.target.nodeName === 'A') {
let href = event.target.href;
if (event.target.classList.contains("mention") && event.target.classList.contains("file")) {
if(this.isEEUiApp || this.$Electron){
const url = new URL(href);
const params = new URLSearchParams(url.search);
params.delete('theme'); params.delete('lang');
href = url.origin + url.pathname + (params.toString() ? ('?' + params.toString()) : '');
}
this.findOperateFile(this.operateItem.id, href)
this.findOperateFile(this.operateItem.id, event.target.href)
}
this.operateCopys.push({
type: 'link',
icon: '&#xe7cb;',
label: '复制链接',
value: href,
value: event.target.href,
})
}
if (msgData.type === 'text') {