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

@jzjy/request

v1.3.1

Published

package request based on axios

Readme

基于Axios二次封装的Request库

安装

可以使用Npm或Yarn

npm i --save @jzjy/request

或者

yarn add @jzjy/request

如何引入

import request from '@jzjy/request'

API

|请求参数|类型|默认值|描述| |:----- |:------|:------|:------| |url |string |'' |请求地址 | |data |any | |参数 | |isForm |Boolean |false |是否form表单提交,content-type=application/x-www-form-urlencoded | |isUpload |Boolean |false |是否上传类型,content-type=multipart/form-data | |isText |Boolean |false |是否文本,content-type=text/plain;charset=utf-8 | |headers |Object |requreToken: true |请求头,默认每个接口都是需要token的 |

|响应参数|类型|默认值|描述| |:----- |:------|:------|:------| |responseHooks |array |[] |对状态非200和400的响应拦截(必须返回一个promise) |

案例


// 假设这是 src/plugins/request.js
import request from '@jzjy/request'

/**
 * 响应拦截这里不处理200和400状态的响应
*/
request.responseHooks.push(response => {
  return Promise.resolve(() => {
    // 可以在这里做响应特殊情况的补充
    if (response.data.code === 401) {
      console.log('没权限啦')
    }
  })
})

export default request
// 这里是src/api文件夹
import request from '@/plugins/request'

// get
export const getVersion = data => {
  return request.http({
    method: 'get',
    url: '/api/qk/textbook/list', 
    data
  })
}

// put
export const updateCourse = data => {
  console.log(data)
  return request.http({
    method: 'put',
    url: '/api/cc/marketaction',
    data
  })
}


// delete
export const deleteCourse = data => {
  return request.http({
    method: 'delete',
    url: `/api/cc/course/${data.id}`
  })
}
// 对应的*.vue文件例子
import { getVersion, updateCourse, createCourse, deleteCourse, getUserInfo } from '@/api'
export default {
  created () {
    getUserInfo().then(res => {
      console.log(res, 'res')
    })
    getVersion({
      a: 1,
      b: 2
    }).then(response => {
      console.log(response')
    }).catch(err => {
      console.dir(err.message)
    })

    updateCourse({"marketActionId":1,"marketActionName":"福建中考春季加油班","grade":"9","deptId":3,"expireTime":"2020-02-14 00:00:00","description":"{\"header_url\":\"http://f1.ykt100.com/group1/M00/13/69/rBBYB14zrGWALeXzAAONJEH8ue4185.png\",\"description_url\":\"http://f1.ykt100.com/group1/M00/13/2D/rBBYB14wfz6AA3EHAAGglIHYgiM987.png\"}","actived":"0","createTime":"","createBy":"","updateTime":"","updateBy":"","$index":0,"$grade":"九年级","$deptId":"福建","$actived":"停用"})
    .then(res => {
      console.log(res)
    })

    createCourse({"id":"","name":"一年级春季语文1星-123","year":"2018","grade":"1","term":"2","subject":"1","level":"5","courseType":"1","courseNameExpand":"123","totalDuration":"3123","description":"","enterCondition":"","imgUrl":"","published":"0","deptId":3,"$year":"2018","$grade":"一年级","$term":"春季","$subject":"语文","$level":"1星","$courseType":"同步课","$published":"未发布","$deptId":"福建","spare":"0","offeringStudentLimit":0})
    .then(res => {
      console.log(res)
    })

    deleteCourse({
      id: 2477
    }).then(res => {
      console.log(res)
    }).catch(err => {
      console.log(err)
    })
  }
}

qk-web登陆逻辑

  • requireToken 判断是否要不要token

  • token -> salt-classes-token 登陆的时候set的值

  • isLogin -> registerAndLogin

  • isSendCode -> sendMobile

  • needToken

最后

  • 免签名
    • /dept//config/client//**
    • /admin/mobile/**
    • /cc/performance/pub/**
    • /alive/callbackinfo/recordCallbackEvent
    • /cc/liveGroup/updateStatus
    • /cc/playback/updateStatus
    • /cc/playback/innerCallback
    • /file/file/oss/callback
    • /alive/callbackinfo/pptConvertCallbackUrl