{"id":27916735,"url":"https://github.com/itning/axios-helper","last_synced_at":"2025-05-06T16:39:23.594Z","repository":{"id":36965432,"uuid":"245077417","full_name":"itning/axios-helper","owner":"itning","description":"封装Axios库。This lib will help you better use axios","archived":false,"fork":false,"pushed_at":"2024-08-04T10:45:00.000Z","size":632,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T08:24:25.682Z","etag":null,"topics":["axios","helper","typescript","util"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@itning/axios-helper","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-05T05:31:01.000Z","updated_at":"2024-08-04T10:45:03.000Z","dependencies_parsed_at":"2024-08-04T11:56:47.964Z","dependency_job_id":null,"html_url":"https://github.com/itning/axios-helper","commit_stats":{"total_commits":137,"total_committers":3,"mean_commits":"45.666666666666664","dds":0.291970802919708,"last_synced_commit":"d4def82b3ca5b066c11ca91c543efb317801776d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Faxios-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Faxios-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Faxios-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itning%2Faxios-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itning","download_url":"https://codeload.github.com/itning/axios-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252721930,"owners_count":21793927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","helper","typescript","util"],"created_at":"2025-05-06T16:39:22.964Z","updated_at":"2025-05-06T16:39:23.581Z","avatar_url":"https://github.com/itning.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Axios Helper Lib\n\n[![GitHub stars](https://img.shields.io/github/stars/itning/axios-helper.svg?style=social\u0026label=Stars)](https://github.com/itning/axios-helper/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/itning/axios-helper.svg?style=social\u0026label=Fork)](https://github.com/itning/axios-helper/network/members)\n[![GitHub watchers](https://img.shields.io/github/watchers/itning/axios-helper.svg?style=social\u0026label=Watch)](https://github.com/itning/axios-helper/watchers)\n[![GitHub followers](https://img.shields.io/github/followers/itning.svg?style=social\u0026label=Follow)](https://github.com/itning?tab=followers)\n\n[![GitHub issues](https://img.shields.io/github/issues/itning/axios-helper.svg)](https://github.com/itning/axios-helper/issues)\n[![GitHub license](https://img.shields.io/github/license/itning/axios-helper.svg)](https://github.com/itning/axios-helper/blob/master/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/itning/axios-helper.svg)](https://github.com/itning/axios-helper/commits)\n[![GitHub release](https://img.shields.io/github/release/itning/axios-helper.svg)](https://github.com/itning/axios-helper/releases)\n[![npm version](https://badge.fury.io/js/%40itning%2Faxios-helper.svg)](https://badge.fury.io/js/%40itning%2Faxios-helper)\n[![npm downloads](https://img.shields.io/npm/dw/@itning/axios-helper)](https://www.npmjs.com/package/@itning/axios-helper)\n[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/itning/axios-helper.svg)](https://github.com/itning/axios-helper)\n[![HitCount](https://hitcount.itning.com?u=itning\u0026r=axios-helper)](https://github.com/itning/axios-helper)\n[![language](https://img.shields.io/badge/language-TypeScript-green.svg)](https://github.com/itning/axios-helper)\n\n- How to use this lib ?\n\n```shell\nnpm i @itning/axios-helper\n```\n\n```javascript\nimport {AxiosHelperConfig, Patch} from \"@itning/axios-helper\";\n// Config message toast when net error.\nAxiosHelperConfig.errorMsgImpl = {\n    showErrorToast(title, data) {\n        console.log(title + data.msg);\n        setTimeout(() =\u003e {\n            AxiosHelperConfig.onceMsgFinish();\n            console.log('one message show finish')\n        }, 2000);\n    }\n};\n// Config interceptor for each request or response.\nAxiosHelperConfig.axiosInstanceBuilder\n    .requestInterceptor({\n        onFulfilled: request =\u003e {\n\n        },\n        onRejected: error =\u003e {\n\n        }\n    })\n    .responseInterceptor({\n        onFulfilled: response =\u003e {\n\n        },\n        onRejected: error =\u003e {\n            \n        }\n    })\n    .build();\n// You can use this api to send http patch request.\n// Other http request\n//Get(\"http://api.localhost.com\")\n//Delete(\"http://api.localhost.com\")\n//Post(\"http://api.localhost.com\")\n//Put(\"http://api.localhost.com\")\nPatch(\"http://api.localhost.com\")\n    // Config http success code,default 200.\n    .withSuccessCode(200)\n    // Config whether to open error message, defalut true.\n    .withEnableErrorMsg(false)\n    // Config error message title, defalut '错误'.\n    .withErrorStartMsg(\"\")\n    // Invoke function when error happen.\n    .withErrorHandle((error) =\u003e {\n\n    })\n    // Only show once msg\n    .withOnceMsg()\n    // Send http request with form data.\n    .withFormData({\"id\": \"1\"})\n    // Send http request with url search param data.\n    .withURLSearchParams({})\n    // Send http request with json data.\t\n    .withJson({1: 1})\n    // When server response received will call this function.\n    // Must call this function and will send http request.\n    .do(response =\u003e {\n\n    })\n    // When do function invoked.\n    .doAfter(() =\u003e {\n\n    });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitning%2Faxios-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitning%2Faxios-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitning%2Faxios-helper/lists"}