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

@microduino/accountcenter

v1.13.6

Published

microduino account center for all web site

Downloads

20

Readme

#microduino用户中心

###用户中心,基于react和npm使用方式(表现层)

npm i @microduino/accountcenter

###config配置说明

/**
 * appID 必填,否则会初始化失败(跟任博对接下,做统一规划~)
 * language:国际化,目前定义了zh和en
 * display:展示模式,可选范围mobile pc(default)
 * styles:皮肤自定义入口(预留)
 */
const config = {appID: 'idea-lab', language: 'zh', display: 'mobile'}

###react 项目,npm导入方式

const {Login, Register, Forget} = new AccountCenter(config)
     <Login /> // 登录页面
     <Register /> // 忘记密码页面
     <Forget /> // 注册页面

###非react 项目,script标签引入方式

    <script src="../dist/accountCenter.js"></script>
    <script type="text/babel">
       function onSuccess () {
           alert('成功')
       }
       const {React, ReactDOM, AccountCenter} = accountCenter

       const {Login, Register, Forget, config} = new AccountCenter({language: 'en', appID: 'idea-lab'})
       ReactDOM.render(
           <div>
               <Login onSuccess={onSuccess}/>
               <Register onSuccess={onSuccess}/>
               <Forget onSuccess={onSuccess}/>
           </div>
           document.getElementById('app')
       )
   </script>
   <div id="app"></div>

#component说明

Login 登录
    props定义
        onForget: PropTypes.func,    //点击忘记密码跳转route
        onSuccess: PropTypes.func,   //登录成功操作
        onRegister: PropTypes.func,  //点击注册跳转route

Forget 忘记密码
    props定义
        onSuccess: PropTypes.func,   //找回密码成功后的操作


Register 注册
    props定义
        onLogin: PropTypes.func,     //登录按钮跳转
        onSuccess: PropTypes.func,   //注册成功后的操作

ChangeEmail 修改注册邮箱
JoinAccount 账号关联邮箱
ChangePassWord 修改密码
ChangeAccountData   修改账号资料【头像,用户名】

#方法

       const {api} = new AccountCenter()

     // logout 登出
     api.logout()

     // logout 判断是否登录
     api.isLogin()

#遗留问题 批量注册(需求细化) app端的登录需求(直接去找接口的service,这边满足不了,除非是html嵌入的形式) oauth登录对接(ps:账号合并相关需求) Token传递给客户端的问题~~~预留~~~ Cookie的服务器渲染 oauth的中转页面~(route问题,需要定义) #其他 日志和数据统计(佳文的包来处理)

#目录说明

 |---dist 输出目录
     |---accountCenter.js    #browser版本的js包
     |---app.js    #react和npm版本的build结果
 |---example
     |---browser.html    #script引入方式
     |---bundle.js    #example build js
     |---index.html    #运行结果预览
 |---lib   #三方库
     |---browser.min.js    #用于react,浏览器端script引入方式的支持
 |---node_modules
 |---src
      |---api   #接口交互部分的逻辑定义(预留,等任博的接口。。。)
      |---components   #基础组件(只存放无状态的基础组件)
      |---locale   #国际化定义
      |---modules   #套件(完整逻辑的模块定义在这里)
      |---browser.js    #浏览器模块配置
      |---npm.js     #npm模块配置
      |---utils   #工具库
      |---app.less   #css核心,PC和mobile适配以及响应
 |---static    #静态资源
 |---index.js   #npm 出口
 |---webpack.config.js            #example配置
 |---webpack.prepublish.config    #build npm包
 |---webpack.prepublishbrowser.config.js   #build 浏览器版本的js
......