暂时推送到服务器上先使用
This commit is contained in:
parent
83922109a2
commit
8a0a724fc3
|
|
@ -3,7 +3,7 @@ body {
|
|||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.div-hover {
|
||||
.divHover {
|
||||
background:#F5F5F5;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
|||
console.log("Hello bookmarksCtr...", $stateParams);
|
||||
$scope.bookmarks = []; // 书签数据
|
||||
$scope.showSearch = false; // 书签数据
|
||||
$scope.hoverItem = true;
|
||||
$scope.hoverItem = false;
|
||||
$scope.showStyle = 'navigate'; // 显示风格'navigate', 'card', 'table'
|
||||
semanticInit();
|
||||
|
||||
|
|
@ -76,13 +76,6 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
|
|||
},
|
||||
startCalendar: $('.ui.calendar.js-date-begin')
|
||||
});
|
||||
|
||||
$('.js-navigate-bookmark').hover(function() {
|
||||
$(this).addClass('div-hover');
|
||||
}, function() {
|
||||
//鼠标离开时移除divOver样式
|
||||
$(this).removeClass('div-hover');
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
<div class="one wide column">
|
||||
<span style="color:#0aa770;">{{ tag.name }}</span>
|
||||
</div>
|
||||
<div class="fourteen wide column">
|
||||
<div class="fifteen wide column">
|
||||
<div class="ui grid container">
|
||||
<div class="two wide column js-navigate-bookmark" ng-repeat="bookmark in tag.bookmarks" ng-click="jumpToUrl(bookmark.url)">
|
||||
<div class="two wide column js-navigate-bookmark" ng-class="{divHover:hoverItem}" ng-mouseover="hoverItem=true" ng-mouseleave="hoverItem=false" ng-repeat="bookmark in tag.bookmarks" ng-click="jumpToUrl(bookmark.url)">
|
||||
<img class="ui ui middle aligned tiny image" src="http://api.byi.pw/favicon/?url={{ bookmark.url }}" style="width:16px;height:16px">
|
||||
<span>{{ bookmark.title}}</span>
|
||||
</div>
|
||||
|
|
@ -16,18 +16,16 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="ui segment" ng-if="false">
|
||||
<button ng-mouseleave="count = count + 1" ng-init="count=0">
|
||||
Increment (when mouse leaves)
|
||||
</button> count: {{count}}
|
||||
<div class="ui raised" ng-repeat="tag in bookmarks">
|
||||
<!-- <a class="ui orange ribbon label" style="margin-bottom:20px">{{ tag.name }}</a> <span></span> -->
|
||||
<div class="ui grid container">
|
||||
<div class="two wide column">
|
||||
<i class="bookmark icon"></i><span>{{ tag.name }} </span>
|
||||
<i class="bookmark icon"></i>
|
||||
<span>{{ tag.name }}
|
||||
</span>
|
||||
<span>{{ hoverItem }}</span>
|
||||
</div>
|
||||
|
||||
<div class="two wide column js-navigate-bookmark" ng-class="{div-hover:hoverItem}" ng-mouseover="hoverItem=true" ng-mouseleave="hoverItem=false" ng-repeat="bookmark in tag.bookmarks" ng-click="jumpToUrl(bookmark.url)">
|
||||
<div class="two wide column js-navigate-bookmark" ng-repeat="bookmark in tag.bookmarks" ng-click="jumpToUrl(bookmark.url)">
|
||||
<img class="ui ui middle aligned tiny image" src="http://api.byi.pw/favicon/?url={{ bookmark.url }}" style="width:16px;height:16px">
|
||||
<span>{{ bookmark.title}}</span>
|
||||
</div>
|
||||
|
|
@ -35,7 +33,6 @@
|
|||
<div class="ui divider"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui small menu js-search-detail" ng-if="showSearch">
|
||||
<div class="ui dropdown item">
|
||||
<div class="text">搜索范围</div>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ var api = require('express').Router();
|
|||
var mysql = require('mysql');
|
||||
var crypto = require('crypto');
|
||||
var client = mysql.createConnection({
|
||||
host: '172.24.13.5',
|
||||
user: 'root',
|
||||
password: 'root123',
|
||||
host: '104.238.161.131',
|
||||
user: 'lcq',
|
||||
password: 'fendoubuxi596320',
|
||||
database: 'mybookmarks',
|
||||
multipleStatements: true,
|
||||
port: 3306
|
||||
|
|
@ -32,21 +32,21 @@ api.post('/login', function(req, res) {
|
|||
var params = req.body.params;
|
||||
var username = params.username;
|
||||
var password = md5(params.password);
|
||||
console.log('login......', params, password);
|
||||
|
||||
var sql = "SELECT * FROM `users` WHERE `username` = '"+ username +"'";
|
||||
var sql = "SELECT * FROM `users` WHERE `username` = '" + username + "'";
|
||||
client.query(sql, function(error, result, fields) {
|
||||
var id = '';
|
||||
var logined = false;
|
||||
console.log(password, result[0].password)
|
||||
if (!error && result.length === 1 && password === result[0].password) {
|
||||
var pass = !error && result.length === 1 && password === result[0].password
|
||||
console.log(password, result[0].password, pass)
|
||||
if (pass) {
|
||||
req.session.username = username;
|
||||
logined = true;
|
||||
id = result[0].id;
|
||||
}
|
||||
res.json({
|
||||
logined: logined,
|
||||
userId:id
|
||||
userId: id
|
||||
});
|
||||
})
|
||||
});
|
||||
|
|
@ -54,7 +54,7 @@ api.post('/login', function(req, res) {
|
|||
api.get('/autoLogin', function(req, res) {
|
||||
if (req.session.username) {
|
||||
console.log('session:' + req.session.username);
|
||||
var sql = "SELECT * FROM `users` WHERE `username` = '"+ req.session.username +"'";
|
||||
var sql = "SELECT * FROM `users` WHERE `username` = '" + req.session.username + "'";
|
||||
client.query(sql, function(error, result, fields) {
|
||||
var id = '';
|
||||
var logined = false;
|
||||
|
|
@ -66,13 +66,13 @@ api.get('/autoLogin', function(req, res) {
|
|||
}
|
||||
res.json({
|
||||
logined: logined,
|
||||
userId:id,
|
||||
userId: id,
|
||||
});
|
||||
})
|
||||
} else {
|
||||
res.json({
|
||||
logined: false,
|
||||
userId:'',
|
||||
userId: '',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue