Socket
Socket
Sign inDemoInstall

dfws-channel

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dfws-channel

东方网升 接口header公共渠道


Version published
Maintainers
1
Created

Readme

Source

东方网升 header头公共渠道组件

发布

  1. 更改package.json版本
  2. yarn run build
  3. npm publish 注:镜像源需切换回NPM官方源

链接

  • 更新日志

示例

  • yarn
  • yarn start

使用之前

该组件用于taro、react和jquery版本。

何时使用

  • 项目公共 header 参数配置。

API

jquery 版本

<script src="https://f3-df.veimg.cn/common/lib/dfws-channel.min.js"></script>
<script>
//具体配置:管理后台-最佳东方-系统设置-渠道管理
var channel = { "project": "VE", "origin": "C", "platform": "PC", "device": "ZJDF","version":" 1.0.0" };
var dfws_params = window.getPublicChannel(channel);
console.log(dfws_params, 'dfws_params')
</script>

react/vue 版本

import getPublicChannel from "dfws-channel"

//具体配置:管理后台-最佳东方-系统设置-渠道管理
const channel = { "project": "VE", "origin": "C", "platform": "PC", "device": "ZJDF","version":" 1.0.0" };
/**
 * 东方网升项目公共 header
 * @param {object} params
 */
const dfws_params = JSON.stringify(getPublicChannel(channel));

taro 小程序版本

import Taro from '@tarojs/taro'
import getPublicChannel from "dfws-channel/dist/taro"

//具体配置:管理后台-最佳东方-系统设置-渠道管理
const channel = { "project": "VE", "origin": "C", "platform": "XCX", "device": "ZJDF","version":" 1.0.0" };
/**
 * 东方网升项目公共 header
 * @param {object} dfws_header
 */
const dfws_header = getPublicChannel(channel, Taro)
// 获取网络环境
dfws_header.getNetworkType(network => {
  channel.network = network
})
const dfws_params= JSON.stringify(dfws_header.xcxQueryChannels())

props

参数说明类型默认值
channel公共渠道配置参数object-

返回值

{"project":"VE","origin":"C","device":"ZJDF","network":"4G","device_brand":"unknown","system":"unknown","system_version":"unknown","version":"1.0.0","browser":"chrome","browser_version":"121.0.0.0","screen":"1920*1080","platform":"PC"}

参考文档

渠道管理

Keywords

FAQs

Last updated on 25 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc