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

@ablula/egg-yuque-viewer

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ablula/egg-yuque-viewer - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

lib/index.js

@@ -16,3 +16,3 @@ 'use strict';

if (search) {
router.get(`GetDocumentView-${search}`, `${search}`, async (ctx, next) => {
router.get(`GetDocumentView-${search}`, `${search}`, async ctx => {
const keywords = ctx.query.keywords;

@@ -19,0 +19,0 @@ if (!keywords) {

@@ -117,7 +117,26 @@ 'use strict';

const url = `${this.baseUrl}/repos/${config.namespace}/docs/${locator}`;
const result = await this.request(url);
if (!result || !result.data) {
app.logger.error(`Get document from lark failed, groupId: ${config.namespace}, locator: ${locator}`);
try {
const result = await this.request(url);
if (!result || !result.data) {
app.logger.error(`Get document from lark failed, groupId: ${config.namespace}, locator: ${locator}`);
return {
locator,
title: '',
data: '',
creator: '',
};
}
app.logger.info('getDocument SUCCESSFULLY');
const data = result && result.data || {};
const content = (data.body_html || '').replace(/<img/g, '<img referrerpolicy="no-referrer"');
return {
locator,
title: data.title,
data: content,
creator: data.creator && data.creator.name,
};
} catch (e) {
app.logger.error('getDocument failed: ' + e.message);
return {
locator,
title: '',

@@ -128,11 +147,2 @@ data: '',

}
app.logger.info('getDocument SUCCESSFULLY');
const data = result && result.data || {};
const content = (data.body_html || '').replace(/<img/g, '<img referrerpolicy="no-referrer"');
return {
locator,
title: data.title,
data: content,
creator: data.creator && data.creator.name,
};
}

@@ -139,0 +149,0 @@

{
"name": "@ablula/egg-yuque-viewer",
"author": "mark.ck",
"version": "0.1.5",
"version": "0.1.6",
"description": "egg plugin for yuque viewer",

@@ -6,0 +6,0 @@ "eggPlugin": {

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