Commit 26bea1ff authored by Hsinli's avatar Hsinli

Merge branch 'master' of t-git.51gjj.com:fangbin/51business

parents 68850ac3 1df60274
Pipeline #9229 passed with stage
in 15 seconds
......@@ -351,6 +351,66 @@ class ToolController extends Controller {
ctx.success({ results });
}
// 获取51shequ的oss签名
async getBusinessSignature() {
const { ctx } = this;
const region = 'oss-cn-hangzhou';
const bucket = '51shequ';
const id = 'LTAIbdayv82O7OYM';
const key = 'plCSzfiZCpMoh39omrzdaHHEltv4Un';
const host = '//' + bucket + '.' + region + '.aliyuncs.com';
const url = "//r.51gjj.com/";
let now = Math.round(new Date().getTime() / 1000).toString();
const expire = 120;
let end = now + expire;
let expiration = new Date().toISOString().replace(/\..+/, '') + 'Z';
let dir = 'images/house/house_analysis/';
//最大文件大小.用户可以自己设置
let condition = new Array(3);
condition[0] = 'content-length-range';
condition[1] = 0;
condition[2] = 1048576000;
let start = new Array('starts-with', '$key', dir);
let conditions = new Array(condition, start);
let policy = { expiration: expiration, conditions: conditions };
let base64_policy = new Buffer(JSON.stringify(policy)).toString('base64');
let string_to_sign = base64_policy;
const crypto = require('crypto');
let signature = crypto.createHmac('sha1', key).update(string_to_sign).digest().toString('base64');;
// let config = {
// region,
// accessKeyId: id,
// accessKeySecret: key,
// bucket: bucket,
// }
let results = {
accessid: id,
static_host: url + dir,
host: host,
policy: base64_policy,
signature: signature,
expire: end,
// config: config,
dir
};
ctx.success({ results });
}
//房产估价
}
......
......@@ -60,6 +60,7 @@ module.exports = app => {
router.post('/v2/tool/house_price_search', 'house.v2.tool.getHousePriceFeatureSearch');//房价指数 搜索结果
router.get('/v2/tool/house_point', 'house.v2.tool.getHousePoint');//点击房源信息跳到地图页 需要的经纬度信息。
router.post('/v2/tool/nearby_house_points', 'house.v2.tool.getHouseNearbyPoint');//点击房源信息跳到地图页 此房源周边信息。
router.get('/v2/tool/oss_signature', 'house.v2.tool.getBusinessSignature');//点击房源信息跳到地图页 此房源周边信息。
//租房列表
......
......@@ -170,6 +170,7 @@ class RentalHouseService extends Service {
discount: rental_house.discount,//折扣
// business_license: rental_house.businessLicense,
tags: rental_house.tags,//房源特点
rental_type: rental_house.rental_type,//租房类型 1整租 2合租 3独栋公寓
favourable_info: rental_house.favourable_info,//优惠信息
introduce: rental_house.description || `该社区亮点:
1、房源介绍:精装公寓,家电齐全,独立卫生间,南通北透,独门独户。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment