Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fzm

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fzm

https://www.33.cn

  • 1.5.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by10%
Maintainers
5
Weekly downloads
 
Created
Source

fzm

https://www.33.cn

安装

npm install --save fzm

restfuls、sp_restfuls的使用

import {restfuls,sp_restfuls} from 'fzm'; //如果接口返回规范的数据格式(详情请看后面)那么使用restfuls,如果是不规范的则使用sp_restfuls
const api = {
  getRegisterState(params){ //判断是否已注册。注意!get方式的请求params外面需要包裹一个大括号
    return restfuls.get(注册的接口地址,{ params });
  },
  login(params){ //快速登录
    return restfuls.post(快速登录的接口地址,params);
  },
  getKlineDate(params) { //获取k线数据 `这个接口返回的数据格式是不规范的,所以使用sp_restfuls`
    return sp_restfuls.get(chartOrigin + "/kdata", {params});
  },
}

想要使用restfuls方法,则必须要求接口返回的数据格式符合如下结构:

{
  code:200,
  data:{
    ...
  },
  message:"..."
}

notyf的使用

import {notyf} from 'fzm';
notyf.confirm("成功!")
notyf.alert("失败!")

date的使用

import {date} from 'fzm';
let time = date.format("Y-M-D h:m:s",new Date().getTime()); // 2018-6-20 13:12:23

object的使用

let o = {
  a:'aaa',
  b:'bbb'
}

object.hasOwnProps(o,'a','b');

同时支持以下的使用方式

import fzm from 'fzm';
fzm.notyf.confirm("成功!")
fzm.notyf.alert("失败!")

功能完成情况

  • object
  • date
  • notyf
  • restfuls
  • sp_restfuls

发现BUG

FAQs

Package last updated on 30 Nov 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc