no message

This commit is contained in:
kuaifan 2025-04-17 10:09:28 +08:00
parent ab616c5d32
commit 7ab94205e4
2 changed files with 64 additions and 28 deletions

View File

@ -232,6 +232,23 @@ services:
ipv4_address: "${APP_IPPR}.15" ipv4_address: "${APP_IPPR}.15"
restart: unless-stopped restart: unless-stopped
search:
container_name: "dootask-search-${APP_ID}"
image: "public.ecr.aws/zinclabs/zincsearch:0.4.10"
ports:
- "4080:4080"
- "4081:4081"
volumes:
- ./docker/search/zincsearch:/data
environment:
ZINC_DATA_PATH: "/data"
ZINC_FIRST_ADMIN_USER: "${DB_USERNAME}"
ZINC_FIRST_ADMIN_PASSWORD: "${DB_PASSWORD}"
networks:
extnetwork:
ipv4_address: "${APP_IPPR}.16"
restart: unless-stopped
networks: networks:
extnetwork: extnetwork:
name: "dootask-networks-${APP_ID}" name: "dootask-networks-${APP_ID}"

View File

@ -580,19 +580,21 @@ const timezone = require("dayjs/plugin/timezone");
* @returns {*} * @returns {*}
*/ */
urlParameter(key) { urlParameter(key) {
let params = this.urlParameterAll(); const params = this.urlParameterAll();
return typeof key === "undefined" ? params : params[key]; return typeof key === "undefined" ? params : params[key];
}, },
/**
* 获取所有url参数
* @returns {{}}
*/
urlParameterAll() { urlParameterAll() {
let search = window.location.search || window.location.hash || ""; const search = window.location.search || window.location.hash || "";
let arr = []; const index = search.indexOf("?");
if (this.strExists(search, "?")) { const arr = index !== -1 ? search.substring(index + 1).split("&") : [];
arr = this.getMiddle(search, "?").split("&"); const params = {};
}
let params = {};
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
let data = arr[i].split("="); const data = arr[i].split("=");
if (data.length === 2) { if (data.length === 2) {
params[data[0]] = data[1]; params[data[0]] = data[1];
} }
@ -603,33 +605,36 @@ const timezone = require("dayjs/plugin/timezone");
/** /**
* 删除地址中的参数 * 删除地址中的参数
* @param url * @param url
* @param parameter * @param keys
* @returns {string|*} * @returns {string|*}
*/ */
removeURLParameter(url, parameter) { removeURLParameter(url, keys) {
if (parameter instanceof Array) { if (keys instanceof Array) {
parameter.forEach((key) => { keys.forEach((key) => {
url = $A.removeURLParameter(url, key) url = $A.removeURLParameter(url, key)
}); });
return url; return url;
} }
let urlparts = url.split('?'); try {
if (urlparts.length >= 2) { // 使用URL API正确解析URL各部分
//参数名前缀 const urlObj = new URL(url);
let prefix = encodeURIComponent(parameter) + '='; urlObj.searchParams.delete(keys);
let pars = urlparts[1].split(/[&;]/g); return urlObj.toString();
} catch (e) {
//循环查找匹配参数 // 如果URL解析失败回退到简单的字符串处理方法
for (let i = pars.length; i-- > 0;) { const urlparts = url.split('?');
if (pars[i].lastIndexOf(prefix, 0) !== -1) { if (urlparts.length >= 2) {
//存在则删除 const prefix = encodeURIComponent(keys) + '=';
pars.splice(i, 1); const pars = urlparts[1].split(/[&;]/g);
for (let i = pars.length; i-- > 0;) {
if (pars[i].lastIndexOf(prefix, 0) !== -1) {
pars.splice(i, 1);
}
} }
return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
} }
return url;
return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
} }
return url;
}, },
/** /**
@ -639,7 +644,21 @@ const timezone = require("dayjs/plugin/timezone");
* @returns {*} * @returns {*}
*/ */
urlAddParams(url, params) { urlAddParams(url, params) {
if ($A.isJson(params)) { if (!$A.isJson(params)) {
return url;
}
try {
// 使用URL API正确解析URL各部分
const urlObj = new URL(url);
for (let key in params) {
if (!params.hasOwnProperty(key)) {
continue;
}
urlObj.searchParams.set(key, params[key]);
}
return urlObj.toString();
} catch (e) {
// 如果URL解析失败回退到简单的字符串拼接方法
if (url) { if (url) {
url = this.removeURLParameter(url, Object.keys(params)) url = this.removeURLParameter(url, Object.keys(params))
} }
@ -651,8 +670,8 @@ const timezone = require("dayjs/plugin/timezone");
} }
url+= '&' + key + '=' + params[key]; url+= '&' + key + '=' + params[key];
} }
return this.rightDelete(url.replace("?&", "?"), '?');
} }
return this.rightDelete(url.replace("?&", "?"), '?');
}, },
/** /**