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

feishu-login

v1.0.1

Published

飞书应用登录

Readme

介绍

飞书应用登录

安装

npm i feishu-login -S

飞书应用登录流程

1、进入飞书开放平台,并且创建应用,获取应用的App ID,启用网页或者小程序,然后将页面URL添加到重定向URL中,否则会提示请求非法, 请联系应用开发者,具体参考飞书文档

2、npm i feishu-login -S

3、在调用接口的文件中,示例代码:

  
  const FeishuLogin = require('FeishuLogin');
  
  const feishuLogin = new FeishuLogin({
    appId: 'xxx',
    // 因为飞书应用的重定向URL无法设置通配符,所以这里新建一个入口页面,避免每个需要登录的页面URL都需要配置到飞书应用后台中的重定向URL中。
    // 当然也可以不新建统一入口页面,将redirectUrl设置为真正页面的URL也可以
    // 配置重定向页面URL(需要将redirectUrl配置到飞书应用重定向URL中,否则会提示`请求非法, 请联系应用开发者`)
    // 比如://www.xxx.com/#/redirect
    redirectUrl: 'xxx',
    ajaxConfig: {
      method: 'POST',
      url: 'xxx',
      data: {},
      // 其他axios配置
      ...
    },
    success: (res, url) => {
      ...
      // 如果登录成功后需要跳转到真正的URL,设置如下:
      window.location.href = url;
    },
    error: err => {
      // Indicator.close();
      ...
    }
  })

4、在接口返回未登录时,未登录的回调函数中,示例代码:

  // Toast(`未登录,即将登录`);
  feishuLogin.login();
  

5、redirectUrl 页面(redirectUrl/redirectUrl.vue)示例代码:

<template>
    <div class="main-router-view">
        <div class="redirect-wrap">
            
        </div>
    </div>
</template>
<script>
    import { Indicator } from 'mint-ui';

    export default {
        data() {
            return {
                
            }
        },
        created(){
            Indicator.open({
                text: '登录中...',
                spinnerType: 'fading-circle'
            });

            // 没有登录cookie、或者登录cookie无效时,调用登录
            this.feishuLogin.login();
        },
    }
</script>

Options

参数 | 解释 | 默认值 -|-|- appId | 飞书应用app id | '' redirectUrl | 配置重定向页面URL(需要将redirectUrl配置到飞书应用重定向URL中,否则会提示请求非法, 请联系应用开发者) | '' ajaxConfig | 后端接口配置 | {} success | 接口成功的回调。第一个参数为后端接口response,第二个参数为页面真正的URL | function () {} error | 接口失败的回调。参数为error | function () {}