Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
b405c34d
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b405c34d
编写于
5月 24, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信授权
上级
ab3ffb7f
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
90 addition
and
23 deletion
+90
-23
application/index/view/default/user/login_info.html
application/index/view/default/user/login_info.html
+1
-1
application/plugins/touristbuy/Hook.php
application/plugins/touristbuy/Hook.php
+5
-6
application/plugins/view/touristbuy/admin/admin/index.html
application/plugins/view/touristbuy/admin/admin/index.html
+1
-1
application/plugins/view/touristbuy/admin/admin/saveinfo.html
...ication/plugins/view/touristbuy/admin/admin/saveinfo.html
+4
-4
application/plugins/view/weixinwebauthorization/admin/admin/index.html
...lugins/view/weixinwebauthorization/admin/admin/index.html
+21
-0
application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html
...ins/view/weixinwebauthorization/admin/admin/saveinfo.html
+10
-0
application/plugins/view/weixinwebauthorization/index/public/auth_button.html
...view/weixinwebauthorization/index/public/auth_button.html
+1
-1
application/plugins/view/weixinwebauthorization/index/public/auth_text.html
...s/view/weixinwebauthorization/index/public/auth_text.html
+1
-1
application/plugins/weixinwebauthorization/Hook.php
application/plugins/weixinwebauthorization/Hook.php
+28
-2
application/plugins/weixinwebauthorization/config.json
application/plugins/weixinwebauthorization/config.json
+4
-1
application/tags.php
application/tags.php
+2
-4
extend/payment/Weixin.php
extend/payment/Weixin.php
+12
-2
未找到文件。
application/index/view/default/user/login_info.html
浏览文件 @
b405c34d
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<div
class=
"forgetpwd-top"
>
<div
class=
"forgetpwd-top"
>
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
<span
class=
""
>
还没有帐号?
</span>
<span
class=
""
>
还没有帐号?
</span>
<a
href=
"{{:MyUrl('index/user/reginfo')}}"
class=
"am-btn am-btn-secondary am-btn-xs am-radius"
>
立即
注册
</a>
<a
href=
"{{:MyUrl('index/user/reginfo')}}"
class=
"am-btn am-btn-secondary am-btn-xs am-radius"
>
注册
</a>
{{/if}}
{{/if}}
<!-- 用户登录页面顶部钩子 -->
<!-- 用户登录页面顶部钩子 -->
...
...
application/plugins/touristbuy/Hook.php
浏览文件 @
b405c34d
...
@@ -137,8 +137,7 @@ class Hook extends Controller
...
@@ -137,8 +137,7 @@ class Hook extends Controller
public
function
Style
(
$params
=
[])
public
function
Style
(
$params
=
[])
{
{
return
'<style type="text/css">
return
'<style type="text/css">
.plugins-touristbuy-nav-top, .plugins-touristbuy-login-info-btn { margin-left: 10px; }
.plugins-touristbuy-nav-top { color: #FF5722; }
.plugins-touristbuy-nav-top { color: #FF5722; }
</style>'
;
</style>'
;
}
}
...
@@ -166,8 +165,8 @@ class Hook extends Controller
...
@@ -166,8 +165,8 @@ class Hook extends Controller
// 获取应用数据
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客
登录
'
:
$ret
[
'data'
][
'login_name'
];
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客'
:
$ret
[
'data'
][
'login_name'
];
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
,
[
'is_parent'
=>
$is_parent
])
.
'" class="am-btn am-btn-warning am-btn-xs am-radius
plugins-touristbuy-login-info-btn
">'
.
$login_name
.
'</a>'
;
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
,
[
'is_parent'
=>
$is_parent
])
.
'" class="am-btn am-btn-warning am-btn-xs am-radius
am-margin-left-xs
">'
.
$login_name
.
'</a>'
;
}
}
return
''
;
return
''
;
}
}
...
@@ -188,8 +187,8 @@ class Hook extends Controller
...
@@ -188,8 +187,8 @@ class Hook extends Controller
{
{
// 获取应用数据
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客
登录
'
:
$ret
[
'data'
][
'login_name'
];
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客'
:
$ret
[
'data'
][
'login_name'
];
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
)
.
'" class="plugins-touristbuy-nav-top">'
.
$login_name
.
'</a>'
;
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
)
.
'" class="plugins-touristbuy-nav-top
am-margin-left-xs
">'
.
$login_name
.
'</a>'
;
}
}
return
''
;
return
''
;
}
}
...
...
application/plugins/view/touristbuy/admin/admin/index.html
浏览文件 @
b405c34d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
{{if !empty($data['login_name'])}}
{{if !empty($data['login_name'])}}
{{$data.login_name}}
{{$data.login_name}}
{{else /}}
{{else /}}
游客
登录
游客
{{/if}}
{{/if}}
</div>
</div>
</div>
</div>
...
...
application/plugins/view/touristbuy/admin/admin/saveinfo.html
浏览文件 @
b405c34d
...
@@ -16,13 +16,13 @@
...
@@ -16,13 +16,13 @@
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
登录入口名称
<span
class=
"am-form-group-label-tips"
>
默认 游客
登录
</span></label>
<label>
登录入口名称
<span
class=
"am-form-group-label-tips"
>
默认 游客
</span></label>
<input
type=
"text"
name=
"login_name"
placeholder=
"登录入口名称"
maxlength=
"30"
data-validation-message=
"登录入口名称格式最多 30 个字符"
class=
"am-radius"
value=
"{{if !empty($data['login_name'])}}{{$data.login_name}}{{else /}}游客
登录
{{/if}}"
/>
<input
type=
"text"
name=
"login_name"
placeholder=
"登录入口名称"
maxlength=
"30"
data-validation-message=
"登录入口名称格式最多 30 个字符"
class=
"am-radius"
value=
"{{if !empty($data['login_name'])}}{{$data.login_name}}{{else /}}游客{{/if}}"
/>
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
游客用户名
<span
class=
"am-form-group-label-tips"
>
默认 游客
</span></label>
<label>
游客用户名
前缀
<span
class=
"am-form-group-label-tips"
>
默认 游客
</span></label>
<input
type=
"text"
name=
"nickname"
placeholder=
"游客用户名
"
maxlength=
"16"
data-validation-message=
"游客用户名格式最多 1
6 个字符"
class=
"am-radius"
value=
"{{if !empty($data['nickname'])}}{{$data.nickname}}{{else /}}游客{{/if}}"
/>
<input
type=
"text"
name=
"nickname"
placeholder=
"游客用户名
前缀"
maxlength=
"6"
data-validation-message=
"游客用户名前缀格式最多
6 个字符"
class=
"am-radius"
value=
"{{if !empty($data['nickname'])}}{{$data.nickname}}{{else /}}游客{{/if}}"
/>
</div>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
...
...
application/plugins/view/weixinwebauthorization/admin/admin/index.html
浏览文件 @
b405c34d
...
@@ -40,6 +40,27 @@
...
@@ -40,6 +40,27 @@
</div>
</div>
</div>
</div>
<div
class=
"items"
>
<label>
登录入口名称
</label>
<div>
{{if !empty($data['login_name'])}}
{{$data.login_name}}
{{else /}}
微信
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
微信用户名前缀
</label>
<div>
{{if !empty($data['nickname'])}}
{{$data.nickname}}
{{else /}}
微信
{{/if}}
</div>
</div>
<div
class=
"items"
>
<div
class=
"items"
>
<label>
登录授权地址
</label>
<label>
登录授权地址
</label>
<div>
<div>
...
...
application/plugins/view/weixinwebauthorization/admin/admin/saveinfo.html
浏览文件 @
b405c34d
...
@@ -20,6 +20,16 @@
...
@@ -20,6 +20,16 @@
<input
type=
"text"
name=
"secret"
placeholder=
"secret"
maxlength=
"60"
data-validation-message=
"secret格式最多 60 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
['
secret
'])}}
value=
"{{$data.secret}}"
{{/
if
}}
/>
<input
type=
"text"
name=
"secret"
placeholder=
"secret"
maxlength=
"60"
data-validation-message=
"secret格式最多 60 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
['
secret
'])}}
value=
"{{$data.secret}}"
{{/
if
}}
/>
</div>
</div>
<div
class=
"am-form-group"
>
<label>
登录入口名称
<span
class=
"am-form-group-label-tips"
>
默认 微信
</span></label>
<input
type=
"text"
name=
"login_name"
placeholder=
"登录入口名称"
maxlength=
"30"
data-validation-message=
"登录入口名称格式最多 30 个字符"
class=
"am-radius"
value=
"{{if !empty($data['login_name'])}}{{$data.login_name}}{{else /}}微信{{/if}}"
/>
</div>
<div
class=
"am-form-group"
>
<label>
微信用户名前缀
<span
class=
"am-form-group-label-tips"
>
默认 微信
</span></label>
<input
type=
"text"
name=
"nickname"
placeholder=
"微信用户名"
maxlength=
"6"
data-validation-message=
"微信用户名前缀格式最多 6 个字符"
class=
"am-radius"
value=
"{{if !empty($data['nickname'])}}{{$data.nickname}}{{else /}}微信{{/if}}"
/>
</div>
<div
class=
"am-form-group"
>
<div
class=
"am-form-group"
>
<label>
授权方式
<span
class=
"am-form-group-label-tips"
>
默认 静默授权方式
</span></label>
<label>
授权方式
<span
class=
"am-form-group-label-tips"
>
默认 静默授权方式
</span></label>
<div>
<div>
...
...
application/plugins/view/weixinwebauthorization/index/public/auth_button.html
浏览文件 @
b405c34d
<a
href=
"{{:PluginsHomeUrl('weixinwebauthorization', 'auth', 'index')}}"
class=
"am-btn am-btn-warning am-btn-xs am-radius plugins-touristbuy-login-info-btn"
>
微信登录
</a>
<a
href=
"{{:PluginsHomeUrl('weixinwebauthorization', 'auth', 'index')}}"
class=
"am-btn am-btn-success am-btn-xs am-radius am-margin-left-xs"
>
{{if empty($plugins_data['login_name'])}}微信{{else /}}{{$plugins_data.login_name}}{{/if}}
</a>
\ No newline at end of file
\ No newline at end of file
application/plugins/view/weixinwebauthorization/index/public/auth_text.html
浏览文件 @
b405c34d
<a
href=
"{{:PluginsHomeUrl('weixinwebauthorization', 'auth', 'index')}}"
>
微信登录
</a>
<a
href=
"{{:PluginsHomeUrl('weixinwebauthorization', 'auth', 'index')}}"
class=
"am-icon-weixin am-margin-left-xs plugins-weixinwebauthorization-nav-top-text"
>
{{if empty($plugins_data['login_name'])}}微信{{else /}}{{$plugins_data.login_name}}{{/if}}
</a>
\ No newline at end of file
\ No newline at end of file
application/plugins/weixinwebauthorization/Hook.php
浏览文件 @
b405c34d
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
namespace
app\plugins\weixinwebauthorization
;
namespace
app\plugins\weixinwebauthorization
;
use
think\Controller
;
use
think\Controller
;
use
app\service\PluginsService
;
/**
/**
* 微信登录 - 钩子入口
* 微信登录 - 钩子入口
...
@@ -31,14 +32,15 @@ class Hook extends Controller
...
@@ -31,14 +32,15 @@ class Hook extends Controller
*/
*/
public
function
run
(
$params
=
[])
public
function
run
(
$params
=
[])
{
{
if
(
!
empty
(
$params
[
'hook_name'
]))
// 目前微信登录只针对手机端
if
(
!
empty
(
$params
[
'hook_name'
])
&&
IsMobile
())
{
{
switch
(
$params
[
'hook_name'
])
switch
(
$params
[
'hook_name'
])
{
{
// 用户登录页面顶部钩子
// 用户登录页面顶部钩子
// 用户注册页面钩子
// 用户注册页面钩子
case
'plugins_view_user_login_info_top'
:
case
'plugins_view_user_login_info_top'
:
case
'plugins_view_user_reg_info
_top
'
:
case
'plugins_view_user_reg_info'
:
$ret
=
$this
->
ButtonHtml
(
$params
);
$ret
=
$this
->
ButtonHtml
(
$params
);
break
;
break
;
...
@@ -47,6 +49,11 @@ class Hook extends Controller
...
@@ -47,6 +49,11 @@ class Hook extends Controller
$ret
=
$this
->
NavTextHtml
(
$params
);
$ret
=
$this
->
NavTextHtml
(
$params
);
break
;
break
;
// header代码
case
'plugins_common_header'
:
$ret
=
$this
->
Style
(
$params
);
break
;
default
:
default
:
$ret
=
''
;
$ret
=
''
;
}
}
...
@@ -54,6 +61,21 @@ class Hook extends Controller
...
@@ -54,6 +61,21 @@ class Hook extends Controller
}
}
}
}
/**
* css
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public
function
Style
(
$params
=
[])
{
return
'<style type="text/css">
.plugins-weixinwebauthorization-nav-top-text { color: #3db53d; }
</style>'
;
}
/**
/**
* 登录登录html
* 登录登录html
* @author Devil
* @author Devil
...
@@ -65,6 +87,8 @@ class Hook extends Controller
...
@@ -65,6 +87,8 @@ class Hook extends Controller
*/
*/
private
function
ButtonHtml
(
$params
=
[])
private
function
ButtonHtml
(
$params
=
[])
{
{
$ret
=
PluginsService
::
PluginsData
(
'weixinwebauthorization'
);
$this
->
assign
(
'plugins_data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/weixinwebauthorization/index/public/auth_button'
);
return
$this
->
fetch
(
'../../../plugins/view/weixinwebauthorization/index/public/auth_button'
);
}
}
...
@@ -79,6 +103,8 @@ class Hook extends Controller
...
@@ -79,6 +103,8 @@ class Hook extends Controller
*/
*/
private
function
NavTextHtml
(
$params
=
[])
private
function
NavTextHtml
(
$params
=
[])
{
{
$ret
=
PluginsService
::
PluginsData
(
'weixinwebauthorization'
);
$this
->
assign
(
'plugins_data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/weixinwebauthorization/index/public/auth_text'
);
return
$this
->
fetch
(
'../../../plugins/view/weixinwebauthorization/index/public/auth_text'
);
}
}
}
}
...
...
application/plugins/weixinwebauthorization/config.json
浏览文件 @
b405c34d
...
@@ -20,11 +20,14 @@
...
@@ -20,11 +20,14 @@
"plugins_view_user_login_info_top"
:[
"plugins_view_user_login_info_top"
:[
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
],
],
"plugins_view_user_reg_info
_top
"
:[
"plugins_view_user_reg_info"
:[
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
],
],
"plugins_view_header_navigation_top_left"
:[
"plugins_view_header_navigation_top_left"
:[
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
],
"plugins_common_header"
:[
"app
\\
plugins
\\
weixinwebauthorization
\\
Hook"
]
]
}
}
}
}
\ No newline at end of file
application/tags.php
浏览文件 @
b405c34d
...
@@ -87,6 +87,7 @@ return array (
...
@@ -87,6 +87,7 @@ return array (
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
1
=>
'app\\plugins\\touristbuy\\Hook'
,
1
=>
'app\\plugins\\touristbuy\\Hook'
,
2
=>
'app\\plugins\\homemiddleadv\\Hook'
,
2
=>
'app\\plugins\\homemiddleadv\\Hook'
,
3
=>
'app\\plugins\\weixinwebauthorization\\Hook'
,
),
),
'plugins_admin_common_header'
=>
'plugins_admin_common_header'
=>
array
(
array
(
...
@@ -113,6 +114,7 @@ return array (
...
@@ -113,6 +114,7 @@ return array (
'plugins_view_user_reg_info'
=>
'plugins_view_user_reg_info'
=>
array
(
array
(
0
=>
'app\\plugins\\touristbuy\\Hook'
,
0
=>
'app\\plugins\\touristbuy\\Hook'
,
1
=>
'app\\plugins\\weixinwebauthorization\\Hook'
,
),
),
'plugins_service_buy_handle'
=>
'plugins_service_buy_handle'
=>
array
(
array
(
...
@@ -156,9 +158,5 @@ return array (
...
@@ -156,9 +158,5 @@ return array (
array
(
array
(
0
=>
'app\\plugins\\wallet\\Hook'
,
0
=>
'app\\plugins\\wallet\\Hook'
,
),
),
'plugins_view_user_reg_info_top'
=>
array
(
0
=>
'app\\plugins\\weixinwebauthorization\\Hook'
,
),
);
);
?>
?>
\ No newline at end of file
extend/payment/Weixin.php
浏览文件 @
b405c34d
...
@@ -233,15 +233,25 @@ class Weixin
...
@@ -233,15 +233,25 @@ class Weixin
return
DataReturn
(
'支付类型不匹配'
,
-
1
);
return
DataReturn
(
'支付类型不匹配'
,
-
1
);
}
}
// openid
if
(
APPLICATION
==
'app'
)
{
$openid
=
isset
(
$params
[
'user'
][
'weixin_openid'
])
?
$params
[
'user'
][
'weixin_openid'
]
:
''
;
}
else
{
$openid
=
isset
(
$params
[
'user'
][
'weixin_web_openid'
])
?
$params
[
'user'
][
'weixin_web_openid'
]
:
''
;
}
// appid
// appid
$appid
=
(
APPLICATION_CLIENT_TYPE
==
'weixin'
)
?
$this
->
config
[
'mini_appid'
]
:
$this
->
config
[
'appid'
];
$appid
=
(
APPLICATION
==
'app'
)
?
$this
->
config
[
'mini_appid'
]
:
$this
->
config
[
'appid'
];
// 请求参数
$data
=
[
$data
=
[
'appid'
=>
$appid
,
'appid'
=>
$appid
,
'mch_id'
=>
$this
->
config
[
'mch_id'
],
'mch_id'
=>
$this
->
config
[
'mch_id'
],
'body'
=>
$params
[
'site_name'
]
.
'-'
.
$params
[
'name'
],
'body'
=>
$params
[
'site_name'
]
.
'-'
.
$params
[
'name'
],
'nonce_str'
=>
md5
(
time
()
.
rand
()
.
$params
[
'order_no'
]),
'nonce_str'
=>
md5
(
time
()
.
rand
()
.
$params
[
'order_no'
]),
'notify_url'
=>
(
__MY_HTTP__
==
'https'
)
?
'http'
.
mb_substr
(
$params
[
'notify_url'
],
5
,
null
,
'utf-8'
)
:
$params
[
'notify_url'
],
'notify_url'
=>
(
__MY_HTTP__
==
'https'
)
?
'http'
.
mb_substr
(
$params
[
'notify_url'
],
5
,
null
,
'utf-8'
)
:
$params
[
'notify_url'
],
'openid'
=>
(
$trade_type
==
'JSAPI'
)
?
$
params
[
'user'
][
'weixin_openid'
]
:
''
,
'openid'
=>
(
$trade_type
==
'JSAPI'
)
?
$
openid
:
''
,
'out_trade_no'
=>
$params
[
'order_no'
]
.
GetNumberCode
(
6
),
'out_trade_no'
=>
$params
[
'order_no'
]
.
GetNumberCode
(
6
),
'spbill_create_ip'
=>
GetClientIP
(),
'spbill_create_ip'
=>
GetClientIP
(),
'total_fee'
=>
intval
(
$params
[
'total_price'
]
*
100
),
'total_fee'
=>
intval
(
$params
[
'total_price'
]
*
100
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录