1.0.1 • Published 4 years ago

@beisen/ocean-helper v1.0.1

Weekly downloads
25
License
MIT
Repository
-
Last release
4 years ago

ocean helper


提供统一的API,减少重复工作量

安装

  npm i -S @beisen/ocean-helper
  or
  yarn add @beisen/ocean-helper

API介绍

1. isDeveopCenterScene()

返回值: boolean 判断是否运行在开发中心的场景

2. isAppDevelop()

返回值: boolean 判断是否为开发中心-应用开发

3. isAppExtend()

返回值: boolean 判断是否为开发中心-应用扩展

4. unescape(str)

返回值: string 对字符串解码或反转义

5. generateAPI(initOption)

返回值: Object 根据初始化信息生成版本化接口生成器

示例
import Helper from '@beisen/ocean-helper';
const API = Helper.generateAPI({
  applicationName: 'I360',
  hostName: 'oceandev.italent-inc.cn', // 可不传,默认location.host
  tenantId: 11111 // 可不传,默认当前租户id
  userId: 1001111, // 可不传,默认当前用户id
});

const v1Url = API.v1('/ReportObjectField/GetReportObjectFieldListByOjbectId ')
// v1Url 等价于  '//oceandev.italent-inc.cn/api/v1/I360/11111/1001111/ReportObjectField/GetReportObjectFieldListByOjbectId'

const v2Url = API.v2('/ReportObjectField/GetReportObjectFieldListByOjbectId ')
// v1Url 等价于  '//oceandev.italent-inc.cn/api/v2/I360/11111/1001111/ReportObjectField/GetReportObjectFieldListByOjbectId'

PS:继承BSHelper,所以BSHelper中API也可以直接使用

1.0.1

4 years ago

0.0.1

4 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.1.20

5 years ago

2.1.19

5 years ago

2.1.18

5 years ago

2.1.17

5 years ago

2.1.16

5 years ago

2.1.10

5 years ago

2.1.9

5 years ago

2.1.8

5 years ago

2.1.6

5 years ago

2.1.4

5 years ago

2.0.31

5 years ago

2.0.29

5 years ago

2.0.28

5 years ago

2.0.27

5 years ago

2.0.22

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.3

5 years ago

1.0.0

5 years ago