提交 ee04a849 authored 作者: lgd's avatar lgd

1.关于软件

2.//TODO erp用户激活,忘记密码测试,产品下单还差附件,bat,mes,消息,我的,刷新token
上级 410c0ed2
......@@ -560,7 +560,22 @@
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.user.UserModifyPwdActivity"
android:configChanges="keyboardHidden|orientation"
android:label="修改密码"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.user.UserAboutActivity"
android:configChanges="keyboardHidden|orientation"
android:label="关于软件"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/Work.Base"
android:windowSoftInputMode="adjustPan" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.wd.workoffice.fileprovider"
......
......@@ -66,6 +66,16 @@ public interface ApiService {
Observable<BaseBean> forgetPwd(@Query("phone") String phone,
@Query("verifyCode") String verifyCode, @Query("newPassword") String newPassword);
/**
* 根据旧密码重置密码
*
* @return
*/
@PUT("/sys/user/change-pwd")
Observable<BaseBean> modifyPwd(@Query("oldPassword") String oldPassword,
@Query("newPassword") String newPassword);
/**
* 激活员工前获取该员工信息
*
......
package com.wd.workoffice.ui.activity.user;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.UserInfoBean;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import com.wd.workoffice.ui.activity.login.LoginActivity;
import com.wd.workoffice.util.UserKeeper;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.AppUtil;
import io.reactivex.disposables.Disposable;
/**
* 我的 - 设置 -关于
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class UserAboutActivity extends WorkToolBarActivity {
@BindView(R.id.tv_version)
TextView tvVersion;
@Override
protected void initView() {
ButterKnife.bind(this);
tvVersion.setText("版本信息:"+ AppUtil.getAppVersionName());
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_about;
}
}
package com.wd.workoffice.ui.activity.user;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;
import com.wd.workoffice.R;
import com.wd.workoffice.app.BaseBean;
import com.wd.workoffice.app.Config;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.retrofit.RtfUtils;
import com.wd.workoffice.retrofit.WorkObserver;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import flexible.xd.android_base.network.rtfhttp.Transformer;
import flexible.xd.android_base.utils.RegexUtils;
import io.reactivex.disposables.Disposable;
/**
* 我的 - 设置 - 修改密码
* author : flexible
* email : lgd19940421@163.com
* github: https://github.com/FlexibleXd
**/
public class UserModifyPwdActivity extends WorkToolBarActivity {
@BindView(R.id.et_old_pwd)
EditText etOldPwd;
@BindView(R.id.et_pwd)
EditText etPwd;
@BindView(R.id.et_confirm_pwd)
EditText etConfirmPwd;
@BindView(R.id.btn_ok)
Button btnOk;
@Override
protected void initView() {
ButterKnife.bind(this);
}
@Override
protected void initData() {
}
@Override
protected void initEvent() {
}
@Override
protected int layoutId() {
return R.layout.activity_modify_pwd;
}
private void modify(String oldPwd, String newPwd) {
RtfUtils.getRtf().modifyPwd(oldPwd, newPwd).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseBean>() {
@Override
public void doOnSubscribe(Disposable d) {
}
@Override
public void onFail(String errorMsg) {
hideLoading();
toast(errorMsg);
}
@Override
public void onSuccess(BaseBean data) {
hideLoading();
if (data.getCode() != 0) {
toast(data.getMessage());
return;
}
toast("修改成功");
finish();
}
});
}
@OnClick(R.id.btn_ok)
public void onViewClicked() {
String oldPwd = etOldPwd.getText().toString();
String pwd = etPwd.getText().toString();
String confirmPwd = etConfirmPwd.getText().toString();
if (!RegexUtils.isMatch(Config.REGEX_PASSWORD, pwd)) {
toast("设置密码数字或字母6-16位");
return;
}
if (TextUtils.equals(pwd, "123456")) {
toast("密码不能为123456");
return;
}
if (!TextUtils.equals(pwd, confirmPwd)) {
toast("两次输入的密码不一致");
return;
}
modify(oldPwd, pwd);
}
}
......@@ -78,13 +78,11 @@ public class UserSettingActivity extends WorkToolBarActivity {
@OnClick({R.id.rl_account, R.id.rl_phone, R.id.rl_pwd, R.id.rl_about, R.id.btn_logout})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.rl_account:
break;
case R.id.rl_phone:
break;
case R.id.rl_pwd:
startActivity(UserModifyPwdActivity.class);
break;
case R.id.rl_about:
startActivity(UserAboutActivity.class);
break;
case R.id.btn_logout:
logout();
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:background="@color/white"
android:orientation="vertical">
<ImageView
android:layout_width="100mm"
android:layout_height="100mm"
android:layout_centerHorizontal="true"
android:layout_marginTop="50mm"
android:background="@mipmap/login_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_40"
android:gravity="center"
android:text="正望"
android:textColor="#d2b48c"
android:textSize="18sp" />
<TextView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5mm"
android:gravity="center"
android:text="版本信息:1.0.0"
android:textColor="#d2b48c"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="《软件服务协议》"
android:textColor="@color/red"
android:textSize="@dimen/sp_14" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10mm"
android:text="《隐私协议》"
android:textColor="@color/red"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8mm"
android:gravity="center"
android:text="青岛红柿子软件技术有限公司 版权所有"
android:textColor="@color/red"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="8mm"
android:gravity="center"
android:text="Copyright @ 2020 All Rights Reserve"
android:textColor="@color/red"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:paddingVertical="10mm"
android:layout_height="wrap_content"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="旧密码" />
<EditText
android:id="@+id/et_old_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@null"
android:hint="输入旧密码"
android:padding="4mm"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="10mm"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="新密码" />
<EditText
android:id="@+id/et_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@null"
android:hint="输入新密码"
android:padding="4mm"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="10mm"
android:paddingHorizontal="20mm">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确认新密码" />
<EditText
android:id="@+id/et_confirm_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10mm"
android:background="@null"
android:hint="确认信密码"
android:padding="4mm"
android:textSize="14sp" />
</LinearLayout>
<View style="@style/dividerX" />
<Button
android:id="@+id/btn_ok"
android:text="确认"
android:background="@color/input_background"
android:layout_width="match_parent"
android:layout_height="50mm"
android:layout_marginHorizontal="40mm"
android:layout_marginTop="20mm" />
</LinearLayout>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论