Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
26bea1ff
Commit
26bea1ff
authored
Jun 20, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of t-git.51gjj.com:fangbin/51business
parents
68850ac3
1df60274
Pipeline
#9229
passed with stage
in 15 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
tool.js
app/controller/house/v2/tool.js
+60
-0
house.js
app/router/house.js
+1
-0
rental_house.js
app/service/house/v2/rental_house.js
+1
-0
No files found.
app/controller/house/v2/tool.js
View file @
26bea1ff
...
...
@@ -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
});
}
//房产估价
}
...
...
app/router/house.js
View file @
26bea1ff
...
...
@@ -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'
);
//点击房源信息跳到地图页 此房源周边信息。
//租房列表
...
...
app/service/house/v2/rental_house.js
View file @
26bea1ff
...
...
@@ -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、房源介绍:精装公寓,家电齐全,独立卫生间,南通北透,独门独户。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment