diff --git a/src/controller/api.js b/src/controller/api.js
index 41679ac..e8dc94c 100644
--- a/src/controller/api.js
+++ b/src/controller/api.js
@@ -11,7 +11,7 @@ function md5(str) {
module.exports = class extends Base {
async __before() {
- if (['userRegister', 'userLogin'].indexOf(this.ctx.action) >= 0) {
+ if (['userRegister', 'userLogin', 'noteShare'].indexOf(this.ctx.action) >= 0) {
return;
}
try {
@@ -584,4 +584,27 @@ module.exports = class extends Base {
this.json({ code: 1, msg: error.toString() });
}
}
+
+ async noteShareAction() {
+ let id = this.get("id");
+ let note = await this.model('notes').where({ id, public: 1 }).find();
+ let body = think.isEmpty(note) ? "备忘为非公开或者已删除!" : note.content;
+ this.body = `
+
+
+
+
+
+ `;
+ }
};
diff --git a/www/404.html b/www/404.html
index e33b993..8da0ee7 100644
--- a/www/404.html
+++ b/www/404.html
@@ -56,7 +56,7 @@
对不起,您的风筝已掉线,请时光倒流回前一秒。
5秒后自动
- 返回首页
+ 返回首页
@@ -71,7 +71,7 @@
}
setInterval(function() {
if (second < 0) {
- location.href = "http://mybookmark.cn";
+ location.href = document.location.origin;
} else {
if (navigator.appName.indexOf("Explorer") > -1) {
document.getElementById("totalSecond").innerText = second--;
diff --git a/www/scripts/controllers/note-controller.js b/www/scripts/controllers/note-controller.js
index 64b2d71..a4f13e0 100644
--- a/www/scripts/controllers/note-controller.js
+++ b/www/scripts/controllers/note-controller.js
@@ -262,8 +262,8 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
time = 1000;
}
setTimeout(() => {
- dataService.clipboard(`https://mybookmark.cn/api/notes/?shareNote=${note.id}`);
- toastr.info(`将地址 https://mybookmark.cn/api/notes/?shareNote=${note.id} 发给别人粘贴到浏览器地址栏就可以访问到你分享的备忘啦!`, "提示");
+ dataService.clipboard(`${document.location.origin}/api/noteShare/?id=${note.id}`);
+ toastr.info(`将地址 ${document.location.origin}/api/noteShare/?id=${note.id} 发给别人粘贴到浏览器地址栏就可以访问到你分享的备忘啦!`, "提示");
}, time)
}
@@ -273,7 +273,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
public: public,
}
- await post("updateNode", params);
+ await post("noteUpdate", params);
note.public = public;
}
diff --git a/www/scripts/controllers/weixin-article-controller.js b/www/scripts/controllers/weixin-article-controller.js
index 5f89a43..7fbe4c1 100644
--- a/www/scripts/controllers/weixin-article-controller.js
+++ b/www/scripts/controllers/weixin-article-controller.js
@@ -285,7 +285,7 @@ app.controller('weixinArticleCtr', ['$scope', '$state', '$sce', '$filter', '$win
b.account = articl.weixinaccount;
b.snapUrl = articl.pic || defaultSnap;
b.favCount = articl.likenum;
- b.created_at = timeagoInstance.format(cdate, 'zh_CN');
+ b.createdAt = timeagoInstance.format(cdate, 'zh_CN');
b.content = articl.content
b.content = b.content.replace(/https:\/\/mmbiz.qpic.cn/gi, "http://img01.store.sogou.com/net/a/04/link?appid=100520029&url=https://mmbiz.qpic.cn")
b.content = b.content.replace(/http:\/\/mmbiz.qpic.cn/gi, "http://img01.store.sogou.com/net/a/04/link?appid=100520029&url=https://mmbiz.qpic.cn")
diff --git a/www/views/edit.html b/www/views/edit.html
index 9b1eb3c..7c03978 100644
--- a/www/views/edit.html
+++ b/www/views/edit.html
@@ -9,7 +9,7 @@