Ejemplo n.º 1
0
  public static int getCustomerId() {
    if (StateValues.getCustomerId() == 0) return 0;

    String loginKey =
        EncodeHelper.encryptPWD(
            String.valueOf(StateValues.getCustomerId()), getUserName(), StateValues.getLoginTime());
    if (!loginKey.equals(StateValues.getLoginKey())) return 0;

    LoginInfo loginInfo = getLoginInfo();
    if (loginInfo == null) return 0;

    if (loginInfo.getP2pCustomerId() != StateValues.getCustomerId()) return 0;

    return loginInfo.getP2pCustomerId();
  }