weiling-auth-track

文件监测和记录浏览时间
713
Install
npm install weiling-auth-track
Latest Version:0.0.3
Vue:2
Last Updated:Aug 18, 2021
Links: npm
Maintainer: liaocoder

授权+监听+分享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: ""
});

Version History

Version Released Vue License
0.0.3 ^2.6.11
0.0.2 ^2.6.11
0.0.1 ^2.6.11
0.0.0 ^2.6.11