From 754063ec4a78fd80e9db6db12b3bb74653cddf7f Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期三, 02 四月 2025 09:59:37 +0800 Subject: [PATCH] fix : 默认手机号 --- app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt b/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt index 1b08dec..34b85f4 100644 --- a/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt +++ b/app/src/main/java/com/example/firstapp/utils/PreferencesManager.kt @@ -8,6 +8,7 @@ private const val KEY_TOKEN = "user_token" private const val KEY_PHONE = "user_phone" private const val KEY_FIRST_INSTALL = "first_install" + private const val LAST_LOGIN_PHONE = "last_login_phone" private lateinit var preferences: SharedPreferences @@ -46,4 +47,12 @@ fun setFirstInstall(isFirst: Boolean) { preferences.edit().putBoolean(KEY_FIRST_INSTALL, isFirst).apply() } + + fun saveLastLoginPhone(phone: String) { + preferences.edit().putString(LAST_LOGIN_PHONE, phone).apply() + } + + fun getLastLoginPhone(): String { + return preferences.getString(LAST_LOGIN_PHONE, "") ?: "" + } } \ No newline at end of file -- Gitblit v1.9.3