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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@x-edu/client-toolkit

v0.0.2

Published

``` npm install @x-edu/x-edu-client-toolkit ```

Downloads

1

Readme

安装

npm install @x-edu/x-edu-client-toolkit

使用

getJumpUrl

传入跳转地址, 获得经过天谕登录信息包装的跳转链接

import clientToolkit from '@x-edu/client-toolkit'


const url = await clientToolkit.getJumpUrl({
  jumpUrl: extInfo.res_jump_url || extInfo?.link_params?.web,
  clientId: data.client_id,
  uc, // uc实例, 如果isInElectron为true, 则uc必传
  env: 'preproduction',
  isInElectron // 是否在pc端中, 默认false
})
window.open(url, '_blank')

入参

| 参数 | 说明 | 类型 | 默认值 | 是否必传 | | --- | --- | --- | --- | --- | | jumpUrl | 跳转链接 | string | | 是 | | clientId | 应用id | string | | 是 | | isInElectron | 是否在pc端 | boolean | false | 否 | | uc | uc实例, 如果isInElectron为true, 则uc必传 | any | | 否 | | env | 项目环境 'ncet-xedu' 或 'preproduction' | string | 'ncet-xedu' | 否

返回

| 参数 | 说明 | 类型 | | --- | --- | --- | | url | 经过天谕登录包装后的url | string |


getClientInfoSimple

传入clientId列表, 获得应用名称

import clientToolkit from '@x-edu/client-toolkit'


const clientIds = items.map((item) => item.client_id).filter((id) => id)
const clientsSimpleInfo = await clientToolkit.getClientInfoSimple({
  clientIds,
  env: 'preproduction'
})

入参

| 参数 | 说明 | 类型 | 默认值 | 是否必传 | | --- | --- | --- | --- | --- | | clientIds | 应用ids | string[] | | 是 | | env | 项目环境 'ncet-xedu' 或 'preproduction' | string | 'ncet-xedu' | 否

返回

| 参数 | 说明 | 类型 | | --- | --- | --- | | clientsSimpleInfo | 应用信息 | { client_id : { client_id:'xxx', client_name:'xxx' } } |

相关文档

https://doc-mgmt-tool-web.sdp.101.com/?sdp-app-id=b4fb92a0-af7f-49c2-b270-8f62afac1133#/mydoc/view/6645c0679feec60010a3fe7c/6645c0679feec60010a3fe7d

https://docs.qq.com/doc/DSHhUdmFUVVVoTWlr

1. 无client_id 直接跳资源地址
2. 有client_id 
  2.1 web内, 直接app/view打开
  2.2 pc内, 跳转到app/index targetUrl = 使用2.1地址传参