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

ibotlogin

v1.0.0

Published

容智旗下产品通用登录组件

Downloads

2

Readme

一:直接引用

①从git下载文件夹后放入vue项目工程src文件夹下

②在main.js文件中引入组件:

    import LoginModules from './loginComponents'

③将组件注册入Vue实例中:

    Vue.use(LoginModules)

④在项目中根据规则新建对应页面

登录login.vue, 注册register.vue, 忘记密码forgetPwd.vue

⑤使用组件

1、在登录页使用组件

    <Login :backgroundImage="backgroundImage"  :logoImg="logoImg"></Login>

2、在注册页使用组件

    <Register 
        :backgroundImage="backgroundImage" 
        :logoImg="logoImg"  
        @registerSuccess="handleRegisterSuccess"
        ></Register>

3、在忘记密码页使用组件

    <ForgetPwd
            :backgroundImage="backgroundImage"
            :logoImg="logoImg"
            @changePwdSuccess="handleChangePwdSuccess"
    ></ForgetPwd>

backgroundImage:背景图相对路径

    backgroundImage:'assets/images/login_bg.png',

logoImg:logo图片相对路径

    logoImg:'assets/images/iBot_logo.png',

其他参数可以参考backgroundImage用法自行拓展。

⑥登录页面分账号登录和验证码登录,内部使用动态组件拆分,使用provide/inject实现数据传递。开发者需要在login.vue页面实现如下逻辑:

    methods: {
        loginSuccess(obj){
            //obj登录成功后组件返回的参数,用于各系统自主实现功能
            //目前obj结构:{
                code:200,
                data{
                   token:'xxxxxx',
                    userinfoVo:{
                        xxx:xxx
                    } 
                },
                msg:'操作成功'
            }
        }
    },
    provide(){
        return {
            loginSuccess: this.loginSuccess
        }
    }

⑦注册页面使用$emit获取成功的参数,开发者需要在register.vue页面实现如下逻辑:

    //注意在第⑤步中第2项组件要绑定handleRegisterSuccess事件
    methods: {
        //注册成功之后的页面逻辑,根据各自系统自行实现
        handleRegisterSuccess(obj){
            //obj登录成功后组件返回的参数,用于各系统自主实现功能
            //目前obj结构:{
                code:200,
                data{
                   token:'xxxxxx',
                    userinfoVo:{
                        xxx:xxx
                    } 
                },
                msg:'操作成功'
            }
        }
    },

⑧忘记密码页面使用$emit获取成功的参数,开发者需要在forgetPwd.vue页面实现如下逻辑:

    //注意在第⑤步中第2项组件要绑定handleChangePwdSuccess事件
    methods: {
        //注册成功之后的页面逻辑,根据各自系统自行实现
        handleChangePwdSuccess(obj){
            //obj登录成功后组件返回的参数,用于各系统自主实现功能
            //目前obj结构:{
                code:200,
                msg:'操作成功'
            }
        }
    },

二:开发者也可以在npm下载组件:ibotlogin

①使用npm或者yarn安装

    npm install ibotlogin
    yarn add ibotlogin

②参考第一种方式的第②步操作,后面都一样

注:====使用本组件要求==== 开发者使用vue2.0框架搭建项目工程,且安装有如下控件:

"axios": "0.24.0",

"element-ui": "2.14.1",及以上版本

开发环境下需要在vue.config.js文件下配置代理:/baseLogin

    devServer: {
    host: '0.0.0.0',
    port: port,
    open: true,
    proxy: {
      '/baseLogin': {
      //process.env.VUE_APP_BASE_URL为.env.development文件下后台开发者项目地址,也可直接配置为http://36.137.215.140:90
        target: process.env.VUE_APP_BASE_URL,
        changeOrigin: true,
        pathRewrite: {
          '^/baseLogin': ''
        }
      }
    },
    disableHostCheck: true
  },