mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
no message
This commit is contained in:
parent
fba98db7cb
commit
2c407bea78
@ -3,7 +3,7 @@
|
|||||||
if (!function_exists('asset_main')) {
|
if (!function_exists('asset_main')) {
|
||||||
function asset_main($path, $secure = null)
|
function asset_main($path, $secure = null)
|
||||||
{
|
{
|
||||||
return preg_replace("/^https*:\/\//", "//", app('url')->asset($path, $secure));
|
return preg_replace("/^https?:\/\//", "//", app('url')->asset($path, $secure));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ class ProjectTaskContent extends AbstractModel
|
|||||||
$oldContent = $content;
|
$oldContent = $content;
|
||||||
$path = 'uploads/task/content/' . date("Ym") . '/' . $task_id . '/';
|
$path = 'uploads/task/content/' . date("Ym") . '/' . $task_id . '/';
|
||||||
//
|
//
|
||||||
preg_match_all("/<img\s+src=\"data:image\/(png|jpg|jpeg|webp);base64,(.*?)\"/s", $content, $matchs);
|
preg_match_all('/<img[^>]*?src=\\\\?["\']data:image\/(png|jpg|jpeg|webp);base64,(.*?)\\\\?["\']/s', $content, $matchs);
|
||||||
foreach ($matchs[2] as $key => $text) {
|
foreach ($matchs[2] as $key => $text) {
|
||||||
$tmpPath = $path . 'attached/';
|
$tmpPath = $path . 'attached/';
|
||||||
Base::makeDir(public_path($tmpPath));
|
Base::makeDir(public_path($tmpPath));
|
||||||
@ -84,7 +84,7 @@ class ProjectTaskContent extends AbstractModel
|
|||||||
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
|
$content = str_replace($matchs[0][$key], '<img src="{{RemoteURL}}' . $tmpPath . '" original-width="' . $paramet[0] . '" original-height="' . $paramet[1] . '"', $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pattern = '/(<img[^>]*?src=["\'])(https?:\/\/[^\/]+)(\/uploads\/task\/content\/[^\s"\'>]+)(["\'][^>]*?>)/i';
|
$pattern = '/(<img[^>]*?src=\\\\?["\'])(https?:\/\/[^\/]+\/)(uploads\/task\/content\/[^\s"\'>]+)(\\\\?["\'][^>]*?>)/i';
|
||||||
$replacement = '$1{{RemoteURL}}$3$4';
|
$replacement = '$1{{RemoteURL}}$3$4';
|
||||||
$content = preg_replace($pattern, $replacement, $content);
|
$content = preg_replace($pattern, $replacement, $content);
|
||||||
//
|
//
|
||||||
|
|||||||
@ -918,7 +918,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$text = str_replace($str, "[:LINK:{$herf}:{$title}:]", $text);
|
$text = str_replace($str, "[:LINK:{$herf}:{$title}:]", $text);
|
||||||
}
|
}
|
||||||
// 文件分享链接
|
// 文件分享链接
|
||||||
preg_match_all("/(https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+)/i", $text, $matchs);
|
preg_match_all("/(https?:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+)/i", $text, $matchs);
|
||||||
if ($matchs) {
|
if ($matchs) {
|
||||||
foreach ($matchs[0] as $str) {
|
foreach ($matchs[0] as $str) {
|
||||||
preg_match("/\/single\/file\/(.*?)$/i", $str, $match);
|
preg_match("/\/single\/file\/(.*?)$/i", $str, $match);
|
||||||
@ -986,7 +986,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$link = 0;
|
$link = 0;
|
||||||
$mtype = $type;
|
$mtype = $type;
|
||||||
if ($type === 'text') {
|
if ($type === 'text') {
|
||||||
if (str_contains($msg['text'], '<a ') || preg_match("/https*:\/\//", $msg['text'])) {
|
if (str_contains($msg['text'], '<a ') || preg_match("/https?:\/\//", $msg['text'])) {
|
||||||
$link = 1;
|
$link = 1;
|
||||||
}
|
}
|
||||||
if (str_contains($msg['text'], '<img ')) {
|
if (str_contains($msg['text'], '<img ')) {
|
||||||
@ -1004,7 +1004,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$mtype = 'image';
|
$mtype = 'image';
|
||||||
}
|
}
|
||||||
} elseif ($type === 'location') {
|
} elseif ($type === 'location') {
|
||||||
if (preg_match('/^https*:\/\//', $msg['thumb'])) {
|
if (preg_match('/^https?:\/\//', $msg['thumb'])) {
|
||||||
$thumb = file_get_contents($msg['thumb']);
|
$thumb = file_get_contents($msg['thumb']);
|
||||||
if (empty($thumb)) {
|
if (empty($thumb)) {
|
||||||
throw new ApiException('获取地图快照失败');
|
throw new ApiException('获取地图快照失败');
|
||||||
|
|||||||
@ -524,7 +524,7 @@ class BotReceiveMsgTask extends AbstractTask
|
|||||||
], $botUser->userid, false, false, true); // todo 未能在任务end事件来发送任务
|
], $botUser->userid, false, false, true); // todo 未能在任务end事件来发送任务
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!preg_match("/^https*:\/\//", $webhookUrl)) {
|
if (!preg_match("/^https?:\/\//", $webhookUrl)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
2
electron/build.js
vendored
2
electron/build.js
vendored
@ -390,7 +390,7 @@ async function published(url) {
|
|||||||
* @param output
|
* @param output
|
||||||
*/
|
*/
|
||||||
function genericPublish({url, key, version, output}) {
|
function genericPublish({url, key, version, output}) {
|
||||||
if (!/https*:\/\//i.test(url)) {
|
if (!/https?:\/\//i.test(url)) {
|
||||||
console.warn("发布地址无效: " + url)
|
console.warn("发布地址无效: " + url)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
1
electron/electron.js
vendored
1
electron/electron.js
vendored
@ -351,6 +351,7 @@ function createChildWindow(args) {
|
|||||||
} else {
|
} else {
|
||||||
// 创建新窗口
|
// 创建新窗口
|
||||||
browser = new BrowserWindow(options)
|
browser = new BrowserWindow(options)
|
||||||
|
console.log("create new window")
|
||||||
}
|
}
|
||||||
|
|
||||||
browser.on('page-title-updated', (event, title) => {
|
browser.on('page-title-updated', (event, title) => {
|
||||||
|
|||||||
@ -154,7 +154,7 @@
|
|||||||
return 'Loading...'
|
return 'Loading...'
|
||||||
}
|
}
|
||||||
if (item.url) {
|
if (item.url) {
|
||||||
return `${item.url}`.replace(/^https*:\/\//, '')
|
return `${item.url}`.replace(/^https?:\/\//, '')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
2
resources/assets/js/app.js
vendored
2
resources/assets/js/app.js
vendored
@ -99,7 +99,7 @@ VueRouter.prototype.push = function push(location) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: isSoftware && !/https*:/i.test(window.location.protocol) ? 'hash' : 'history',
|
mode: isSoftware && !/https?:/i.test(window.location.protocol) ? 'hash' : 'history',
|
||||||
routes
|
routes
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -414,7 +414,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
browseStyle(thumb) {
|
browseStyle(thumb) {
|
||||||
if (!/https*:\/\//.test(thumb) && !/^\//.test(thumb)) {
|
if (!/https?:\/\//.test(thumb) && !/^\//.test(thumb)) {
|
||||||
thumb = $A.mainUrl(thumb);
|
thumb = $A.mainUrl(thumb);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|||||||
4
resources/assets/js/functions/web.js
vendored
4
resources/assets/js/functions/web.js
vendored
@ -328,10 +328,10 @@ import {convertLocalResourcePath} from "../components/Replace/utils";
|
|||||||
text = text.replace(/\{\{RemoteURL\}\}/g, $A.mainUrl())
|
text = text.replace(/\{\{RemoteURL\}\}/g, $A.mainUrl())
|
||||||
text = text.replace(atReg, `<span class="mention me" data-id="${userid}">`)
|
text = text.replace(atReg, `<span class="mention me" data-id="${userid}">`)
|
||||||
// 处理内容连接
|
// 处理内容连接
|
||||||
if (/https*:\/\//.test(text)) {
|
if (/https?:\/\//.test(text)) {
|
||||||
text = text.split(/(<[^>]*>)/g).map(string => {
|
text = text.split(/(<[^>]*>)/g).map(string => {
|
||||||
if (string && !/<[^>]*>/.test(string)) {
|
if (string && !/<[^>]*>/.test(string)) {
|
||||||
string = string.replace(/(^|[^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+))/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>")
|
string = string.replace(/(^|[^'"])((https?:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+))/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>")
|
||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
}).join("")
|
}).join("")
|
||||||
|
|||||||
@ -11,7 +11,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (/^https*:/i.test(window.location.protocol)) {
|
if (/^https?:/i.test(window.location.protocol)) {
|
||||||
let redirect = null
|
let redirect = null
|
||||||
if (this.$router.mode === "hash") {
|
if (this.$router.mode === "hash") {
|
||||||
if ($A.stringLength(window.location.pathname) > 2) {
|
if ($A.stringLength(window.location.pathname) > 2) {
|
||||||
|
|||||||
@ -445,7 +445,7 @@ export default {
|
|||||||
if (!/\/api\/$/.test(url)) {
|
if (!/\/api\/$/.test(url)) {
|
||||||
url = url + ($A.rightExists(url, "/") ? "api/" : "/api/");
|
url = url + ($A.rightExists(url, "/") ? "api/" : "/api/");
|
||||||
}
|
}
|
||||||
if (!/^https*:\/\//i.test(url)) {
|
if (!/^https?:\/\//i.test(url)) {
|
||||||
url = `https://${url}`;
|
url = `https://${url}`;
|
||||||
}
|
}
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
@ -460,7 +460,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(({ret, msg}) => {
|
}).catch(({ret, msg}) => {
|
||||||
if (ret === -1001) {
|
if (ret === -1001) {
|
||||||
if (!/^https*:\/\//i.test(value)) {
|
if (!/^https?:\/\//i.test(value)) {
|
||||||
this.inputServerChack(`http://${value}`).then(resolve).catch(reject);
|
this.inputServerChack(`http://${value}`).then(resolve).catch(reject);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -533,7 +533,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 扫一扫
|
// 扫一扫
|
||||||
scanResult(text) {
|
scanResult(text) {
|
||||||
const arr = (text + "").match(/^https*:\/\/(.*?)\/login\?qrcode=(.*?)$/)
|
const arr = (text + "").match(/^https?:\/\/(.*?)\/login\?qrcode=(.*?)$/)
|
||||||
if (arr) {
|
if (arr) {
|
||||||
// 扫码登录
|
// 扫码登录
|
||||||
if ($A.getDomain(text) != $A.getDomain($A.mainUrl())) {
|
if ($A.getDomain(text) != $A.getDomain($A.mainUrl())) {
|
||||||
@ -551,7 +551,7 @@ export default {
|
|||||||
this.scanLoginShow = true;
|
this.scanLoginShow = true;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (/^https*:\/\//i.test(text)) {
|
if (/^https?:\/\//i.test(text)) {
|
||||||
// 打开链接
|
// 打开链接
|
||||||
this.$store.dispatch('openAppChildPage', {
|
this.$store.dispatch('openAppChildPage', {
|
||||||
pageType: 'app',
|
pageType: 'app',
|
||||||
|
|||||||
4
resources/assets/js/store/actions.js
vendored
4
resources/assets/js/store/actions.js
vendored
@ -120,7 +120,7 @@ export default {
|
|||||||
const cloneParams = $A.cloneJSON(params)
|
const cloneParams = $A.cloneJSON(params)
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
// 判断服务器地址
|
// 判断服务器地址
|
||||||
if (/^https*:\/\/public\//.test(params.url)) {
|
if (/^https?:\/\/public\//.test(params.url)) {
|
||||||
reject({ret: -1, data: {}, msg: "No server address"})
|
reject({ret: -1, data: {}, msg: "No server address"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -3399,7 +3399,7 @@ export default {
|
|||||||
* @param streamUrl
|
* @param streamUrl
|
||||||
*/
|
*/
|
||||||
streamDialogMsg({state, dispatch}, streamUrl) {
|
streamDialogMsg({state, dispatch}, streamUrl) {
|
||||||
if (!/^https*:\/\//i.test(streamUrl)) {
|
if (!/^https?:\/\//i.test(streamUrl)) {
|
||||||
streamUrl = $A.mainUrl(streamUrl.substring(1))
|
streamUrl = $A.mainUrl(streamUrl.substring(1))
|
||||||
}
|
}
|
||||||
if (state.dialogSseList.find(item => item.streamUrl == streamUrl)) {
|
if (state.dialogSseList.find(item => item.streamUrl == streamUrl)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user