@steedos/service-plugin-amis 2.5.16-beta.1 → 2.5.16-beta.2
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.
|
@@ -268,6 +268,34 @@
|
|
|
268
268
|
},
|
|
269
269
|
theme: 'antd',
|
|
270
270
|
isCurrentUrl: isCurrentUrl,
|
|
271
|
+
requestAdaptor: (config)=>{
|
|
272
|
+
// url是相对路径
|
|
273
|
+
if(config.url && (!/^http[s]?:\/\//i.test(config.url))){
|
|
274
|
+
if(Meteor.isCordova){
|
|
275
|
+
config.url = Meteor.absoluteUrl(config.url)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if(!config.headers){
|
|
279
|
+
config.headers = {}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
|
|
283
|
+
config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
|
|
284
|
+
}
|
|
285
|
+
}else if(config.url && Meteor.isCordova && Builder.settings.context && Builder.settings.context.rootUrl && config.url.startsWith(Builder.settings.context.rootUrl)){
|
|
286
|
+
// 是绝对路径,且是cordova环境, 且以root url开头, 则自动处理认证
|
|
287
|
+
if(Meteor.isCordova){
|
|
288
|
+
if(!config.headers){
|
|
289
|
+
config.headers = {}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
|
|
293
|
+
config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return config;
|
|
298
|
+
}
|
|
271
299
|
};
|
|
272
300
|
// 已弃用
|
|
273
301
|
const AmisRender = function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.5.16-beta.
|
|
3
|
+
"version": "2.5.16-beta.2",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "f8b3f647c00f580f9a10547a4a8afec0398bcbe2",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|