Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
magicbox
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
magicbox
Commits
ebd1bd9b
Commit
ebd1bd9b
authored
Mar 16, 2022
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改登录
parent
99d3c8ef
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
8 deletions
+39
-8
build.gradle
cms/build.gradle
+2
-2
NetConfig.java
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
+1
-0
IHomeApi.kt
cms/src/main/java/com/zxhl/cms/net/api/IHomeApi.kt
+7
-0
WeChatUtils.kt
cms/src/main/java/com/zxhl/cms/utils/WeChatUtils.kt
+28
-5
ShareSDK.xml
tmpmob/ShareSDK/assets/ShareSDK.xml
+1
-1
No files found.
cms/build.gradle
View file @
ebd1bd9b
...
@@ -44,10 +44,10 @@ android {
...
@@ -44,10 +44,10 @@ android {
Facebook
{
Facebook
{
id
8
id
8
sortId
8
sortId
8
appKey
"
662970168312513
"
appKey
"
1156014961815312
"
callbackUri
"https://www.baidu.com"
callbackUri
"https://www.baidu.com"
officialVersion
"default"
officialVersion
"default"
faceBookLoginProtocolScheme
"fb
662970168312513
"
faceBookLoginProtocolScheme
"fb
1156014961815312
"
shareByAppClient
true
shareByAppClient
true
enable
true
enable
true
}
}
...
...
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
View file @
ebd1bd9b
...
@@ -145,6 +145,7 @@ public class NetConfig {
...
@@ -145,6 +145,7 @@ public class NetConfig {
public
static
final
String
USER_PHONE_CODE_LOGIN
=
"app/v3/auth/phoneCodeLogin"
;
//验证码登录
public
static
final
String
USER_PHONE_CODE_LOGIN
=
"app/v3/auth/phoneCodeLogin"
;
//验证码登录
public
static
final
String
URL_VERSION
=
"app/v1/version"
;
public
static
final
String
URL_VERSION
=
"app/v1/version"
;
public
static
final
String
URL_AUTH_GOOGLE_LOGIN
=
"app/v1/auth/googleLogin"
;
//绑定谷歌登录
public
static
final
String
URL_AUTH_GOOGLE_LOGIN
=
"app/v1/auth/googleLogin"
;
//绑定谷歌登录
public
static
final
String
URL_AUTH_FACEBOOK_LOGIN
=
"app/v1/auth/facebookLogin"
;
//绑定FaceBook登录
///unifiedpay/gateway/google/替换包名/notify/order
///unifiedpay/gateway/google/替换包名/notify/order
...
...
cms/src/main/java/com/zxhl/cms/net/api/IHomeApi.kt
View file @
ebd1bd9b
...
@@ -238,4 +238,11 @@ interface IHomeApi {
...
@@ -238,4 +238,11 @@ interface IHomeApi {
@Query
(
"nickname"
)
nickname
:
String
?,
@Query
(
"nickname"
)
nickname
:
String
?,
@Query
(
"picture"
)
picture
:
String
?
@Query
(
"picture"
)
picture
:
String
?
):
Observable
<
Response
<
WxBindEntity
?
>>
):
Observable
<
Response
<
WxBindEntity
?
>>
@POST
(
NetConfig
.
User
.
URL_AUTH_FACEBOOK_LOGIN
)
fun
authFaceBookLogin
(
@Query
(
"userID"
)
userID
:
String
?,
@Query
(
"nickname"
)
nickname
:
String
?,
@Query
(
"picture"
)
picture
:
String
?
):
Observable
<
Response
<
WxBindEntity
?
>>
}
}
\ No newline at end of file
cms/src/main/java/com/zxhl/cms/utils/WeChatUtils.kt
View file @
ebd1bd9b
...
@@ -35,7 +35,7 @@ class WeChatUtils {
...
@@ -35,7 +35,7 @@ class WeChatUtils {
}
}
fun
isWechatLogin
(
callback
:
IsLoginCallBack
<
IsWeChatLoginEntity
>?)
{
fun
isWechatLogin
(
callback
:
IsLoginCallBack
<
IsWeChatLoginEntity
>?)
{
ApiClient
.
homeApi
.
isWxLogin
().
compose
(
RxSchedulers
.
observableIO2Main
())
ApiClient
.
homeApi
.
isWxLogin
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
IsWeChatLoginEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
IsWeChatLoginEntity
>()
{
override
fun
onSuccess
(
result
:
IsWeChatLoginEntity
?)
{
override
fun
onSuccess
(
result
:
IsWeChatLoginEntity
?)
{
...
@@ -48,7 +48,7 @@ class WeChatUtils {
...
@@ -48,7 +48,7 @@ class WeChatUtils {
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
callback
?.
onError
(
code
,
errorMsg
)
callback
?.
onError
(
code
,
errorMsg
)
}
}
})
})
...
@@ -159,7 +159,8 @@ class WeChatUtils {
...
@@ -159,7 +159,8 @@ class WeChatUtils {
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat
.
platformActionListener
=
object
:
PlatformActionListener
{
plat
.
platformActionListener
=
object
:
PlatformActionListener
{
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
Log
.
e
(
"MXL"
,
"FaceBook:onComplete"
)
Log
.
e
(
"MXL"
,
"Data:"
+
p0
?.
db
?.
exportData
()+
"Image:"
+
p0
?.
db
?.
userIcon
)
bindFaceBookLogin
(
p0
?.
db
?.
userId
,
p0
?.
db
?.
userName
,
p0
?.
db
?.
userIcon
)
}
}
override
fun
onError
(
arg0
:
Platform
,
arg1
:
Int
,
arg2
:
Throwable
)
{
override
fun
onError
(
arg0
:
Platform
,
arg1
:
Int
,
arg2
:
Throwable
)
{
...
@@ -175,8 +176,28 @@ class WeChatUtils {
...
@@ -175,8 +176,28 @@ class WeChatUtils {
plat
.
showUser
(
null
)
plat
.
showUser
(
null
)
}
}
fun
bindFaceBookLogin
(
userId
:
String
?,
userName
:
String
?,
picture
:
String
?)
{
ApiClient
.
homeApi
.
authFaceBookLogin
(
userId
,
userName
,
picture
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
WxBindEntity
>()
{
override
fun
onSuccess
(
result
:
WxBindEntity
?)
{
SettingPreference
.
saveToken
(
result
?.
token
)
UserDataUtils
.
updateUserInfo
(
null
)
Log
.
e
(
"MXL"
,
"FaceBook登录成功"
)
// getShareCon tent(mContext)
// callBack.loginSuccess(lottery)
callBack
.
loginSuccess
(
""
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
// callBack.loginSuccess(lottery)
}
})
}
fun
GoogleLogin
()
{
fun
GoogleLogin
()
{
// MobSDK.submitPolicyGrantResult(true, null)
// MobSDK.submitPolicyGrantResult(true, null)
val
plat
=
ShareSDK
.
getPlatform
(
GooglePlus
.
NAME
)
val
plat
=
ShareSDK
.
getPlatform
(
GooglePlus
.
NAME
)
ShareSDK
.
setActivity
(
mContext
as
Activity
)
ShareSDK
.
setActivity
(
mContext
as
Activity
)
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
...
@@ -188,7 +209,9 @@ class WeChatUtils {
...
@@ -188,7 +209,9 @@ class WeChatUtils {
val
g
=
Gson
()
val
g
=
Gson
()
val
obj
:
JsonObject
=
g
.
fromJson
(
p0
?.
db
?.
exportData
(),
JsonObject
::
class
.
java
)
val
obj
:
JsonObject
=
g
.
fromJson
(
p0
?.
db
?.
exportData
(),
JsonObject
::
class
.
java
)
Log
.
e
(
"MXL"
,
"PIC:"
+
obj
.
get
(
"picture"
))
Log
.
e
(
"MXL"
,
"PIC:"
+
obj
.
get
(
"picture"
))
bindGoogle
(
p0
?.
db
?.
userId
,
p0
?.
db
?.
userName
,
obj
.
get
(
"picture"
).
toString
())
val
pic
=
obj
.
get
(
"picture"
).
toString
().
replace
(
"\""
,
""
)
Log
.
e
(
"MXL"
,
"image:"
+
pic
)
bindGoogle
(
p0
?.
db
?.
userId
,
p0
?.
db
?.
userName
,
pic
)
}
}
}
}
...
...
tmpmob/ShareSDK/assets/ShareSDK.xml
View file @
ebd1bd9b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<QZone
Enable=
"false"
/>
<QZone
Enable=
"false"
/>
<Renren
Enable=
"false"
/>
<Renren
Enable=
"false"
/>
<KaiXin
Enable=
"false"
/>
<KaiXin
Enable=
"false"
/>
<Facebook
Id=
"8"
SortId=
"8"
OfficialVersion=
"default"
FaceBookLoginProtocolScheme=
"fb
662970168312513"
ShareByAppClient=
"true"
Enable=
"true"
ConsumerKey=
"662970168312513
"
RedirectUrl=
"https://www.baidu.com"
/>
<Facebook
Id=
"8"
SortId=
"8"
OfficialVersion=
"default"
FaceBookLoginProtocolScheme=
"fb
1156014961815312"
ShareByAppClient=
"true"
Enable=
"true"
ConsumerKey=
"1156014961815312
"
RedirectUrl=
"https://www.baidu.com"
/>
<Twitter
Enable=
"false"
/>
<Twitter
Enable=
"false"
/>
<Evernote
Enable=
"false"
/>
<Evernote
Enable=
"false"
/>
<FourSquare
Enable=
"false"
/>
<FourSquare
Enable=
"false"
/>
...
...
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