1.0.0 • Published 3 days ago

icity-community-sdk v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 days ago

icity-community-sdk

NPM version NPM downloads

Install

npm i icity-community-sdk
OR
yarn add icity-community-sdk

Use

useUserInfoByLevel(context)

参数

context 必填,当前 React 上下文,配合ReactContext
ContextProps为icp.getUserInfo()返回值

返回值

ParamsProps {
userType: number; // 当前账号级别 市 10 区县 0 街镇 1 社区村 2
status: number; // 当前账号级别 市 0 区县 1 街镇 2 社区村 3
cityCode?: string;
areaCode?: string;
streetCode?: string;
communityCode?: string;
}
useScroll(id,speed)

参数

id 必填,DomId
speed 非必填,滚动速度
ValidatePhone
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidatePhone
  value="178******96"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
ValidateIdCard
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidateIdCard
  value="3**************1"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
ValidateName
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidateName
  value="*三"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
AES
// 加密
aesEncrypt(val, key);
// 解密
aesDecrypt(val, key);
数据脱敏
encryptName(name); // *三
encryptIdCard(idCard); // 1*****************1
encryptPhone(phone); // 178******12

LICENSE

MIT

1.0.0

3 days ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.5

4 months ago

0.0.4

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago