
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
maque-request-ts
Advanced tools
封装了axios库。
请求后端时,要从sessionStorage、localStorage、Cookies 3个存储中读取Token
Token的名称在 window.tokenName 配置,如果为空,则默认为Token
请求时,携带的header头为上述的名称
在package.json中引入包
"maque-request-ts": "^1.0.1"
或使用安装命令
npm install maque-request-ts
在需要调用的地方使用
import requestWrap from "maque-request-ts";
然后调用即可
function getBeijing() {
//https://api.vvhan.com/api/60s
requestWrap({url: "/api/one"}).then(res => {
result.value = res;
})
}
返回值说明:
默认只返回后端BodyVo中的data,如果你需要整个body返回,请增加参数 fullBack:true
{url: "/api/one",fullBack:true}
如果是文件请求下载,也就是 responseType='blob' 时,也会返回整个body
该库只依赖于Vue3,Element-Plus,所以项目必须要引入Element-Plus,并在Main.ts或main.js中进行初始化
FAQs
封装了axios库。
The npm package maque-request-ts receives a total of 0 weekly downloads. As such, maque-request-ts popularity was classified as not popular.
We found that maque-request-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.