From 0fb30b226613ceb1c1093031410b54b873cba88c Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 17 Mar 2024 14:27:44 +0800 Subject: [PATCH] add some --- lib/misc.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/misc.js b/lib/misc.js index 0207a3d2..d04cabb6 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -193,11 +193,9 @@ Volcanos("misc", { }, ResourceFavicon(can) { return can.misc.Resource(can, nfs.SRC_MAIN_ICO) }, Resource(can, path, space, serve) { - if (serve && can.base.beginWith(path, nfs.PS)) { return serve+path } - if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } - var p = can.base.MergeURL(nfs.REQUIRE+path+_version, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) - if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); p = u.origin + p } - return p + if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.REQUIRE+path+_version } + if (!can.base.beginWith(path, web.HTTP)) { if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); path = u.origin + path } } + return can.base.MergeURL(path, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) }, ShareLocal(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } return can.base.MergeURL(nfs.SHARE_LOCAL+path+_version, ice.POD, space||can.ConfSpace())