Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
npm install --save fzm-ui
import Vue from 'vue'
import FzmUI from "fzm-ui"
Vue.use(FzmUI);
api
: Object 存放所有登录注册相关的http接口方法的对象 详细请查看下面
platkey
: String 项目标记
callback
: Function 登录和注册成功之后的回调方法 详细请查看下面
open
: Boolean 是否显示登录注册弹框,一般情况下这个属性是一个sync属性,所以请在open后面加上.sync
icon
: String 图标地址,不传递则没有图标,传入'default'则为默认图标(目前是找币的图标,以后会修改成33.cn的logo)
maxsec
: Number 验证码倒计时最大秒数,不传则为60秒
<template lang="html">
<div>
这里是登录注册的例子
<FzmLogReg :api="api" :platkey="'zhaobi'" :callback="cb" :open.sync="open" :icon="'default'"></FzmLogReg>
</div>
</template>
<script>
import api from './api.js'
export default {
data(){
return {
api,
cb(type,res){
console.log(type,res);
},
open:true
}
}
}
</script>
./api.js
const api = {
getRegisterState(params){ //判断是否已注册。注意!get方式的请求params外面需要包裹一个大括号
return restfuls.get(注册的接口地址,{ params });
},
getCodeBySms(params){ //获取短信验证码 post参数不需要加大括号
return restfuls.post(获取短信验证码的接口地址,params);
},
getCodeByEmail(params){ //获取邮箱验证码
return restfuls.post(获取邮箱验证码的接口地址,params);
},
getCodeByVoice(params){ //获取语音验证码
return restfuls.post(获取语音验证码的接口地址,params);
},
register(params){ //快速注册
return restfuls.post(快速注册的接口地址,params);
},
login(params){ //快速登录
return restfuls.post(快速登录的接口地址,params);
},
setPassword(params){ //第一次设置密码
return restfuls.post(第一次设置密码的接口地址,params);
},
resetPassword(params){ //找回密码
return restfuls.post(找回密码的接口地址,params);
}
}
callback
callback会得到两个参数: 第一个参数是回调类型,目前有两个值提供'login' 、 'register' 第二个参数是调用登录接口后返回的结果
export default {
data(){
return {
api,
cb(type,res){
switch(type){
case 'login':console.log(`登录成功,登录接口返回的信息是${res}`);break;
case 'register':console.log(`注册成功,注册接口返回的信息是${res}`);break;
}
}
}
}
}
点击记住密码会生成一个包含用户登录信息的cookie,cookie名为userinfo,有效时间为10天,值为一个json字符串
{
"area":{
"code":"+86",
"name":"中国"
},
"mobile":{
"type":"sms",
"number":"15888888888",
"password":"88888888"
},
"email":{
"number":"88888888@163.com",
"password":"88888888"
}
}
可以使用JSON.parse可以解析出该用户信息,然后进行操作
FAQs
https://www.33.cn
The npm package fzm-ui receives a total of 1 weekly downloads. As such, fzm-ui popularity was classified as not popular.
We found that fzm-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.