npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

npm-kpocom-admin-api

v1.0.3

Published

[视频教程](https://www.bilibili.com/video/BV1EW4y1C71D)

Downloads

38

Readme

权限项目api-axios方式调用,

使用手册

视频教程

  1. 在源码目录下(src)创建 api-services 文件夹,并将 https://editor.swagger.io 生成的 typescript-axios 代码(.ts 后缀文件)放入其中(注意 package.json 文件中 axios 的版本,必须和项目保持一致,这里使用的是 v0.21.1 版本)。

  2. 拷贝 Furion 源码下的 clients/axios_vue_react/axios-utils.ts文件放置到 api-services 同级目录下,同时修改 serveConfig 中的配置地址为对应的服务器地址,同时安装 "axios": "^0.21.1" 的包到 package.json

  3. 基本使用

  • Promise 方式:
getAPI(SystemAPI)
  .apiGetXXXX()
  .then((res) => {
    var data = res.data.data!;
  })
  .catch((err) => {
    console.log(err);
  })
  .finally(() => {
    console.log("api request completed.");
  });
  • async/await 方式:
const [err, res] = await feature(getAPI(SystemAPI).apiGetXXX());

if (err) {
  console.log(err);
} else {
  var data = res.data.data!;
}

console.log("api request completed.");

如果服务器有 API 发生改变,重新生成代码并替换 api-services 目录所有代码即可(建议先删除里面所有文件后再粘贴

常见问题

Vue3 项目中启用 TypeScriptESlint 后报错,只需要修改相关的 tsconfig.json 文件添加以下配置即可:

"compilerOptions": {
    "importsNotUsedAsValues": "remove",
    "preserveValueImports": false
  }

Angular 项目中,可能会出现 override 错误问题,只需要编辑 api-services/base.ts 文件并添加 override 关键字即可,如:

推荐使用 Angular 版本

export class RequiredError extends Error {
  override name: "RequiredError" = "RequiredError";
}

Swagger 多分组处理

如果使用了Swagger 多分组的功能,可以升级 Furion 框架至 v3.3.4 版本,之后启用 EnableAllGroups 功能,如:

{
  "SpecificationDocumentSettings": {
    "EnableAllGroups": true
  }
}

这样就会自动将所有分组的内容合并到 All Groups 中。


打包:

  1. 初始化项目(文件夹名称一定不能有中文)

    npm init -y

    放入js、css、ts等静态文件。

  2. 查看当前源

    npm config get registry --产看当前源
    npm config set registry https://registry.npmjs.org --切换为npm源
    npm config set registry=https://registry.npm.taobao.org/ --切换到淘宝镜像
  3. 添加用户

    npm adduser
    ---中间是添加用户(应该会跳转到npmjs官网去验证邮箱登录等)
    npm who am i
  4. 上传自己的包

    npm version patch --自动将package.json中的version版本加0.0.1
    npm publish  --打包重新上传

    打包之前需要修改package.json中的版本号version!!!

    npm官网查看

更新web项目的**js**引用:

npm install