- 用户名+ 密码 =》 id + token
- str = [参数, random_number] 字典升序.join('')
- sign = md5( id + str + token);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createConstAndAction, createFetchTypesAndFuncs } from './utils'; | |
export const { PRODUCTS, products } = createFetchTypesAndFuncs('products'); | |
export const { LOAD_PRODUCTS, loadProducts } = createConstAndAction('LOAD_PRODUCTS'); | |
// these actions is for pull-to-load-more | |
export const { LOAD_MORE_PRODUCTS, loadMoreProducts } = createConstAndAction('LOAD_MORE_PRODUCTS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGNZu2pGtdBIWpnJINd6RCl3o0nQbezTz6PrZw1UfD6A5rcrM5omctggNcMxDiDGmcP8riQ7qrfc9IPg1Q5g3ylJq1N3/oXBgGoaza0pD9MNYQq6eeuCZoKOXCtLoJzp+UEfQ5vsGAYzsoih/sGzZHhuf6eh5I6Y+ezVdcXgYUMj423zlWsUvXPu2gj4JKix3S97uPoBVbXrOlJPkiu5R2l6j66Qdsg1BuWwnIY710BBaKCxGC5UUvD6AtSmpxsRSacd9mqgw94OK2G9i0jAMH/XMpZG7nFpquQbJ9D7AgW3sxuJujifBdkk7fE7GeIPnCn6Y8D4BFus9uHOyfddFeN4OVG8PiW3Wo8ufNhOZQedM6BO60ONU6y23p6dkLfN3wiIj4Qc+7iHElwWfrudA1wUjcWMJwt2dswqkz+qqOUr0ZDaDbpoVQZkbKIxHzp5wXJcgv/5ZeHXq/8AurqGLs/5RTNXdEcQLt2bEh2NdgK9E7vX/pqBsa0IdUWsrRd8RTDKtAQCu8kLmaCRLsOx+jRzJ0PxxTsVs8gmYKkiNS9kSIL7hsTvVQuOgxmn3PdvuB6p/Q1hkfD08BFa+9yqYgBi7DdqhAtl5TxIbTarDtKmFFtKiG9Uk3X5kmk4HNhgAvXedBtC30BJGSxn1qIeutMB79DlTMPB0PoMg/Xw06ew== Generated By Serverauditor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 要创建文件夹/data/mongodb | |
# 同时要把权限交给mongodb:mongodb: chown -R mongodb:mongodb /data/mongodb | |
# 更多配置可以Mongodb参照文档 | |
logpath=/data/mongodb/mongod.log | |
logappend=true | |
# 设置成 | |
#bind_ip=192.168.100.101,127.0.0.1 | |
# 在/etc/hosts中添加对应的hostname和LAN IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logger = log4js.getLogger('access'); | |
app.use(function (req, res, next) { | |
// 无法直接得到response.data信息 | |
res._json = res.json; | |
res.json = function(data){ | |
res.responseData = data; | |
res._json(data); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* java的MD5算法,来自又拍云 | |
*/ | |
/** | |
* 对字符串进行 MD5 加密 | |
* | |
* @param str | |
* 待加密字符串 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connect mongodb | |
var mongoose = require('mongoose'); | |
// 见https://github.com/LearnBoost/mongoose/issues/1251 | |
mongoose.models = {}; | |
mongoose.modelSchemas = {}; | |
var clearDB = function(done){ | |
async.parallel([ | |
function (cb) { | |
Coupon.collection.remove(cb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.btn-container-selector ~ .btn-container-selector > .btn-container { | |
border-left: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto'); | |
var makeSalt = function() { | |
return crypto.randomBytes(16).toString('base64'); | |
}; | |
var hashPassword = function(password){ | |
var salt = new Buffer(makeSalt, 'base64'); | |
return crypto.pbkdf2Sync(password, salt, 10000, 64).toString('base64'); | |
} |
NewerOlder