|
|
@@ -35,6 +35,7 @@ public class AccountRepository {
|
|
|
public static String token;
|
|
|
private final AtmobApi atmobApi;
|
|
|
private final DeviceFuncRepository deviceFuncRepository;
|
|
|
+ private final PayRepository payRepository;
|
|
|
|
|
|
private int errorCodeTimes;
|
|
|
|
|
|
@@ -45,9 +46,10 @@ public class AccountRepository {
|
|
|
}
|
|
|
|
|
|
@Inject
|
|
|
- public AccountRepository(AtmobApi atmobApi, DeviceFuncRepository deviceFuncRepository) {
|
|
|
+ public AccountRepository(AtmobApi atmobApi, DeviceFuncRepository deviceFuncRepository, PayRepository payRepository) {
|
|
|
this.atmobApi = atmobApi;
|
|
|
this.deviceFuncRepository = deviceFuncRepository;
|
|
|
+ this.payRepository = payRepository;
|
|
|
loginPhoneNum.setValue(KVUtils.getDefault().getString(KEY_LOGIN_PHONE_NUM, null));
|
|
|
isLogin.observeForever(isLogin -> AtmobLog.d(TAG, "isLogin: " + isLogin));
|
|
|
deviceFuncRepository.refreshFuncAuths();
|
|
|
@@ -65,6 +67,7 @@ public class AccountRepository {
|
|
|
AccountRepository.token = token;
|
|
|
this.loginPhoneNum.setValue(phoneNum);
|
|
|
deviceFuncRepository.refreshFuncAuths();
|
|
|
+ payRepository.refreshOrderPageList();
|
|
|
KVUtils.getDefault().putString(KEY_LOGIN_PHONE_NUM, phoneNum);
|
|
|
KVUtils.getDefault().putString(KEY_LOGIN_TOKEN, token);
|
|
|
|
|
|
@@ -114,6 +117,7 @@ public class AccountRepository {
|
|
|
}
|
|
|
token = null;
|
|
|
deviceFuncRepository.clearAuths();
|
|
|
+ payRepository.clearOderList();
|
|
|
KVUtils.getDefault().putString(KEY_LOGIN_PHONE_NUM, "");
|
|
|
KVUtils.getDefault().putString(KEY_LOGIN_TOKEN, "");
|
|
|
if (BoxingUtil.boxing(isLogin.getValue())) {
|