24 lines
843 B
JavaScript
24 lines
843 B
JavaScript
function e(e) {
|
|
let t = typeof e.module == `string` ? e.module.trim() : ``,
|
|
n = typeof e.res_module == `string` ? e.res_module.trim() : ``;
|
|
if (t === `mf_dcim`) return `mf_dcim`;
|
|
if (t === `remf_dcim` || (!t && n === `mf_dcim`)) return `remf_dcim`;
|
|
}
|
|
async function t(t, n) {
|
|
let r = typeof n.module == `string` ? n.module.trim() : ``,
|
|
i = e(n);
|
|
if (i) return i;
|
|
if (r && r !== `mf_cloud`) return r;
|
|
let a = await t.get(`/product/${n.id}/config_option`),
|
|
o = typeof a?.module == `string` ? a.module.trim() : ``,
|
|
s =
|
|
e({
|
|
module: o,
|
|
res_module: typeof a?.res_module == `string` ? a.res_module.trim() : ``,
|
|
}) || (!r && n.res_module === `mf_dcim` ? `remf_dcim` : void 0);
|
|
if (s) return s;
|
|
if (!o) throw Error(`商品配置类型加载失败,请重试`);
|
|
return o;
|
|
}
|
|
export { t };
|