mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
leanote protocol移到main进程, 所有图片的操作通过db_client进行操作
This commit is contained in:
30
node_modules/evt.js
generated
vendored
30
node_modules/evt.js
generated
vendored
@@ -11,8 +11,6 @@ if(!fs.existsSync(dataBasePath)) {
|
||||
*/
|
||||
// dataBasePath = '';
|
||||
|
||||
var protocol = require('remote').require('protocol');
|
||||
|
||||
var Evt = {
|
||||
defaultUrl: 'https://leanote.com',
|
||||
|
||||
@@ -43,42 +41,28 @@ var Evt = {
|
||||
// https://github.com/atom/electron/commit/7d97bb6fe0a6feef886d927ea894bcb2f3521577
|
||||
// 老版本没有这个问题
|
||||
canUseProtocol: function () {
|
||||
return true;
|
||||
// return false;
|
||||
return protocol.registerFileProtocol;
|
||||
// return protocol.registerFileProtocol;
|
||||
},
|
||||
|
||||
getImageLocalUrlPrefix: function () {
|
||||
if (this.canUseProtocol()) {
|
||||
return 'leanote://file/getImage';
|
||||
}
|
||||
return this.localUrl + '/api/file/getImage';
|
||||
return 'leanote://file/getImage';
|
||||
},
|
||||
|
||||
getAttachLocalUrlPrefix: function () {
|
||||
if (this.canUseProtocol()) {
|
||||
return 'leanote://file/getAttach';
|
||||
}
|
||||
return this.localUrl + '/api/file/getAttach';
|
||||
return 'leanote://file/getAttach';
|
||||
},
|
||||
|
||||
getAllAttachsLocalUrlPrefix: function () {
|
||||
if (this.canUseProtocol()) {
|
||||
return 'leanote://file/getAllAttachs';
|
||||
}
|
||||
return this.localUrl + '/api/file/getAllAttachs';
|
||||
return 'leanote://file/getAllAttachs';
|
||||
},
|
||||
|
||||
getImageLocalUrl: function(fileId) {
|
||||
if (this.canUseProtocol()) {
|
||||
return 'leanote://file/getImage?fileId=' + fileId;
|
||||
}
|
||||
return this.localUrl + '/api/file/getImage?fileId=' + fileId;
|
||||
return 'leanote://file/getImage?fileId=' + fileId;
|
||||
},
|
||||
getAttachLocalUrl: function(fileId) {
|
||||
if (this.canUseProtocol()) {
|
||||
return 'leanote://file/getAttach?fileId=' + fileId;
|
||||
}
|
||||
return this.localUrl + '/api/file/getAttach?fileId=' + fileId;
|
||||
return 'leanote://file/getAttach?fileId=' + fileId;
|
||||
},
|
||||
getAllAttachLocalUrl: function(noteId) {
|
||||
return this.localUrl + '/api/file/getAllAttachs?noteId=' + noteId;
|
||||
|
Reference in New Issue
Block a user