Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
HBHAndroid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨秀秀
HBHAndroid
Commits
7b2784d8
Commit
7b2784d8
authored
Jul 29, 2024
by
小费同学阿
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础搭建
功能开发 1:bug 修复 消费者端修复登录超时问题
parent
04e5f67a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
AndroidManifest.xml
consumer/src/main/AndroidManifest.xml
+8
-6
SettingsViewModel.java
...ava/com/xx/hbhconsumer/ui/settings/SettingsViewModel.java
+18
-3
No files found.
consumer/src/main/AndroidManifest.xml
View file @
7b2784d8
...
@@ -39,11 +39,6 @@
...
@@ -39,11 +39,6 @@
<activity
<activity
android:name=
".ui.login.LoginActivity"
android:name=
".ui.login.LoginActivity"
android:exported=
"true"
>
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</activity>
...
@@ -238,7 +233,14 @@
...
@@ -238,7 +233,14 @@
<!-- 注册首页页面-->
<!-- 注册首页页面-->
<activity
<activity
android:name=
".ui.main.MainActivity"
android:name=
".ui.main.MainActivity"
android:exported=
"true"
/>
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<!-- 忘记密码页面-->
<!-- 忘记密码页面-->
<activity
<activity
android:name=
".ui.pwd.ForgetPwdActivity"
android:name=
".ui.pwd.ForgetPwdActivity"
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/settings/SettingsViewModel.java
View file @
7b2784d8
...
@@ -6,6 +6,7 @@ import android.content.SharedPreferences;
...
@@ -6,6 +6,7 @@ import android.content.SharedPreferences;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -70,10 +71,24 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
...
@@ -70,10 +71,24 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
version
.
set
(
"当前版本V"
+
packInfo
.
versionName
);
version
.
set
(
"当前版本V"
+
packInfo
.
versionName
);
}
}
// none use
public
void
goLogin
()
{
public
void
goLogin
()
{
LocalData
.
delAllData
();
LocalData
.
delAllData
();
startActivity
(
LoginActivity
.
class
);
SharedPreferences
sharedPreferences
=
getApplication
().
getSharedPreferences
(
"AppNamePreferences"
,
Context
.
MODE_PRIVATE
);
AppManager
.
getAppManager
().
finishAllActivityExThis
(
LoginActivity
.
class
);
// 获取SharedPreferences.Editor实例
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
// 清除username和password
editor
.
remove
(
"username"
);
editor
.
remove
(
"password"
);
editor
.
remove
(
"token"
);
// 提交更改
editor
.
apply
();
startActivity
(
LoginActivity
.
class
);
// 跳转到登录页面
AppManager
.
getAppManager
().
finishAllActivityExThis
(
LoginActivity
.
class
);
finish
();
// startActivity(LoginActivity.class);
}
}
public
BindingCommand
goPrivacyClause
=
new
BindingCommand
(
new
BindingAction
()
{
public
BindingCommand
goPrivacyClause
=
new
BindingCommand
(
new
BindingAction
()
{
...
@@ -158,12 +173,12 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
...
@@ -158,12 +173,12 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
LogoutDialog
dialog
=
new
LogoutDialog
(
view
.
getContext
(),
this
);
LogoutDialog
dialog
=
new
LogoutDialog
(
view
.
getContext
(),
this
);
dialog
.
setDialogClickListener
((
xxBaseDialog
.
onDialogClickListener
<
LogoutDialog
>)
(
code
,
data
)
->
{
dialog
.
setDialogClickListener
((
xxBaseDialog
.
onDialogClickListener
<
LogoutDialog
>)
(
code
,
data
)
->
{
Log
.
v
(
"走去除去除"
,
""
);
// 获取SharedPreferences实例
// 获取SharedPreferences实例
SharedPreferences
sharedPreferences
=
getApplication
().
getSharedPreferences
(
"AppNamePreferences"
,
Context
.
MODE_PRIVATE
);
SharedPreferences
sharedPreferences
=
getApplication
().
getSharedPreferences
(
"AppNamePreferences"
,
Context
.
MODE_PRIVATE
);
// 获取SharedPreferences.Editor实例
// 获取SharedPreferences.Editor实例
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
SharedPreferences
.
Editor
editor
=
sharedPreferences
.
edit
();
// 清除username和password
// 清除username和password
editor
.
remove
(
"username"
);
editor
.
remove
(
"username"
);
editor
.
remove
(
"password"
);
editor
.
remove
(
"password"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment