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

gc_mobile

v1.0.12

Published

## 简介

Downloads

220

Readme

绿云移动端类库

简介

支持免登各类客户端并获取用户中心 token

安装

npm install gc_mobile --save

使用

const res = await mobile({
  appCode: "DZ-TEST", // 应用appCode,联系管理员
  apiPrefix: process.env.NODE_ENV === "development" ? "dev" : "prod" // 根据环境变量修改api前缀
});
console.log("res", res.userInfo); // 获取用户信息和ucToken
this.$store.commit("setUserInfo", res.userInfo); // 保存到vuex

钉钉免登测试流程

1.启动测试环境或本地环境,假设为 http://192.168.1.43:8081

2.将手机和电脑连接到同一网络,并配置局域网可访问

3.登录钉钉后台,新建一个测试应用并将首页设置为 http://192.168.1.43:8081(本地或测试域名),保存并发布版本 ( 此步骤可联系管理员处理 )

4.确定应用名并在 UC 应用添加,同时联系管理员

5.手机端点击钉钉应用 (或发送内网地址 http://192.168.1.43:8081/?corpId=ding013ea2dcb2eb81a5f2c783f7214b6d69) 查看测试

H5 免登测试流程

1.获取链接上名为 token 的参数

2.使用该 token 调用 uc 接口

参数说明

| 属性 | 说明 | 类型 | 默认值 | | :-------: | :------------------------------------------------------: | :----: | :----: | | appCode | 必传,应用 appCode 名字 | string | / | | apiPrefix | api 前缀,dev/prod/自定义 api 路径,不传默认为测试环境 api | string | dev | | map | 接口数据路径 | object | { dataPath:"data" } | | gc_rsa | 网关配置项 | object | / |

返回参数说明

| 属性 | 说明 | 类型 | 默认值 | | :------: | :---------------------------------------: | :----: | :----: | | config | 配置项信息 | Object | / | | env | 当前环境信息 | Object | / | | js | 当前库的返回值,钉钉环境返回钉钉 js 操作库 | Object | / | | userInfo | 用户信息,ucToken 为用户中心 token | Object | / |

返回参数示例:

{
  "config": {
    "appCode": "DZ-TEST"
  },
  "env": {
    "code": "dd",
    "name": "钉钉",
    "value": true
  },
  "js": {
    "dd": {}
  },
  "userInfo": {
    "avatarUrl": "test",
    "corpId": "test",
    "generalDing": false,
    "id": 156,
    "mobile": "test",
    "nick": "test",
    "openId": "test",
    "resultDetailDtos": [
      {
        "appCode": "test",
        "deptId": "",
        "deptName": "",
        "parentUnitCode": "test",
        "unitCode": "test",
        "unitName": "test",
        "unitType": "test",
        "userCode": "test",
        "userName": "test"
      }
    ],
    "ucToken": "test"
  }
}

示例代码

    示例代码文件夹说明

    example/
    └── dd  // uniapp 钉钉示例