Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
Dotos committed Dec 22, 2016
1 parent e02a103 commit 8e8bc28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions routes/index.js
@@ -1,5 +1,6 @@
var express = require('express');
var dbUtils = require('../utils/dbUtils');
var qiniuUtils = require('../utils/qiniuUtils');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
Expand Down Expand Up @@ -81,10 +82,10 @@ var common = function(req, res, next, page, rows) {
city: rows[i]['city'],
country: rows[i]['country'],
continent: rows[i]['continent'],
thumbnail_pic: rows[i]['thumbnail_pic'],
bmiddle_pic: rows[i]['bmiddle_pic'],
original_pic: rows[i]['original_pic'],
weibo: rows[i]['weibo'],
thumbnail: qiniuUtils(rows[i]['qiniu_url'], 400, 300),
//bmiddle_pic: rows[i]['bmiddle_pic'],
//original_pic: rows[i]['original_pic'],
//weibo: rows[i]['weibo'],
date: full
});
}
Expand Down
2 changes: 1 addition & 1 deletion utils/bingUtils.js
Expand Up @@ -36,7 +36,7 @@ module.exports = {
startdate: data.startdate,
fullstartdate: data.fullstartdate,
enddate: data.enddate,
url: data.url,
url: /(http|https)\:\/\//gi.test(data.url) ? data.url : 'http://s.cn.bing.net' + data.url,
urlbase: data.urlbase,
copyright: data.copyright,
copyrightlink: data.copyrightlink,
Expand Down
2 changes: 1 addition & 1 deletion utils/qiniuUtils.js
Expand Up @@ -51,7 +51,7 @@ module.exports = {
mode = mode || 1;
var base = 'http://images.ioliu.cn/bing/';
url = url.indexOf('1920x1080') == -1 ? url + '_1920x1080.jpg' : url;
url = /http/.test(url) ? url : base + url;
url = /(http|https)\:\/\//.test(url) ? url : base + url;
var imageView = new qiniu.fop.ImageView(mode, width, height, quality);
return imageView.makeRequest(url);
}
Expand Down
2 changes: 1 addition & 1 deletion views/index.pug
Expand Up @@ -11,7 +11,7 @@ block content
- var original = 'http://images.ioliu.cn/bing/'+val.qiniu_url+'_1920x1080.jpg';
article(rid=val.id)
a.thumbnail(href= original )
img(src=val.bmiddle_pic )
img(src=val.thumbnail )
h2 ##{val.date}# #{val.copyright}
p #{val.description}
- var url = 'http://service.weibo.com/share/share.php?url='+encodeURIComponent('http://bing.ioliu.cn?id='+val.id)+'&title='+encodeURIComponent('#必应壁纸# '+ val.date + ' / '+ val.description) + '&appkey=1833831541';
Expand Down

0 comments on commit 8e8bc28

Please sign in to comment.