@fonixtree/magic-design 0.1.51 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/common/LinkModal/ProductDetailPage/index.js +1 -1
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +1 -1
- package/es/utils/commonUtil.js +3 -28
- package/lib/common/LinkModal/ProductDetailPage/index.js +1 -1
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js +1 -1
- package/lib/utils/commonUtil.js +3 -28
- package/package.json +1 -1
|
@@ -307,7 +307,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
307
307
|
case 0:
|
|
308
308
|
return [4
|
|
309
309
|
/*yield*/
|
|
310
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands
|
|
310
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
|
|
311
311
|
|
|
312
312
|
case 1:
|
|
313
313
|
res = _a.sent();
|
package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js
CHANGED
|
@@ -275,7 +275,7 @@ function (_super) {
|
|
|
275
275
|
];
|
|
276
276
|
return [4
|
|
277
277
|
/*yield*/
|
|
278
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands
|
|
278
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
|
|
279
279
|
|
|
280
280
|
case 3:
|
|
281
281
|
res = _a.sent();
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -214,7 +214,8 @@ function commonFetch(url, data, method) {
|
|
|
214
214
|
var credentials = localStorage.getItem('credentials');
|
|
215
215
|
var headers = {
|
|
216
216
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
217
|
-
credentials: credentials
|
|
217
|
+
credentials: credentials,
|
|
218
|
+
accessToken: credentials
|
|
218
219
|
};
|
|
219
220
|
|
|
220
221
|
if (_method === 'GET') {
|
|
@@ -731,33 +732,7 @@ var convertToRem = function convertToRem(value) {
|
|
|
731
732
|
exports.convertToRem = convertToRem;
|
|
732
733
|
|
|
733
734
|
var pxToRem = function pxToRem(styleObj) {
|
|
734
|
-
|
|
735
|
-
return styleObj;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
var remObj = {};
|
|
739
|
-
|
|
740
|
-
for (var key in styleObj) {
|
|
741
|
-
if (styleObj.hasOwnProperty(key)) {
|
|
742
|
-
var value = styleObj[key];
|
|
743
|
-
|
|
744
|
-
if (typeof value === 'string' && value.endsWith('px')) {
|
|
745
|
-
remObj[key] = key === 'opacity' || key === 'lineHeight' ? value : convertToRem(value);
|
|
746
|
-
} else if (typeof value === 'number') {
|
|
747
|
-
remObj[key] = convertToRem(value);
|
|
748
|
-
} else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
|
|
749
|
-
var paddingValues = value.split(' ');
|
|
750
|
-
var remPaddingValues = paddingValues.map(function (paddingValue) {
|
|
751
|
-
return paddingValue.endsWith('px') ? convertToRem(paddingValue) : paddingValue;
|
|
752
|
-
});
|
|
753
|
-
remObj[key] = remPaddingValues.join(' ');
|
|
754
|
-
} else {
|
|
755
|
-
remObj[key] = value;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
return remObj;
|
|
735
|
+
return styleObj;
|
|
761
736
|
};
|
|
762
737
|
|
|
763
738
|
exports.pxToRem = pxToRem;
|
|
@@ -307,7 +307,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
|
|
|
307
307
|
case 0:
|
|
308
308
|
return [4
|
|
309
309
|
/*yield*/
|
|
310
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands
|
|
310
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
|
|
311
311
|
|
|
312
312
|
case 1:
|
|
313
313
|
res = _a.sent();
|
package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/AIRecommendation/index.js
CHANGED
|
@@ -275,7 +275,7 @@ function (_super) {
|
|
|
275
275
|
];
|
|
276
276
|
return [4
|
|
277
277
|
/*yield*/
|
|
278
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/brands
|
|
278
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/stores/contract/brands")];
|
|
279
279
|
|
|
280
280
|
case 3:
|
|
281
281
|
res = _a.sent();
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -214,7 +214,8 @@ function commonFetch(url, data, method) {
|
|
|
214
214
|
var credentials = localStorage.getItem('credentials');
|
|
215
215
|
var headers = {
|
|
216
216
|
'Content-Type': 'application/json; charset=UTF-8',
|
|
217
|
-
credentials: credentials
|
|
217
|
+
credentials: credentials,
|
|
218
|
+
accessToken: credentials
|
|
218
219
|
};
|
|
219
220
|
|
|
220
221
|
if (_method === 'GET') {
|
|
@@ -731,33 +732,7 @@ var convertToRem = function convertToRem(value) {
|
|
|
731
732
|
exports.convertToRem = convertToRem;
|
|
732
733
|
|
|
733
734
|
var pxToRem = function pxToRem(styleObj) {
|
|
734
|
-
|
|
735
|
-
return styleObj;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
var remObj = {};
|
|
739
|
-
|
|
740
|
-
for (var key in styleObj) {
|
|
741
|
-
if (styleObj.hasOwnProperty(key)) {
|
|
742
|
-
var value = styleObj[key];
|
|
743
|
-
|
|
744
|
-
if (typeof value === 'string' && value.endsWith('px')) {
|
|
745
|
-
remObj[key] = key === 'opacity' || key === 'lineHeight' ? value : convertToRem(value);
|
|
746
|
-
} else if (typeof value === 'number') {
|
|
747
|
-
remObj[key] = convertToRem(value);
|
|
748
|
-
} else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
|
|
749
|
-
var paddingValues = value.split(' ');
|
|
750
|
-
var remPaddingValues = paddingValues.map(function (paddingValue) {
|
|
751
|
-
return paddingValue.endsWith('px') ? convertToRem(paddingValue) : paddingValue;
|
|
752
|
-
});
|
|
753
|
-
remObj[key] = remPaddingValues.join(' ');
|
|
754
|
-
} else {
|
|
755
|
-
remObj[key] = value;
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
return remObj;
|
|
735
|
+
return styleObj;
|
|
761
736
|
};
|
|
762
737
|
|
|
763
738
|
exports.pxToRem = pxToRem;
|