Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3dfd0c2c
authored
Nov 24, 2024
by
han xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
身份验证增加更新功能
parent
a5528917
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
48 deletions
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/CertificationUpdateActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/RegisterActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/CertificationUpdateActivity.java
View file @
3dfd0c2c
...
...
@@ -10,6 +10,7 @@ import com.dayu.base.api.BaseApiFactory;
import
com.dayu.base.ui.activity.BaseActivity
;
import
com.dayu.base.ui.presenter.SImplePresenter
;
import
com.dayu.common.Constants
;
import
com.dayu.event.UserInfo
;
import
com.dayu.provider.event.CertificationEvent
;
import
com.dayu.provider.event.RefreshEvent
;
import
com.dayu.provider.router.RouterPath
;
...
...
@@ -175,25 +176,33 @@ public class CertificationUpdateActivity extends BaseActivity<SImplePresenter, A
}
showDialog
();
if
(
TextUtils
.
isEmpty
(
identityUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(!
TextUtils
.
isEmpty
(
identityUrl
)
&&
!
TextUtils
.
isEmpty
(
identityBackUrl
)){
uploadImageCount
=
0
;
save
();
}
else
{
if
(
TextUtils
.
isEmpty
(
identityUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
identityBackUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityBackPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityBackUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
if
(
TextUtils
.
isEmpty
(
identityBackUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityBackPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityBackUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
}
}
private
void
save
()
{
...
...
@@ -204,11 +213,22 @@ public class CertificationUpdateActivity extends BaseActivity<SImplePresenter, A
ServiceSaveBean1
.
AccountIdCardExt
accountExt
=
new
ServiceSaveBean1
.
AccountIdCardExt
(
mUserId
,
identityUrl
,
identityBackUrl
);
Api
.
getService
(
UserService2
.
class
).
commitCertificationUpdate
(
accountExt
).
compose
(
Api
.
applySchedulers
())
.
subscribe
(
mPresenter
.
baseObserver
(
bool
->
{
ToastUtils
.
showShortToast
(
bool
?
R
.
string
.
save_success
:
R
.
string
.
save_fail
);
CommonUtils
.
hideSoftInput
(
mActivity
);
EventBus
.
getDefault
().
post
(
new
CertificationEvent
(
1
));
EventBus
.
getDefault
().
post
(
new
RefreshEvent
());
finish
();
//更新信息
Api
.
getService
(
com
.
dayu
.
base
.
api
.
APIService
.
class
).
getDetectStatus
(
mUserId
).
compose
(
Api
.
applySchedulers
())
.
subscribe
(
mPresenter
.
baseObserver
(
integer
->
{
UserInfo
user
=
UserManager
.
getInstance
().
getUser
();
user
.
setDetectStatus
(
integer
);
UserManager
.
getInstance
().
saveUser
(
user
);
ToastUtils
.
showShortToast
(
bool
?
R
.
string
.
save_success
:
R
.
string
.
save_fail
);
CommonUtils
.
hideSoftInput
(
mActivity
);
EventBus
.
getDefault
().
post
(
new
CertificationEvent
(
1
));
EventBus
.
getDefault
().
post
(
new
RefreshEvent
());
finish
();
}));
}));
}
...
...
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/RegisterActivity.java
View file @
3dfd0c2c
...
...
@@ -227,35 +227,42 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}
showDialog
();
if
(
TextUtils
.
isEmpty
(
identityUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(!
TextUtils
.
isEmpty
(
identityUrl
)
&&
!
TextUtils
.
isEmpty
(
identityUrl
)
&&
!
TextUtils
.
isEmpty
(
identityBackUrl
)){
uploadImageCount
=
0
;
save
();
}
else
{
if
(
TextUtils
.
isEmpty
(
identityUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
identityBackUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityBackPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityBackUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
identityBackUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityBackPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityBackUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
accountUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
accountPath
),
Constants
.
PHOTO
+
"/privacy/head"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
imgs
->
{
accountUrl
=
imgs
.
get
(
0
);
uploadImageCount
--;
if
(
TextUtils
.
isEmpty
(
accountUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
accountPath
),
Constants
.
PHOTO
+
"/privacy/head"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
imgs
->
{
accountUrl
=
imgs
.
get
(
0
);
uploadImageCount
--;
save
();
}));
save
();
}));
}
}
}
...
...
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