🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

ky-nice-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ky-nice-utils

js utils

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

nice-utils

UtilDescRemarks
core基础方法集合-
fetch客户端ajax网络请求封装-
wdiowilddog io 操作封装需在 <head> 标签中添加 <script src="https://cdn.wilddog.com/js/client/current/wilddog.js"&gt;&lt;/script> 配合使用
storagelocalStorage 操作封装-
validatorrc-form 表单校验方法方法接收3个参数 (rule, value, callback)

fetch

import { fetch } from "@nice/nice-utils";

const { get, post } = fetch;

// get请求:

fetch("/yapi/list-page", {
  pageNumber,
  pageSize,
});

// get请求2:

fetch({
  url: "/yapi/list-page",
  data: {
    pageNumber,
    pageSize,
  }
});

// get请求3:

get("/yapi/list-page", {
  pageNumber,
  pageSize,
});

// post请求:

fetch({
  url: "/yapi/list-page-delete",
  method: "post",
  headers: { "X-TOKEN": "e10adc3949ba59abbe56e057f20f883e"}
  data: {
    bid,
  }
});

// post请求2:

post("/yapi/list-page-delete", { bid });

wdio

import { wdio } from "@nice/nice-utils";

const { each, remove, add, set, get } = wdio;

each(ref, fn);

remove(ref, id);

add(ref, item);

set(ref, item);

get(ref, fn)

storage

import { local_storage, session_storage } from "@nice/nice-utils";

local_storage.set(key, value);
local_storage.get(key);
local_storage.remove(key);
local_storage.clear();

session_storage.set(key, value);
session_storage.get(key);
session_storage.remove(key);
session_storage.clear();

validator

import { validator } from "@nice/nice-utils";

const { amountValidator } = validator;

getFieldDecorator("bid", {
  rules: [
    { required: true, message: "bid不能为空" },
    { validator: amountValidator },
  ]
})

FAQs

Package last updated on 02 Feb 2020

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