mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-23 06:59:18 +08:00
chore: request 添加运行时升级指引
This commit is contained in:
parent
32e221f150
commit
46e42d4344
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fesjs/plugin-request",
|
"name": "@fesjs/plugin-request",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"description": "@fesjs/plugin-request",
|
"description": "@fesjs/plugin-request",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -49,6 +49,17 @@ function getRequestInstance() {
|
|||||||
initialValue: {},
|
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(
|
const defaultConfig = Object.assign(
|
||||||
{
|
{
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"description": "fes 移动端项目模版",
|
"description": "fes 移动端项目模版",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prod": "FES_ENV=prod fes build",
|
"build": "FES_ENV=prod fes build",
|
||||||
"dev": "fes dev"
|
"dev": "fes dev"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -3,6 +3,7 @@ import { defineRuntimeConfig } from '@fesjs/fes';
|
|||||||
export default defineRuntimeConfig({
|
export default defineRuntimeConfig({
|
||||||
request: {
|
request: {
|
||||||
baseURL: '/ras-mas',
|
baseURL: '/ras-mas',
|
||||||
|
responseDataAdaptor() {},
|
||||||
dataHandler(data) {
|
dataHandler(data) {
|
||||||
console.log('data', data);
|
console.log('data', data);
|
||||||
if (data?.code !== '0') {
|
if (data?.code !== '0') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user