完成单用户使用
This commit is contained in:
parent
b55058dae8
commit
4498a45aa4
|
|
@ -51,7 +51,7 @@
|
|||
<div class="ui container" style="width:100%;height:10px"></div>
|
||||
<div class="foot" style="margin-bottom:10px;">
|
||||
<div class="ui segment container">
|
||||
我爱佳佳与这个世界 | Copyleft ©All Rights Reserved LCQ | <a href="http://m.xusony.com/">移动设备访问</a> | 联系我(QQ:530485521) | <a href="https://github.com/luchenqun/my-bookmark" target="_blank">网站源码</a> | V1.5.0 | <span>加载失败,请按F5!(●'◡'●)</span><br/>
|
||||
Copyleft ©All Rights Reserved xusony | <a href="http://m.xusony.com/">移动设备访问</a> | <a href="https://github.com/luchenqun/my-bookmark" target="_blank">网站源码</a> | V1.5.0 | <span>加载失败,请按F5!(●'◡'●)</span><br/>
|
||||
</div>
|
||||
<!-- 主要用来配合clipboard.min.js复制文本的 -->
|
||||
<div id="clipboard" data-clipboard-text="i love this world and jiajia!" style="opacity:0;cursor:default">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ app.controller('loginCtr', ['$scope', '$filter', '$state', '$cookieStore', '$win
|
|||
return;
|
||||
}
|
||||
|
||||
$state.go('tags');
|
||||
|
||||
pubSubService.publish('Common.menuActive', {
|
||||
login: false,
|
||||
index: dataService.NotLoginIndexLogin
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$timeout', '$document', 'pubSubService', 'bookmarkService', 'dataService', function ($scope, $stateParams, $state, $window, $timeout, $document, pubSubService, bookmarkService, dataService) {
|
||||
app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$timeout', '$document', 'ngDialog', 'pubSubService', 'bookmarkService', 'dataService', function ($scope, $stateParams, $state, $window, $timeout, $document, ngDialog, pubSubService, bookmarkService, dataService) {
|
||||
console.log("Hello menuCtr")
|
||||
$scope.login = false; /**< 是否登陆 */
|
||||
$scope.login = true; /**< 是否登陆 */
|
||||
$scope.logined = false; // 是不是授权了
|
||||
$scope.selectLoginIndex = 0; /**< 默认登陆之后的选择的菜单索引,下表从 0 开始 */
|
||||
$scope.selectNotLoginIndex = 0; /**< 默认未登陆之后的选择的菜单索引,下表从 0 开始 */
|
||||
$scope.searchWord = ''; /**< 搜索关键字 */
|
||||
|
|
@ -9,12 +10,16 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
$scope.historyTypes = dataService.historyTypes;
|
||||
$scope.quickUrl = {};
|
||||
$scope.longPress = false;
|
||||
$scope.username = "";
|
||||
$scope.password = "";
|
||||
$scope.user = {};
|
||||
|
||||
var dialog = null;
|
||||
|
||||
// 防止在登陆的情况下,在浏览器里面直接输入url,这时候要更新菜单选项
|
||||
pubSubService.subscribe('Common.menuActive', $scope, function (event, params) {
|
||||
console.log("subscribe Common.menuActive, login = " + params.login + ", index = " + params.index);
|
||||
$scope.login = (params && params.login) || false;
|
||||
$scope.login = true;
|
||||
var index = $scope.login ? ($scope.selectLoginIndex = (params && params.index) || 0) : ($scope.selectNotLoginIndex = (params && params.index) || 0);
|
||||
updateMenuActive(index);
|
||||
});
|
||||
|
|
@ -26,39 +31,90 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
$scope.loginMenus = dataService.loginMenus; // 登陆之后显示的菜单数据。uiSerf:内部跳转链接。
|
||||
$scope.notLoginMenus = dataService.notLoginMenus; // 未登陆显示的菜单数据
|
||||
|
||||
bookmarkService.autoLogin()
|
||||
.then((data) => {
|
||||
pubSubService.publish('loginCtr.login', {
|
||||
'login': data.logined,
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
pubSubService.publish('loginCtr.login', {
|
||||
'login': data.logined,
|
||||
});
|
||||
});
|
||||
|
||||
bookmarkService.userInfo({})
|
||||
.then((data) => {
|
||||
$scope.user = data;
|
||||
if(data.username === 'lcq') {
|
||||
$scope.loginMenus[dataService.LoginIndexHot].show = false;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
.then((data) => {
|
||||
$scope.user = data;
|
||||
if (data.username === 'lcq') {
|
||||
$scope.loginMenus[dataService.LoginIndexHot].show = false;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$scope.toggleReady = function(ready) {
|
||||
if(ready) {
|
||||
bookmarkService.logined({})
|
||||
.then((data) => {
|
||||
$scope.logined = data.logined;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
});
|
||||
|
||||
$scope.openLoginDialog = function () {
|
||||
dialog = ngDialog.open({
|
||||
template: './views/dialog-login.html',
|
||||
className: 'ngdialog-theme-default',
|
||||
scope: $scope
|
||||
});
|
||||
}
|
||||
|
||||
$scope.userLogin = function (username, password) {
|
||||
var params = {
|
||||
username: username,
|
||||
password: password,
|
||||
autoLogin: true,
|
||||
};
|
||||
$scope.logined = false;
|
||||
bookmarkService.login(params)
|
||||
.then((data) => {
|
||||
if (data.logined) {
|
||||
pubSubService.publish('loginCtr.login', {
|
||||
'login': data.logined,
|
||||
});
|
||||
ngDialog.close(dialog);
|
||||
$scope.logined = true;
|
||||
toastr.success("登陆成功")
|
||||
} else {
|
||||
toastr.error('账号或者密码错误', "错误");
|
||||
}
|
||||
})
|
||||
.catch((err) => console.log('login err', err));
|
||||
}
|
||||
|
||||
$scope.toggleReady = function (ready) {
|
||||
if (ready) {
|
||||
$(".searchIcon").show();
|
||||
} else {
|
||||
$timeout(function(){
|
||||
$timeout(function () {
|
||||
!$("#sInput").val() && $(".searchIcon").hide();
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
$scope.searchIcon = function(item) {
|
||||
if(item.t === 0) {
|
||||
$scope.searchIcon = function (item) {
|
||||
if (item.t === 0) {
|
||||
item.icon = "book link icon";
|
||||
} else if(item.t === 1) {
|
||||
} else if (item.t === 1) {
|
||||
item.icon = "google link icon";
|
||||
} else if(item.t === 2) {
|
||||
} else if (item.t === 2) {
|
||||
item.icon = "github link icon";
|
||||
} else if(item.t === 3) {
|
||||
} else if (item.t === 3) {
|
||||
item.icon = "stack overflow link icon";
|
||||
} else if(item.t === 4) {
|
||||
} else if (item.t === 4) {
|
||||
item.icon = "bimobject link icon";
|
||||
} else if(item.t === 5) {
|
||||
} else if (item.t === 5) {
|
||||
item.icon = "file alternate link icon";
|
||||
}
|
||||
}
|
||||
|
|
@ -76,14 +132,14 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
|
||||
$scope.login = true;
|
||||
// var searchOption = $('.js-search-option').dropdown('get value') || 0;
|
||||
if (searchOption == 0) {
|
||||
if (searchOption == 1) {
|
||||
$state.go('search', {
|
||||
searchWord: searchWord,
|
||||
}, {
|
||||
reload: true,
|
||||
})
|
||||
reload: true,
|
||||
})
|
||||
updateMenuActive($scope.selectLoginIndex = 0);
|
||||
} else if (searchOption == 1) {
|
||||
} else if (searchOption == 0) {
|
||||
$window.open('https://www.google.com.hk/#newwindow=1&safe=strict&q=' + encodeURIComponent(searchWord), '_blank');
|
||||
} else if (searchOption == 2) {
|
||||
$window.open('https://github.com/search?utf8=%E2%9C%93&q=' + encodeURIComponent(searchWord) + '&type=', '_blank');
|
||||
|
|
@ -96,8 +152,8 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
$state.go('note', {
|
||||
searchWord: searchWord,
|
||||
}, {
|
||||
reload: true,
|
||||
})
|
||||
reload: true,
|
||||
})
|
||||
updateMenuActive($scope.selectLoginIndex = dataService.LoginIndexNote);
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +211,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
if (delIndex >= 0) {
|
||||
$scope.searchHistory.splice(delIndex, 1);
|
||||
}
|
||||
if(!type && !data) {
|
||||
if (!type && !data) {
|
||||
$scope.searchHistory = [];
|
||||
}
|
||||
saveHistory();
|
||||
|
|
@ -172,8 +228,8 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
$state.go('bookmarks', {
|
||||
showStyle: showStyle,
|
||||
}, {
|
||||
reload: true,
|
||||
})
|
||||
reload: true,
|
||||
})
|
||||
}
|
||||
|
||||
$scope.showAddBookmarkMoadl = function () {
|
||||
|
|
@ -186,8 +242,18 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
bookmarkService.logout({})
|
||||
.then((data) => {
|
||||
console.log('logout..........', data)
|
||||
$scope.login = false;
|
||||
$state.go('login', {})
|
||||
$scope.logined = false;
|
||||
bookmarkService.autoLogin()
|
||||
.then((data) => {
|
||||
pubSubService.publish('loginCtr.login', {
|
||||
'login': data.logined,
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
pubSubService.publish('loginCtr.login', {
|
||||
'login': data.logined,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((err) => console.log('logout err', err));
|
||||
}
|
||||
|
|
@ -291,7 +357,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
// 有时候没有检测到keyup,会一直按无效,干脆过个3秒就认为你抬起来了
|
||||
// 反正你按下我还是会给你标记为true的。
|
||||
$timeout(function () {
|
||||
$scope.longPress = false;
|
||||
$scope.longPress = false;
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
|
|
@ -308,10 +374,10 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
if (key == 'S') {
|
||||
$(".search-item").focus();
|
||||
var count = 1;
|
||||
var sId = setInterval(function() {
|
||||
var sId = setInterval(function () {
|
||||
$(".search-item").val("");
|
||||
count++;
|
||||
if(count>=5) {
|
||||
if (count >= 5) {
|
||||
clearInterval(sId);
|
||||
}
|
||||
}, 3)
|
||||
|
|
@ -320,7 +386,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
|
||||
if (key == ',' || key == '.' || key == '/') {
|
||||
pubSubService.publish('Common.menuActive', {
|
||||
login: $scope.login,
|
||||
login: true,
|
||||
index: dataService.LoginIndexTags
|
||||
});
|
||||
var stateParams = {
|
||||
|
|
@ -333,7 +399,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
// 数字键用来切换菜单
|
||||
if (!isNaN(key)) {
|
||||
var num = parseInt(key);
|
||||
if(num < 0 || num > 6) return;
|
||||
if (num < 0 || num > 6) return;
|
||||
pubSubService.publish('Common.menuActive', {
|
||||
login: $scope.login,
|
||||
index: num - 1
|
||||
|
|
@ -349,18 +415,18 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', '$window', '$time
|
|||
url: url,
|
||||
}
|
||||
bookmarkService.jumpQuickUrl(params)
|
||||
.then((data) => {
|
||||
if(!data.id){
|
||||
toastr.info('网址:' + url + "还没添加到你的书签系统,请添加!", "警告");
|
||||
var bookmark = {
|
||||
url: url
|
||||
.then((data) => {
|
||||
if (!data.id) {
|
||||
toastr.info('网址:' + url + "还没添加到你的书签系统,请添加!", "警告");
|
||||
var bookmark = {
|
||||
url: url
|
||||
}
|
||||
pubSubService.publish('TagCtr.storeBookmark', bookmark);
|
||||
}
|
||||
pubSubService.publish('TagCtr.storeBookmark', bookmark);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ app.factory('bookmarkService', ['$http', '$q', function($http, $q) {
|
|||
});
|
||||
return def.promise;
|
||||
},
|
||||
logined: function() {
|
||||
var def = $q.defer();
|
||||
$http.get('/api/logined/', {})
|
||||
.success(function(data) {
|
||||
def.resolve(data);
|
||||
})
|
||||
.error(function(data) {
|
||||
def.reject(data);
|
||||
});
|
||||
return def.promise;
|
||||
},
|
||||
register: function(params) {
|
||||
var def = $q.defer();
|
||||
$http.post('/api/register/', {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ app.factory('dataService', [function() {
|
|||
netErrorHandle(err, $state) {
|
||||
if(err == "Unauthorized") {
|
||||
// $state.go("login");
|
||||
// toastr.error('您好像没有登陆,或者登陆session过期了,请重新登陆!', "提示");
|
||||
toastr.error('您没有权限做此操作,请先登录!', "提示");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<div class="ngdialog-message">
|
||||
<h3>登录</h3>
|
||||
</div>
|
||||
<hr color=#987cb9 SIZE=1>
|
||||
<div class="dialog-contents">
|
||||
<span style="width: 20%;">账号:</span><input type="text" ng-model="username" style="width: 80%;">
|
||||
<br /><br />
|
||||
<span style="width: 20%;">密码:</span><input type="password" ng-model="password" style="width: 80%;">
|
||||
</div>
|
||||
<p></p>
|
||||
<div class="ngdialog-buttons">
|
||||
<button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="userLogin(username, password)">确定</button>
|
||||
<button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog('button')">取消</button>
|
||||
</div>
|
||||
|
|
@ -48,27 +48,22 @@
|
|||
</div>
|
||||
<div style="margin-top: 13px;">
|
||||
<span style="display: none" class="searchIcon">
|
||||
<span style="margin-left: -25px;"><i class="google link icon" title="谷歌搜索(输入关键字按回车键默认搜索引擎)" ng-click="search(searchWord, 1)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="bimobject link icon" title="百度搜索" ng-click="search(searchWord, 4)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="book link icon" title="书签搜索" ng-click="search(searchWord, 0)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="book link icon" title="书签搜索(输入关键字按回车键默认搜索)" ng-click="search(searchWord, 0)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="file alternate link icon" title="备忘录搜索" ng-click="search(searchWord, 5)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="github link icon" title="Github 搜索" ng-click="search(searchWord, 2)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="stack overflow link icon" title="栈溢出搜索" ng-click="search(searchWord, 3)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="google link icon" title="谷歌搜索" ng-click="search(searchWord, 1)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span><i class="bimobject link icon" title="百度搜索" ng-click="search(searchWord, 4)" style="cursor:default;margin-right: 8px;"></i></span>
|
||||
<span style="margin: 0px 5px">▏</span>
|
||||
</span>
|
||||
<span data-tooltip="添加书签,可按Insert快速打开添加页面" ng-click="showAddBookmarkMoadl()">
|
||||
<i class="add square link icon" style="cursor:default;margin-right: 8px;margin-left: 1px;"></i>
|
||||
</span>
|
||||
<span data-tooltip="如果你觉得我的系统对你有帮助,请点击跳转到 Github 为我 Star" ng-click="star()" ng-show="user.username !== 'lcq'">
|
||||
<i class="star link icon" style="cursor:default;margin-right: 8px;"></i>
|
||||
</span>
|
||||
<span class="suggest" ng-click="showUpdate()" ng-show="user.username !== 'lcq'">
|
||||
<i class="info circle link icon" style="cursor:default;margin-right: 8px;"></i>
|
||||
</span>
|
||||
<span data-tooltip="请我喝杯咖啡" ng-click="coffee()" ng-show="user.username !== 'lcq'">
|
||||
<i class="coffee link icon" style="cursor:default;margin-right: 8px;"></i>
|
||||
<span data-tooltip="登录" ng-if="!logined" ng-click="openLoginDialog()">
|
||||
<i class="sign in link icon" style="cursor:default;margin-right: 8px;"></i>
|
||||
</span>
|
||||
<span data-tooltip="退出登陆" ng-click="logout()">
|
||||
<span data-tooltip="退出" ng-if="logined" ng-click="logout()">
|
||||
<i class="sign out link icon" style="cursor:default;margin-right: 8px;"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ api.post('/jumpQuickUrl', function(req, res) {
|
|||
.catch((err) => console.log('jumpQuickUrl err', err)); // oops!
|
||||
});
|
||||
|
||||
api.get('/logined', function(req, res) {
|
||||
res.json({ logined: req.session.logined ? true : false });
|
||||
});
|
||||
|
||||
api.post('/login', function(req, res) {
|
||||
var params = req.body.params;
|
||||
var username = params.username;
|
||||
|
|
@ -90,6 +94,7 @@ api.post('/login', function(req, res) {
|
|||
req.session.user = user;
|
||||
req.session.username = ret.user.username;
|
||||
req.session.userId = ret.user.id;
|
||||
req.session.logined = true;
|
||||
}
|
||||
ret.user.password = "*";
|
||||
res.json(ret);
|
||||
|
|
@ -126,24 +131,28 @@ api.get('/userInfo', function(req, res) {
|
|||
});
|
||||
|
||||
api.post('/register', function(req, res) {
|
||||
var params = req.body.params;
|
||||
params.password = md5(params.password); // 进行密码加密
|
||||
res.json({
|
||||
retCode: 1,
|
||||
msg: "不支持注册!",
|
||||
})
|
||||
// var params = req.body.params;
|
||||
// params.password = md5(params.password); // 进行密码加密
|
||||
|
||||
db.register(params)
|
||||
.then((affectedRows) => {
|
||||
res.json({
|
||||
retCode: 0,
|
||||
msg: params.username + " 注册成功 ",
|
||||
})
|
||||
console.log('register affectedRows ', affectedRows)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('login error', err);
|
||||
res.json({
|
||||
retCode: 1,
|
||||
msg: params.username + " 注册失败: " + JSON.stringify(err),
|
||||
})
|
||||
});
|
||||
// db.register(params)
|
||||
// .then((affectedRows) => {
|
||||
// res.json({
|
||||
// retCode: 0,
|
||||
// msg: params.username + " 注册成功 ",
|
||||
// })
|
||||
// console.log('register affectedRows ', affectedRows)
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log('login error', err);
|
||||
// res.json({
|
||||
// retCode: 1,
|
||||
// msg: params.username + " 注册失败: " + JSON.stringify(err),
|
||||
// })
|
||||
// });
|
||||
});
|
||||
|
||||
api.post('/resetPassword', function(req, res) {
|
||||
|
|
@ -186,7 +195,7 @@ api.post('/resetPassword', function(req, res) {
|
|||
|
||||
api.post('/updateShowStyle', function(req, res) {
|
||||
console.log("updateShowStyle username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -252,7 +261,7 @@ api.post('/updateSearchHistory', function(req, res) {
|
|||
|
||||
api.post('/updateQuickUrl', function(req, res) {
|
||||
console.log("updateQuickUrl username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -303,7 +312,7 @@ api.get('/autoLogin', function(req, res) {
|
|||
|
||||
api.delete('/delBookmark', function(req, res) {
|
||||
console.log("delBookmark username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -329,7 +338,7 @@ api.delete('/delBookmark', function(req, res) {
|
|||
|
||||
api.post('/updateBookmark', function(req, res) {
|
||||
console.log("updateBookmark username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -704,7 +713,7 @@ api.get('/advices', function(req, res) {
|
|||
|
||||
api.post('/addAdvice', function(req, res) {
|
||||
console.log("addAdvice username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -732,7 +741,7 @@ api.post('/addAdvice', function(req, res) {
|
|||
// 发现使用node启动没问题,forever启动有问题。
|
||||
api.post('/uploadBookmarkFile', upload.single('bookmark'), function(req, res) {
|
||||
console.log("uploadBookmarkFile username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -819,7 +828,7 @@ api.post('/uploadBookmarkFile', upload.single('bookmark'), function(req, res) {
|
|||
|
||||
api.post('/addBookmark', function(req, res) {
|
||||
console.log("addBookmark username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -863,7 +872,7 @@ api.post('/addBookmark', function(req, res) {
|
|||
|
||||
api.post('/favoriteBookmark', function(req, res) {
|
||||
console.log("favoriteBookmark username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -919,7 +928,7 @@ api.post('/favoriteBookmark', function(req, res) {
|
|||
|
||||
api.post('/addTags', function(req, res) {
|
||||
console.log("addTags username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -948,7 +957,7 @@ api.post('/addTags', function(req, res) {
|
|||
|
||||
api.post('/updateTagName', function(req, res) {
|
||||
console.log("updateTagName username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -991,7 +1000,7 @@ api.post('/updateTagName', function(req, res) {
|
|||
|
||||
api.post('/updateTagShow', function(req, res) {
|
||||
console.log("updateTagShow username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1034,7 +1043,7 @@ api.post('/updateTagShow', function(req, res) {
|
|||
|
||||
api.post('/updateTagsIndex', function(req, res) {
|
||||
console.log("updateTagsIndex username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1071,7 +1080,7 @@ api.post('/delTag', function(req, res) {
|
|||
})
|
||||
return;
|
||||
}
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1425,7 +1434,7 @@ api.getHotBookmarksByTimer = function() {
|
|||
|
||||
api.post('/addNote', function(req, res) {
|
||||
console.log("addNote username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1502,7 +1511,7 @@ api.get('/notes', function(req, res) {
|
|||
|
||||
api.delete('/delNote', function(req, res) {
|
||||
console.log("delBookmark username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1521,7 +1530,7 @@ api.delete('/delNote', function(req, res) {
|
|||
|
||||
api.post('/updateNote', function(req, res) {
|
||||
console.log("updateNote username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1542,7 +1551,7 @@ api.post('/updateNote', function(req, res) {
|
|||
|
||||
api.post('/updateNotePublic', function(req, res) {
|
||||
console.log("updateNotePublic username = ", req.session.username);
|
||||
if (!req.session.user) {
|
||||
if (!req.session.logined) {
|
||||
res.send(401);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue