Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xxmp
Project
Project
Details
Activity
Releases
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
chan
xxmp
Commits
ce19ea9a
Commit
ce19ea9a
authored
Jul 15, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房车的改版提交
parent
32b37e86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
2 deletions
+124
-2
checkbind.inc.php
addons/longbing_company/inc/wxapp/checkbind.inc.php
+29
-0
demo.inc.php
addons/longbing_company/inc/wxapp/demo.inc.php
+17
-0
gtasks.inc.php
addons/longbing_company/inc/wxapp/gtasks.inc.php
+0
-1
login.inc.php
addons/longbing_company/inc/wxapp/login.inc.php
+6
-1
register.inc.php
addons/longbing_company/inc/wxapp/register.inc.php
+32
-0
wxapp.php
addons/longbing_company/wxapp.php
+40
-0
No files found.
addons/longbing_company/inc/wxapp/checkbind.inc.php
0 → 100644
View file @
ce19ea9a
<?php
//dezend by http://www.yunlu99.com/
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/longbing_company/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
global
$_GPC
;
global
$_W
;
$uniacid
=
$_W
[
'uniacid'
];
$uid
=
$_GPC
[
'user_id'
];
if
(
$uid
)
{
$user
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$uid
,
'uniacid'
=>
$uniacid
));
if
(
$user
&&
$user
[
'platform_userid'
]){
$result
=
$this
->
authLogin
(
$user
[
'platform_userid'
]);
if
(
$result
)
{
if
(
$result
[
'status'
]
==
200
)
{
$data
=
$result
[
'data'
];
$data
[
'platform_token'
]
=
$result
[
'token'
];
return
$this
->
result
(
0
,
'suc'
,
array
(
'rel'
=>
true
,
'data'
=>
$data
));
}
else
{
return
$this
->
result
(
-
2
,
$result
[
'message'
],
array
());
}
}
}
else
{
return
$this
->
result
(
0
,
'suc'
,
array
(
'rel'
=>
false
));
}
}
return
$this
->
result
(
-
2
,
'操作失败'
,
array
());
?>
addons/longbing_company/inc/wxapp/demo.inc.php
0 → 100644
View file @
ce19ea9a
<?php
//dezend by http://www.yunlu99.com/
load
()
->
func
(
'communication'
);
$url
=
'https://xxtest.upyuns.com/api/auth/jwt/login'
;
global
$_W
;
/*$response = ihttp_get($url);
print_r($response['content']);*/
$data
=
array
(
'username'
=>
'13766666666'
,
'password'
=>
'12345678'
);
echo
$this
->
test
();
die
;
$response
=
ihttp_post
(
$url
,
$data
);
print_r
(
$response
[
'content'
]);
?>
addons/longbing_company/inc/wxapp/gtasks.inc.php
View file @
ce19ea9a
...
...
@@ -14,7 +14,6 @@ if(isset($_GPC['time'])){
}
else
{
$time
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
}
print_r
(
$time
);
die
;
if
(
!
$type
)
{
$type
=
0
;
...
...
addons/longbing_company/inc/wxapp/login.inc.php
View file @
ce19ea9a
...
...
@@ -3,6 +3,7 @@
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/longbing_company/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
load
()
->
func
(
'communication'
);
global
$_GPC
;
global
$_W
;
$code
=
$_GPC
[
'code'
];
...
...
@@ -194,8 +195,12 @@ if (isset($info['openid'])) {
if
(
$a
&&
$a
[
'icon'
]){
$a
[
'icon'
]
=
$_W
[
'siteroot'
]
.
'attachment/'
.
$a
[
'icon'
];
}
//处理统一平台自动登录
if
((
!
isset
(
$_GPC
[
'platform_token'
])
||!
$_GPC
[
'platform_token'
])
&&
$user
[
'platform_userid'
])
{
$response
=
$this
->
authLogin
(
$user
[
'platform_userid'
]);
}
return
$this
->
result
(
0
,
'suc'
,
array
(
'user_id'
=>
$uid
,
'user'
=>
$user
,
'inf'
=>
$a
));
return
$this
->
result
(
0
,
'suc'
,
array
(
'user_id'
=>
$uid
,
'user'
=>
$user
,
'inf'
=>
$a
,
'platform_info'
=>
$response
));
}
return
$this
->
result
(
-
2
,
json_decode
(
$info
),
$info
);
...
...
addons/longbing_company/inc/wxapp/register.inc.php
0 → 100644
View file @
ce19ea9a
<?php
//dezend by http://www.yunlu99.com/
define
(
'ROOT_PATH'
,
IA_ROOT
.
'/addons/longbing_company/'
);
is_file
(
ROOT_PATH
.
'/inc/we7.php'
)
||
exit
(
'Access Denied Longbing'
);
require_once
ROOT_PATH
.
'/inc/we7.php'
;
global
$_GPC
;
global
$_W
;
$uniacid
=
$_W
[
'uniacid'
];
$uid
=
$_GPC
[
'user_id'
];
if
(
$uid
)
{
$user
=
pdo_get
(
'longbing_company_user'
,
array
(
'id'
=>
$uid
,
'uniacid'
=>
$uniacid
));
if
(
$user
&&!
$user
[
'platform_userid'
]){
$username
=
$_GPC
[
'username'
];
$result
=
$this
->
authRegister
(
$username
,
$uid
);
if
(
$result
){
if
(
$result
[
'status'
]
==
200
){
$data
=
$result
[
'data'
];
$data
[
'platform_token'
]
=
$result
[
'token'
];
$platform_userid
=
$data
[
'userId'
];
if
(
$platform_userid
){
pdo_update
(
'longbing_company_user'
,
array
(
'platform_userid'
=>
$platform_userid
),
array
(
'id'
=>
$uid
,
'uniacid'
=>
$uniacid
));
return
$this
->
result
(
0
,
'suc'
,
$data
);
}
}
else
{
return
$this
->
result
(
-
2
,
$result
[
'message'
],
array
());
}
}
}
}
return
$this
->
result
(
-
2
,
'操作失败'
,
array
());
?>
addons/longbing_company/wxapp.php
View file @
ce19ea9a
...
...
@@ -9,6 +9,7 @@ is_file(ROOT_PATH . '/inc/we7.php') || exit('Access Denied Longbing');
require_once
ROOT_PATH
.
'/inc/we7.php'
;
is_file
(
ROOT_PATH
.
'/inc/html2wxml/class.ToWXML.php'
)
||
exit
(
'Access Denied Longbing ToWXML'
);
require_once
ROOT_PATH
.
'/inc/html2wxml/class.ToWXML.php'
;
load
()
->
func
(
'communication'
);
class
longbing_companyModuleWxapp
extends
WeModuleWxapp
{
...
...
@@ -139,6 +140,20 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
return
$output
;
}
protected
function
curlGET
(
$url
)
{
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYHOST
,
false
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
1
);
$output
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
return
$output
;
}
protected
function
curlPostTime
(
$url
,
$data
,
$time
=
1
)
{
$ch
=
curl_init
();
...
...
@@ -10066,8 +10081,33 @@ class longbing_companyModuleWxapp extends WeModuleWxapp
}
//处理统一平台自动登录
public
function
authLogin
(
$userid
){
global
$_W
;
$url
=
$_W
[
'config'
][
'setting'
][
'login'
];
$data
=
array
(
'userId'
=>
$userid
);
$response
=
ihttp_post
(
$url
,
$data
);
$result
=
$response
[
'content'
];
$result
=
json_decode
(
$result
,
true
);
return
$result
;
}
//注册接口
public
function
authRegister
(
$username
,
$userid
){
global
$_W
;
$url
=
$_W
[
'config'
][
'setting'
][
'register'
];
$data
=
array
(
'username'
=>
$username
,
'userid'
=>
$userid
);
$response
=
ihttp_post
(
$url
,
$data
);
$result
=
$response
[
'content'
];
$result
=
json_decode
(
$result
,
true
);
return
$result
;
}
function
getAccessToken2
()
{
...
...
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