mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-22 22:49:18 +08:00
chore: request 添加运行时升级指引
This commit is contained in:
parent
32e221f150
commit
46e42d4344
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@fesjs/plugin-request",
|
||||
"version": "3.0.5",
|
||||
"version": "3.0.6",
|
||||
"description": "@fesjs/plugin-request",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
|
@ -49,6 +49,17 @@ function getRequestInstance() {
|
||||
initialValue: {},
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (typeof errorHandler === 'object') {
|
||||
console.error('[plugin-request]: errorHandler 更改为函数了,具体请看文档 https://fesjs.mumblefe.cn/reference/plugin/plugins/request.html');
|
||||
}
|
||||
if (otherConfigs.responseDataAdaptor) {
|
||||
console.warn(
|
||||
'[plugin-request]: responseDataAdaptor 在 3.x 已经被移除,请改用 dataHandler 实现,具体请看文档 https://fesjs.mumblefe.cn/reference/plugin/plugins/request.html',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const defaultConfig = Object.assign(
|
||||
{
|
||||
timeout: 10000,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "2.0.0",
|
||||
"description": "fes 移动端项目模版",
|
||||
"scripts": {
|
||||
"prod": "FES_ENV=prod fes build",
|
||||
"build": "FES_ENV=prod fes build",
|
||||
"dev": "fes dev"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -3,6 +3,7 @@ import { defineRuntimeConfig } from '@fesjs/fes';
|
||||
export default defineRuntimeConfig({
|
||||
request: {
|
||||
baseURL: '/ras-mas',
|
||||
responseDataAdaptor() {},
|
||||
dataHandler(data) {
|
||||
console.log('data', data);
|
||||
if (data?.code !== '0') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user