Installations
npm install vue-cli-plugin-axios-module
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.8.0
NPM Version
6.2.0
Score
69.3
Supply Chain
91
Quality
74.8
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
markh5
Download Statistics
Total Downloads
87,151
Last Day
2
Last Week
70
Last Month
303
Last Year
6,557
GitHub Statistics
3 Stars
7 Commits
1 Branches
1 Contributors
Bundle Size
158.00 B
Minified
140.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.0.1
Package Id
vue-cli-plugin-axios-module@0.0.1
Unpacked Size
13.89 kB
Size
11.40 kB
File Count
12
NPM Version
6.2.0
Node Version
10.8.0
Total Downloads
Cumulative downloads
Total Downloads
87,151
Last day
-90%
2
Compared to previous day
Last week
0%
70
Compared to previous week
Last month
-34.3%
303
Compared to previous month
Last year
-62.3%
6,557
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
vue-cli-plugin-axios-module
:rocket: 基于Vue-cli 3.0的axios插件,帮助你快速搭建前后端交互模块
Features
- 支持 单/多 系统交互
- 环境变量配置
- 业务模块划分
- 请求拦截器集成
Usage
terminal:
1vue add axios-module
图形化(vue ui):
搜索 vue-cli-plugin-axios-module 即可
FAQ
单/多 系统交互
API的地址在api/url.js中进行配置
如果只与单系统进行交互,只需配置系统名称与不同环境的地址即可
如果与多系统进行交互,例如:
单点登录是单独一套服务(www.sso.com/api/v1/)
业务端是单独一套服务(www.backend.com/api/v1/)
那么就需要在api/url.js config中配置各个系统的名称以及不同环境下的地址
环境变量配置
1// api/url.js 2const config = { 3 // sso端不同环境对应的地址 4 sso: { 5 development: 'www.ssodev.com', 6 qa: 'www.ssoqa.com', 7 prod: 'www.ssoprod.com' 8 }, 9 // 业务端不同环境对应的地址 10 backend: { 11 development: 'www.bedev.com', 12 qa: 'www.beqa.com', 13 prod: 'www.beprod.com' 14 } 15}
在此文件中,请填写你的各系统不同环境的地址,最终会根据你的NODE_ENV环境变量导出一个对象(默认NODE_ENV为development)
1// 导出的url对象 2{ 3 sso: 'www.ssodev.com', 4 backend: 'www.bedev.com' 5}
业务模块划分
modules文件下是各个业务模块的API模块,使用时在你的业务组件中调用即可
1import http from '../http'; 2import url from '../url'; 3export default { 4 getList(params) { 5 return http({ 6 method: 'get', 7 url: `${url.backend}/api/v1/list`, 8 params 9 }); 10 }, 11};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-13
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More