切换导航条
此项目
正在载入...
登录
景龙
/
xingqiu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
e598a92890cc07358bb9433dd54c91d40274d3b1
1 个父辈
3d9c0b79
1 个管道 的构建
通过
耗费 0 秒
测试微博
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
38 行增加
和
15 行删除
app/portal/controller/LoginController.php
public/themes/simpleboot3/public/assets/js/public.js
public/themes/simpleboot3/public/slide.html
app/portal/controller/LoginController.php
查看文件 @
e598a92
...
...
@@ -448,14 +448,19 @@ class LoginController extends HomeBaseController
//微博分享
public
function
wb_share
(){
$token
=
session
(
'token'
);
$title
=
$this
->
request
->
post
(
'title'
);
//分享标题
$share_url
=
$this
->
request
->
post
(
'share_url'
);
//分享url
$url
=
'https://api.weibo.com/2/statuses/share.json'
;
$data
=
[
'access_token'
=>
$token
,
'status'
=>
URLencode
(
'成功 http://www.starplanet.cn/portal/enjoy/getEnjoyDetail?id=52'
)
'status'
=>
$title
.
" "
.
$share_url
];
$res
=
$this
->
http_post
(
$url
,
$data
);
$json_arr
=
json_decode
(
$res
,
true
);
var_dump
(
$json_arr
);
exit
;
if
(
isset
(
$json_arr
[
'error_code'
])
&&!
empty
(
$json_arr
[
'error_code'
])){
$this
->
apiResponse
(
0
,
'分享失败!'
);
}
$this
->
apiResponse
(
1
,
'分享成功!'
);
}
//取消授权
...
...
public/themes/simpleboot3/public/assets/js/public.js
查看文件 @
e598a92
...
...
@@ -183,7 +183,7 @@ $(function() {
var
share_url
=
encodeURIComponent
(
location
.
href
);
var
share_title
=
encodeURIComponent
(
document
.
title
);
//分享到微博
//分享到微博
弃用
$
(
'.weibo'
).
click
(
function
()
{
var
param
=
{
url
:
share_url
,
...
...
@@ -197,8 +197,9 @@ $(function() {
window
.
open
(
'http://v.t.sina.com.cn/share/share.php?'
+
temp
.
join
(
'&'
));
});
$
(
'.weibo_share'
).
click
(
function
()
{
$
(
'#wb_share'
).
submit
();
//微博分享
$
(
'#wb_share'
).
click
(
function
()
{
thirdShare
(
'/portal/login/wb_share'
);
});
//微博登录
...
...
@@ -207,6 +208,29 @@ $(function() {
});
});
//第三方分享
function
thirdShare
(
url
){
var
title
=
$
(
document
).
attr
(
"title"
);
var
share_url
=
window
.
location
.
href
;
$
.
ajax
({
type
:
'POST'
,
url
:
url
,
data
:
{
'title'
:
title
,
'share_url'
:
share_url
},
dataType
:
'json'
,
async
:
false
,
success
:
function
(
data
)
{
if
(
data
.
code
==
1
)
{
mask
(
data
.
msg
);
}
else
{
mask
(
data
.
msg
);
}
}
});
}
//点赞收藏
function
operation
(
url
,
id
)
{
if
(
id
==
''
||
id
==
undefined
)
{
...
...
public/themes/simpleboot3/public/slide.html
查看文件 @
e598a92
...
...
@@ -22,14 +22,8 @@
<p>
168
</p>
</div>
<!-- wb分享 -->
<form
action=
"/portal/login/wb_share"
method=
"POST"
id=
"wb_share"
>
<div
class=
"wb_go weibo_share"
>
<img
src=
"__TMPL__/public/assets/starImg/bicon_05.png"
alt=
""
>
<p>
168
</p>
</div>
<input
type=
"hidden"
name=
"client_id"
value=
"737607150"
>
<input
type=
"hidden"
name=
"redirect_uri"
value=
"http://www.xingqiu.cn/portal/login/wb_login"
>
<input
type=
"hidden"
name=
"flag"
value=
"1"
>
</form>
<div
class=
"wb_go weibo_share"
id=
"wb_share"
>
<img
src=
"__TMPL__/public/assets/starImg/bicon_05.png"
alt=
""
>
<p>
168
</p>
</div>
</div>
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论