mi-assessment/uniapp/unpackage/dist/dev/mp-weixin/utils/image.js
2026-02-09 14:45:06 +08:00

17 lines
490 B
JavaScript

"use strict";
const config_index = require("../config/index.js");
const IMAGE_BASE_URL = config_index.config.STATIC_BASE_URL;
function getFullImageUrl(url) {
if (!url)
return "";
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
if (url.startsWith("/")) {
return `${IMAGE_BASE_URL}${url}`;
}
return `${IMAGE_BASE_URL}/${url}`;
}
exports.getFullImageUrl = getFullImageUrl;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/image.js.map