mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
no message
This commit is contained in:
parent
2a864b6617
commit
e8839974d4
12
resources/assets/js/app.js
vendored
12
resources/assets/js/app.js
vendored
@ -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(() => {
|
||||
|
||||
14
resources/assets/js/functions/web.js
vendored
14
resources/assets/js/functions/web.js
vendored
@ -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("")
|
||||
}
|
||||
|
||||
@ -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: '',
|
||||
label: '复制链接',
|
||||
value: href,
|
||||
value: event.target.href,
|
||||
})
|
||||
}
|
||||
if (msgData.type === 'text') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user