Commit 7b2784d8 authored by 小费同学阿's avatar 小费同学阿 💬

基础搭建

功能开发
1:bug 修复 消费者端修复登录超时问题
parent 04e5f67a
......@@ -39,11 +39,6 @@
<activity
android:name=".ui.login.LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
......@@ -238,7 +233,14 @@
<!-- 注册首页页面-->
<activity
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
android:name=".ui.pwd.ForgetPwdActivity"
......
......@@ -6,6 +6,7 @@ import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
......@@ -70,10 +71,24 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
version.set("当前版本V" + packInfo.versionName);
}
// none use
public void goLogin() {
LocalData.delAllData();
startActivity(LoginActivity.class);
SharedPreferences sharedPreferences = getApplication().getSharedPreferences("AppNamePreferences", Context.MODE_PRIVATE);
// 获取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() {
......@@ -158,12 +173,12 @@ public class SettingsViewModel extends BaseViewModel<SettingsRequest> {
LogoutDialog dialog = new LogoutDialog(view.getContext(), this);
dialog.setDialogClickListener((xxBaseDialog.onDialogClickListener<LogoutDialog>) (code, data) -> {
Log.v("走去除去除","");
// 获取SharedPreferences实例
SharedPreferences sharedPreferences = getApplication().getSharedPreferences("AppNamePreferences", Context.MODE_PRIVATE);
// 获取SharedPreferences.Editor实例
SharedPreferences.Editor editor = sharedPreferences.edit();
// 清除username和password
editor.remove("username");
editor.remove("password");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment