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

weiling-auth-track

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weiling-auth-track

文件监测和记录浏览时间

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

授权+监听+分享sdk

组件引入

import AuthTrack from "weiling-auth-track";

##实例化组件 需要传入一个api域名。

const Api = process.env.VUE_APP_API;
const Auth = new AuthTrack(Api);

Auth类里面包含三个方法。

  1. checkAuth:判断是否已授权,如果没做授权会302重定向,返回一个布尔值,表示是否需要显示卫瓴授权弹框。
//判断是否已授权
Auth.checkAuth().then((privacy_agreement_check: boolean) => {
  if (!privacy_agreement_check) state.monitoring_authorization = true;
  onGetDetail();
});
  1. shareSDK:如果需要分享的话需要调这个类,需要传入以下参数。
  • title - 标题
  • desc - 描述
  • icon - 图标
  • corpId - 企业id
  • materialId - 物料id
Auth.shareSDK({
  title:"",
  desc:"",
  icon:"",
  corpId: "",
  materialId: ""
});
  1. watchTime:如果需要监控浏览时长的话调这个类,需要传入以下参数。
  • pEventId - 父级的event_id,url上的event_id就是
  • corpId - 企业id
  • materialId - 物料id
Auth.shareSDK({
  title:"",
  desc:"",
  icon:"",
  corpId: "",
  materialId: ""
});

FAQs

Package last updated on 18 Aug 2021

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