|
|
@@ -17,7 +17,10 @@ object SPUtils {
|
|
|
private const val KEY_LOGIN_USER_ROLE_KEY = "role_key"
|
|
|
|
|
|
fun getLoginUser(context: Context): CardInfoRespVO? {
|
|
|
- val sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE) ?: return null
|
|
|
+ val sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE)
|
|
|
+ if (sp.getLong(KEY_LOGIN_USER_USER_ID, 0) == 0L) {
|
|
|
+ return null
|
|
|
+ }
|
|
|
return CardInfoRespVO(
|
|
|
cardId = sp.getLong(KEY_LOGIN_USER_CARD_ID, 0),
|
|
|
cardCode = sp.getString(KEY_LOGIN_USER_CARD_CODE, null),
|