ソースを参照

simplize pay and recharge

hanjing 6 年 前
コミット
b87b78c7c2

+ 1 - 1
app/build.gradle

@@ -26,7 +26,7 @@ android {
         }
         }
     }
     }
     greendao {
     greendao {
-        schemaVersion 17
+        schemaVersion 18
         targetGenDir 'src/main/java'
         targetGenDir 'src/main/java'
     }
     }
     signingConfigs {
     signingConfigs {

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -539,6 +539,20 @@ public class DDProviderHelper {
     }
     }
 
 
     /**
     /**
+     * 用token获取对应服务器下登录过的用户
+     */
+    public SdkLoginUser getSdkLoginUser(String token) {
+        token = token.substring(0, token.indexOf("@") + 1);
+        return getDaossion()
+                .getSdkLoginUserDao()
+                .queryBuilder()
+                .where(SdkLoginUserDao.Properties.Token.like(token + "%"))
+                .build()
+                .unique();
+    }
+
+
+    /**
      * 添加或更新记录
      * 添加或更新记录
      * 添加成功返回true
      * 添加成功返回true
      *
      *

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
 
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
 /**
- * Master of DAO (schema version 17): knows all DAOs.
+ * Master of DAO (schema version 18): knows all DAOs.
  */
  */
 public class DaoMaster extends AbstractDaoMaster {
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 17;
+    public static final int SCHEMA_VERSION = 18;
 
 
     /** Creates underlying database table using DAOs. */
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
     public static void createAllTables(Database db, boolean ifNotExists) {

+ 14 - 2
app/src/main/java/com/sheep/gamegroup/greendao/download/SdkLoginUser.java

@@ -21,6 +21,8 @@ public class SdkLoginUser {
     private String token;
     private String token;
     @Property(nameInDb = "nickname")
     @Property(nameInDb = "nickname")
     private String nickname;
     private String nickname;
+    @Property(nameInDb = "loginname")
+    private String loginname;
     @Property(nameInDb = "invitation_code")
     @Property(nameInDb = "invitation_code")
     private String invitation_code;
     private String invitation_code;
     @Property(nameInDb = "avatar")
     @Property(nameInDb = "avatar")
@@ -56,6 +58,15 @@ public class SdkLoginUser {
     public void setInvitation_code(String invitation_code) {
     public void setInvitation_code(String invitation_code) {
         this.invitation_code = invitation_code;
         this.invitation_code = invitation_code;
     }
     }
+
+    public String getLoginname() {
+        return loginname;
+    }
+
+    public void setLoginname(String loginname) {
+        this.loginname = loginname;
+    }
+
     public String getNickname() {
     public String getNickname() {
         return this.nickname;
         return this.nickname;
     }
     }
@@ -74,13 +85,14 @@ public class SdkLoginUser {
     public void setId(Long id) {
     public void setId(Long id) {
         this.id = id;
         this.id = id;
     }
     }
-    @Generated(hash = 228164197)
-    public SdkLoginUser(Long id, String token, String nickname,
+    @Generated(hash = 308043954)
+    public SdkLoginUser(Long id, String token, String nickname, String loginname,
             String invitation_code, String avatar, String serviceName,
             String invitation_code, String avatar, String serviceName,
             String lastLoginTime) {
             String lastLoginTime) {
         this.id = id;
         this.id = id;
         this.token = token;
         this.token = token;
         this.nickname = nickname;
         this.nickname = nickname;
+        this.loginname = loginname;
         this.invitation_code = invitation_code;
         this.invitation_code = invitation_code;
         this.avatar = avatar;
         this.avatar = avatar;
         this.serviceName = serviceName;
         this.serviceName = serviceName;

+ 38 - 24
app/src/main/java/com/sheep/gamegroup/greendao/download/SdkLoginUserDao.java

@@ -25,10 +25,11 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
         public final static Property Id = new Property(0, Long.class, "id", true, "_id");
         public final static Property Id = new Property(0, Long.class, "id", true, "_id");
         public final static Property Token = new Property(1, String.class, "token", false, "token");
         public final static Property Token = new Property(1, String.class, "token", false, "token");
         public final static Property Nickname = new Property(2, String.class, "nickname", false, "nickname");
         public final static Property Nickname = new Property(2, String.class, "nickname", false, "nickname");
-        public final static Property Invitation_code = new Property(3, String.class, "invitation_code", false, "invitation_code");
-        public final static Property Avatar = new Property(4, String.class, "avatar", false, "avatar");
-        public final static Property ServiceName = new Property(5, String.class, "serviceName", false, "service_name");
-        public final static Property LastLoginTime = new Property(6, String.class, "lastLoginTime", false, "last_login_time");
+        public final static Property Loginname = new Property(3, String.class, "loginname", false, "loginname");
+        public final static Property Invitation_code = new Property(4, String.class, "invitation_code", false, "invitation_code");
+        public final static Property Avatar = new Property(5, String.class, "avatar", false, "avatar");
+        public final static Property ServiceName = new Property(6, String.class, "serviceName", false, "service_name");
+        public final static Property LastLoginTime = new Property(7, String.class, "lastLoginTime", false, "last_login_time");
     }
     }
 
 
 
 
@@ -47,10 +48,11 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
                 "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                 "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                 "\"token\" TEXT," + // 1: token
                 "\"token\" TEXT," + // 1: token
                 "\"nickname\" TEXT," + // 2: nickname
                 "\"nickname\" TEXT," + // 2: nickname
-                "\"invitation_code\" TEXT," + // 3: invitation_code
-                "\"avatar\" TEXT," + // 4: avatar
-                "\"service_name\" TEXT," + // 5: serviceName
-                "\"last_login_time\" TEXT);"); // 6: lastLoginTime
+                "\"loginname\" TEXT," + // 3: loginname
+                "\"invitation_code\" TEXT," + // 4: invitation_code
+                "\"avatar\" TEXT," + // 5: avatar
+                "\"service_name\" TEXT," + // 6: serviceName
+                "\"last_login_time\" TEXT);"); // 7: lastLoginTime
     }
     }
 
 
     /** Drops the underlying database table. */
     /** Drops the underlying database table. */
@@ -78,24 +80,29 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
             stmt.bindString(3, nickname);
             stmt.bindString(3, nickname);
         }
         }
  
  
+        String loginname = entity.getLoginname();
+        if (loginname != null) {
+            stmt.bindString(4, loginname);
+        }
+ 
         String invitation_code = entity.getInvitation_code();
         String invitation_code = entity.getInvitation_code();
         if (invitation_code != null) {
         if (invitation_code != null) {
-            stmt.bindString(4, invitation_code);
+            stmt.bindString(5, invitation_code);
         }
         }
  
  
         String avatar = entity.getAvatar();
         String avatar = entity.getAvatar();
         if (avatar != null) {
         if (avatar != null) {
-            stmt.bindString(5, avatar);
+            stmt.bindString(6, avatar);
         }
         }
  
  
         String serviceName = entity.getServiceName();
         String serviceName = entity.getServiceName();
         if (serviceName != null) {
         if (serviceName != null) {
-            stmt.bindString(6, serviceName);
+            stmt.bindString(7, serviceName);
         }
         }
  
  
         String lastLoginTime = entity.getLastLoginTime();
         String lastLoginTime = entity.getLastLoginTime();
         if (lastLoginTime != null) {
         if (lastLoginTime != null) {
-            stmt.bindString(7, lastLoginTime);
+            stmt.bindString(8, lastLoginTime);
         }
         }
     }
     }
 
 
@@ -118,24 +125,29 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
             stmt.bindString(3, nickname);
             stmt.bindString(3, nickname);
         }
         }
  
  
+        String loginname = entity.getLoginname();
+        if (loginname != null) {
+            stmt.bindString(4, loginname);
+        }
+ 
         String invitation_code = entity.getInvitation_code();
         String invitation_code = entity.getInvitation_code();
         if (invitation_code != null) {
         if (invitation_code != null) {
-            stmt.bindString(4, invitation_code);
+            stmt.bindString(5, invitation_code);
         }
         }
  
  
         String avatar = entity.getAvatar();
         String avatar = entity.getAvatar();
         if (avatar != null) {
         if (avatar != null) {
-            stmt.bindString(5, avatar);
+            stmt.bindString(6, avatar);
         }
         }
  
  
         String serviceName = entity.getServiceName();
         String serviceName = entity.getServiceName();
         if (serviceName != null) {
         if (serviceName != null) {
-            stmt.bindString(6, serviceName);
+            stmt.bindString(7, serviceName);
         }
         }
  
  
         String lastLoginTime = entity.getLastLoginTime();
         String lastLoginTime = entity.getLastLoginTime();
         if (lastLoginTime != null) {
         if (lastLoginTime != null) {
-            stmt.bindString(7, lastLoginTime);
+            stmt.bindString(8, lastLoginTime);
         }
         }
     }
     }
 
 
@@ -150,10 +162,11 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
             cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
             cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
             cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // token
             cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // token
             cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // nickname
             cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // nickname
-            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // invitation_code
-            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // avatar
-            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // serviceName
-            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6) // lastLoginTime
+            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // loginname
+            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // invitation_code
+            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // avatar
+            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // serviceName
+            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // lastLoginTime
         );
         );
         return entity;
         return entity;
     }
     }
@@ -163,10 +176,11 @@ public class SdkLoginUserDao extends AbstractDao<SdkLoginUser, Long> {
         entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
         entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
         entity.setToken(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
         entity.setToken(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
         entity.setNickname(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
         entity.setNickname(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
-        entity.setInvitation_code(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
-        entity.setAvatar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
-        entity.setServiceName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
-        entity.setLastLoginTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
+        entity.setLoginname(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
+        entity.setInvitation_code(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
+        entity.setAvatar(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
+        entity.setServiceName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
+        entity.setLastLoginTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
      }
      }
     
     
     @Override
     @Override

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -142,6 +142,9 @@ public interface ApiService {
     @GET("app/user/get_info/")
     @GET("app/user/get_info/")
     Observable<BaseMessage> getInfo();
     Observable<BaseMessage> getInfo();
 
 
+    @GET("app/user/get_info/")
+    Observable<BaseMessage> getInfo(@Header("Authorization") String token);
+
     /**
     /**
      * 用户设备信息记录
      * 用户设备信息记录
      */
      */

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/CertificationUtil.java

@@ -131,6 +131,7 @@ public class CertificationUtil {
         newSdkLoginUser.setLastLoginTime(userEntity.getLast_login_time());
         newSdkLoginUser.setLastLoginTime(userEntity.getLast_login_time());
         newSdkLoginUser.setInvitation_code(userEntity.getInvitation_code());
         newSdkLoginUser.setInvitation_code(userEntity.getInvitation_code());
         newSdkLoginUser.setNickname(userEntity.getNickname());
         newSdkLoginUser.setNickname(userEntity.getNickname());
+        newSdkLoginUser.setLoginname(userEntity.getUser_name());
         newSdkLoginUser.setServiceName(SheepApp.getInstance().getConnectAddress().name());
         newSdkLoginUser.setServiceName(SheepApp.getInstance().getConnectAddress().name());
         DDProviderHelper.getInstance().addOrUpdateSdkLoginUser(newSdkLoginUser, null);
         DDProviderHelper.getInstance().addOrUpdateSdkLoginUser(newSdkLoginUser, null);
     }
     }

+ 25 - 0
app/src/main/java/com/sheep/gamegroup/util/CommonUtil.java

@@ -757,6 +757,31 @@ public class CommonUtil {
                 });
                 });
     }
     }
 
 
+    public void getUserInfo(String token, final Action1<UserEntity> action1) {
+        SheepApp.getInstance()
+                .getNetComponent()
+                .getApiService()
+                .getInfo(token)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if (action1 != null) {
+                            action1.call(null);
+                        }
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        UserEntity userEntity = baseMessage.getData(UserEntity.class);
+                        if (action1 != null) {
+                            action1.call(userEntity);
+                        }
+                    }
+                });
+    }
+
     /**
     /**
      * 获取重定向后的url
      * 获取重定向后的url
      */
      */

+ 12 - 19
app/src/main/java/com/sheep/gamegroup/view/activity/ActPay.java

@@ -94,26 +94,19 @@ public class ActPay extends BaseActivity {
             pay_type = bundle.getString("pay_type");
             pay_type = bundle.getString("pay_type");
             from_package = bundle.getString("from_package");
             from_package = bundle.getString("from_package");
             token = bundle.getString("token");
             token = bundle.getString("token");
-            List<SdkLoginUser> sdkUsers = DDProviderHelper.getInstance().getSdkLoginUserList(SheepApp.getInstance().getConnectAddress().name());
-            String userId = token.substring(0, token.indexOf("@") + 1);
-            for (SdkLoginUser user : sdkUsers) {
-                if (user.getToken().startsWith(userId)) {
-                    token = user.getToken();
-                    showProgress();
-                    CommonUtil.getInstance().checkAuth(token, result -> {
-                        hideProgress();
-                        if (result) {
-                            doPay();
-                        } else {
-                            Jump2View.getInstance().goRechargeResult(this, "9001", from_package, null, "用户认证已失效,请重新登录");
-                            finish();
-                        }
-                    });
-                    return;
-                }
+            SdkLoginUser user = DDProviderHelper.getInstance().getSdkLoginUser(token);
+            if (user != null) {
+                token = user.getToken();
             }
             }
-            Jump2View.getInstance().goRechargeResult(this, "9001", from_package, null, "用户信息不一致,请重新登录");
-            finish();
+            CommonUtil.getInstance().checkAuth(token, result -> {
+                hideProgress();
+                if (result) {
+                    doPay();
+                } else {
+                    Jump2View.getInstance().goRechargeResult(this, "9001", from_package, null, "用户信息不一致,请重新登录");
+                    finish();
+                }
+            });
         }
         }
     }
     }
 
 

+ 7 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/GameCertificationActivity.java

@@ -54,6 +54,8 @@ public class GameCertificationActivity extends BaseActivity {
     TextView app_name_tv;
     TextView app_name_tv;
     @BindView(R.id.sdk_user_name)
     @BindView(R.id.sdk_user_name)
     TextView sdk_user_name;
     TextView sdk_user_name;
+    @BindView(R.id.sdk_login_name)
+    TextView sdk_login_name;
     @BindView(R.id.sdk_user_code)
     @BindView(R.id.sdk_user_code)
     TextView sdk_user_code;
     TextView sdk_user_code;
     @BindView(R.id.sdk_user_iv)
     @BindView(R.id.sdk_user_iv)
@@ -188,9 +190,9 @@ public class GameCertificationActivity extends BaseActivity {
     }
     }
 
 
     @Override
     @Override
-    public void onResume(){
+    public void onResume() {
         super.onResume();
         super.onResume();
-        if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
+        if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
             finish();
             finish();
         }
         }
     }
     }
@@ -282,6 +284,9 @@ public class GameCertificationActivity extends BaseActivity {
      */
      */
     private void initWidget() {
     private void initWidget() {
         ViewUtil.setText(sdk_user_name, userEntity.getNickname());
         ViewUtil.setText(sdk_user_name, userEntity.getNickname());
+        if (!TextUtils.isEmpty(userEntity.getUser_name())) {
+            ViewUtil.setText(sdk_user_name, userEntity.getNickname());
+        }
         ViewUtil.setText(sdk_user_code, userEntity.getInvitation_code());
         ViewUtil.setText(sdk_user_code, userEntity.getInvitation_code());
         GlideImageLoader.setAvatar(sdk_user_iv, userEntity.getAvatar());
         GlideImageLoader.setAvatar(sdk_user_iv, userEntity.getAvatar());
     }
     }

+ 39 - 42
app/src/main/java/com/sheep/gamegroup/view/activity/RechargeAct.java

@@ -129,35 +129,49 @@ public class RechargeAct extends BaseActivity {
 
 
     @Override
     @Override
     public void initData() {
     public void initData() {
-        UserEntity user = DataUtil.getInstance().getUserEntity();
-        if (fromToken == null && user == null) {
-            Jump2View.getInstance().goRechargeResult(RechargeAct.this, "9002", fromPackage, null, "请登录");
-            finish();
-            return;
-        }
         if (!TextUtils.isEmpty(fromToken)) {
         if (!TextUtils.isEmpty(fromToken)) {
-            List<SdkLoginUser> sdkUsers = DDProviderHelper.getInstance().getSdkLoginUserList(SheepApp.getInstance().getConnectAddress().name());
-            SdkLoginUser sdkUser = null;
-            String uid = fromToken.substring(0, fromToken.indexOf("@") + 1);
-            for (SdkLoginUser u : sdkUsers) {
-                if (u.getToken().startsWith(uid)) {
-                    sdkUser = u;
-                    break;
-                }
-            }
+            SdkLoginUser sdkUser = DDProviderHelper.getInstance().getSdkLoginUser(fromToken);
             if (sdkUser != null) {
             if (sdkUser != null) {
                 fromToken = sdkUser.getToken();
                 fromToken = sdkUser.getToken();
-                sheep_no_view.append(sdkUser.getInvitation_code());
-                nickname_view.append(sdkUser.getNickname());
-            } else {
+            }
+            CommonUtil.getInstance().checkAuth(fromToken, (ret) -> {
+                if (ret) {
+                    if (sdkUser != null) {
+                        // todo 出口一
+                        configView(sdkUser.getInvitation_code(), sdkUser.getNickname());
+                    } else {
+                        CommonUtil.getInstance().getUserInfo(fromToken, (userEntity) -> {
+                            if (userEntity != null) {
+                                //todo 出口三
+                                configView(userEntity.getInvitation_code(), userEntity.getNickname());
+                            } else {
+                                Jump2View.getInstance().goRechargeResult(RechargeAct.this, "9002", fromPackage, null, "查询不到用户信息,请登录");
+                                finish();
+                            }
+                        });
+                    }
+                } else {
+                    Jump2View.getInstance().goRechargeResult(RechargeAct.this, "9002", fromPackage, null, "用户授权已过期,请登录");
+                    finish();
+                }
+            });
+        } else {
+            // todo 出口二
+            UserEntity user = DataUtil.getInstance().getUserEntity();
+            if (user == null) {
                 Jump2View.getInstance().goRechargeResult(RechargeAct.this, "9002", fromPackage, null, "请登录");
                 Jump2View.getInstance().goRechargeResult(RechargeAct.this, "9002", fromPackage, null, "请登录");
                 finish();
                 finish();
                 return;
                 return;
             }
             }
-        } else {
-            sheep_no_view.append(user.getInvitation_code());
-            nickname_view.append(user.getNickname());
+            fromToken = SpUtils.getToken(this);
+            configView(user.getInvitation_code(), user.getNickname());
         }
         }
+
+    }
+
+    private void configView(String invitationCode, String nickname) {
+        sheep_no_view.append(invitationCode);
+        nickname_view.append(nickname);
         addDatas();
         addDatas();
         /*
         /*
           支付金额选择
           支付金额选择
@@ -179,8 +193,6 @@ public class RechargeAct extends BaseActivity {
             rechargePriceAdapter.notifyDataSetChanged();
             rechargePriceAdapter.notifyDataSetChanged();
 
 
         });
         });
-
-
         /*
         /*
           支付方式选择
           支付方式选择
          */
          */
@@ -213,29 +225,15 @@ public class RechargeAct extends BaseActivity {
         act_ral_pay_type_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         act_ral_pay_type_rv.setLayoutManager(new LinearLayoutManager(SheepApp.getInstance()));
         rechargeAdapter.bindToRecyclerView(act_ral_pay_type_rv);
         rechargeAdapter.bindToRecyclerView(act_ral_pay_type_rv);
 
 
-        if (fromToken != null) {
-            CommonUtil.getInstance().checkAuth(fromToken, result -> {
-                if (result) {
-                    showProgress();
-                    getRechargePayway();
-                } else {
-                    String resultCode = "9001";
-                    Jump2View.getInstance().goRechargeResult(RechargeAct.this, resultCode, fromPackage, null, "用户信息不一致,请再次确认用户信息");
-                    finish();
-                }
-            });
-        } else {
-            showProgress();
-            getRechargePayway();
-        }
+        showProgress();
+        getRechargePayway();
     }
     }
 
 
     private List<RechargeEntity> rechargeEntityList = new ArrayList<>();
     private List<RechargeEntity> rechargeEntityList = new ArrayList<>();
 
 
     private void getRechargePayway() {
     private void getRechargePayway() {
         // 参数 1:没有绵羊币的,2:是全部
         // 参数 1:没有绵羊币的,2:是全部
-        String t = (TextUtils.isEmpty(fromToken)) ? SpUtils.getToken(this) : fromToken;
-        SheepApp.getInstance().getNetComponent().getApiService().getRechargePayway(t, "1")
+        SheepApp.getInstance().getNetComponent().getApiService().getRechargePayway(fromToken, "1")
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(RechargeAct.this) {
                 .subscribe(new SheepSubscriber<BaseMessage>(RechargeAct.this) {
@@ -264,8 +262,7 @@ public class RechargeAct extends BaseActivity {
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("Amount", Float.valueOf(mAmount));
         jsonObject.put("Amount", Float.valueOf(mAmount));
         jsonObject.put("PayType", mPayType);
         jsonObject.put("PayType", mPayType);
-        String t = (TextUtils.isEmpty(fromToken)) ? SpUtils.getToken(this) : fromToken;
-        SheepApp.getInstance().getNetComponent().getApiService().getRechargeBalance(t, jsonObject)
+        SheepApp.getInstance().getNetComponent().getApiService().getRechargeBalance(fromToken, jsonObject)
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(RechargeAct.this) {
                 .subscribe(new SheepSubscriber<BaseMessage>(RechargeAct.this) {

+ 19 - 6
app/src/main/res/layout/include_sdk_user.xml

@@ -39,13 +39,26 @@
             android:layout_height="0dp"
             android:layout_height="0dp"
             android:layout_weight="1" />
             android:layout_weight="1" />
 
 
-        <TextView
-            android:id="@+id/sdk_user_name"
+        <LinearLayout
+            android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="账号"
-            android:textColor="#000000"
-            android:textSize="14sp" />
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/sdk_user_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="账号"
+                android:textColor="#000000"
+                android:textSize="14sp" />
+            <TextView
+                android:id="@+id/sdk_login_name"
+                android:layout_marginLeft="8dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="(账号)"
+                android:textColor="#000000"
+                android:textSize="12sp" />
+        </LinearLayout>
 
 
         <View
         <View
             android:layout_width="match_parent"
             android:layout_width="match_parent"