diff --git a/login.html b/login.html index e6ed4c8f..a8919a16 100644 --- a/login.html +++ b/login.html @@ -37,7 +37,7 @@ if(process.platform != 'darwin') {

- Self-hosted Service @@ -75,7 +75,7 @@ if(process.platform != 'darwin') {
- +
@@ -91,8 +91,8 @@ if(process.platform != 'darwin') {
diff --git a/node_modules/evt.js b/node_modules/evt.js index 9b3cd024..b8bccdb6 100644 --- a/node_modules/evt.js +++ b/node_modules/evt.js @@ -12,9 +12,9 @@ if(!fs.existsSync(dataBasePath)) { // dataBasePath = ''; var Evt = { - defaultUrl: 'http://leanote.com', + defaultUrl: 'https://leanote.com', - leanoteUrl: 'http://leanote.com', + leanoteUrl: 'https://leanote.com', // leanoteUrl: 'http://localhost:9000', setHost: function(host) { @@ -23,6 +23,10 @@ var Evt = { } else { this.leanoteUrl = host; } + // leanote服务强制https + if (this.leanoteUrl === 'http://leanote.com') { + this.leanoteUrl = 'https://leanote.com'; + } }, getHost: function() { diff --git a/node_modules/note.js b/node_modules/note.js index 6573cdc7..7a681afc 100644 --- a/node_modules/note.js +++ b/node_modules/note.js @@ -432,18 +432,21 @@ var Note = { if(!content) { return content; } + // https, http都行 + var url = Evt.leanoteUrl.replace('https', 'https*'); + // http://leanote.com/file/outputImage?fileId=54f9079f38f4115c0200001b - var reg0 = new RegExp(Evt.leanoteUrl + '/file/outputImage', 'g'); + var reg0 = new RegExp(url + '/file/outputImage', 'g'); content = content.replace(reg0, Evt.localUrl + '/api/file/getImage'); - var reg = new RegExp(Evt.leanoteUrl + '/api/file/getImage', 'g'); + var reg = new RegExp(url + '/api/file/getImage', 'g'); content = content.replace(reg, Evt.localUrl + '/api/file/getImage'); - var reg2 = new RegExp(Evt.leanoteUrl + '/api/file/getAttach', 'g'); + var reg2 = new RegExp(url + '/api/file/getAttach', 'g'); content = content.replace(reg2, Evt.localUrl + '/api/file/getAttach'); // api/file/getAllAttachs?noteId=xxxxxxxxx, 这里的noteId是服务器上的noteId啊 - var reg3 = new RegExp(Evt.leanoteUrl + '/api/file/getAllAttachs', 'g'); + var reg3 = new RegExp(url + '/api/file/getAllAttachs', 'g'); content = content.replace(reg3, Evt.localUrl + '/api/file/getAllAttachs'); return content; @@ -454,6 +457,7 @@ var Note = { if(!content) { return content; } + // console.log(Evt.localUrl + '/api/file/getImage'); // console.log(content); var reg = new RegExp(Evt.localUrl + '/api/file/getImage', 'g'); diff --git a/public/langs/zh-cn.js b/public/langs/zh-cn.js index 03840d5a..a199ca22 100644 --- a/public/langs/zh-cn.js +++ b/public/langs/zh-cn.js @@ -218,7 +218,7 @@ "Sync now": "立即同步", "Custom server": "配置服务", - "Host, http://leanote.com": "服务地址, 如 http://leanote.com", + "Host, https://leanote.com": "服务地址, 如 https://leanote.com", "Username or Email": "用户名或邮箱", "Password": "密码", "Sign up": "注册", diff --git a/public/langs/zh-hk.js b/public/langs/zh-hk.js index f11c2d44..26805c15 100644 --- a/public/langs/zh-hk.js +++ b/public/langs/zh-hk.js @@ -218,7 +218,7 @@ "Sync now": "立即同步", "Custom server": "配置服務", - "Host, http://leanote.com": "服務地址, 如 http://leanote.com", + "Host, https://leanote.com": "服務地址, 如 https://leanote.com", "Username or Email": "用戶名或郵箱", "Password": "密碼", "Sign up": "註冊",