切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
561ad286bedbf9134e1a73f943c83340f37af2e0
1 个父辈
00b3be99
1 个管道 的构建
通过
耗费 1 秒
修改微博登录后分享
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
21 行增加
和
16 行删除
app/portal/controller/LoginController.php
app/portal/controller/LoginController.php
查看文件 @
561ad28
...
...
@@ -463,23 +463,28 @@ class LoginController extends HomeBaseController
//微博分享
public
function
wb_share
(){
$token
=
session
(
'token'
);
$title
=
$this
->
request
->
post
(
'title'
);
//分享标题
$share_url
=
$this
->
request
->
post
(
'share_url'
);
//分享url
$article_id
=
$this
->
request
->
post
(
'id'
);
//分享文章id
$url
=
'https://api.weibo.com/2/statuses/share.json'
;
$data
=
[
'access_token'
=>
$token
,
'status'
=>
$title
.
" "
.
$share_url
];
$res
=
$this
->
http_post
(
$url
,
$data
);
$json_arr
=
json_decode
(
$res
,
true
);
if
(
isset
(
$json_arr
[
'error_code'
])
&&!
empty
(
$json_arr
[
'error_code'
])){
$this
->
apiResponse
(
0
,
$json_arr
[
'error'
]);
$login
=
cmf_is_user_login
();
if
(
$login
)
{
$token
=
session
(
'token'
);
$title
=
$this
->
request
->
post
(
'title'
);
//分享标题
$share_url
=
$this
->
request
->
post
(
'share_url'
);
//分享url
$article_id
=
$this
->
request
->
post
(
'id'
);
//分享文章id
$url
=
'https://api.weibo.com/2/statuses/share.json'
;
$data
=
[
'access_token'
=>
$token
,
'status'
=>
$title
.
" "
.
$share_url
];
$res
=
$this
->
http_post
(
$url
,
$data
);
$json_arr
=
json_decode
(
$res
,
true
);
if
(
isset
(
$json_arr
[
'error_code'
])
&&
!
empty
(
$json_arr
[
'error_code'
]))
{
$this
->
apiResponse
(
0
,
$json_arr
[
'error'
]);
}
$postModel
=
new
PortalPostModel
();
$postModel
->
where
(
'id'
,
$article_id
)
->
setInc
(
'post_share_wb'
,
1
);
$this
->
apiResponse
(
1
,
'分享成功!'
);
}
else
{
$this
->
apiResponse
(
0
,
'请使用微博登录后操作!'
);
}
$postModel
=
new
PortalPostModel
();
$postModel
->
where
(
'id'
,
$article_id
)
->
setInc
(
'post_share_wb'
,
1
);
$this
->
apiResponse
(
1
,
'分享成功!'
);
}
//取消授权
...
...
请
注册
或
登录
后发表评论