提交代码
parent
f0c9416033
commit
1c107346dc
|
@ -1,9 +1,11 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
|
import com.ruoyi.system.domain.vo.AlertUserPassVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
@ -19,6 +21,8 @@ import com.ruoyi.framework.web.service.SysLoginService;
|
||||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||||
import com.ruoyi.system.service.ISysMenuService;
|
import com.ruoyi.system.service.ISysMenuService;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package com.ruoyi.web.controller.system;
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.system.domain.vo.AlertUserPassVo;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
@ -248,4 +253,26 @@ public class SysUserController extends BaseController
|
||||||
{
|
{
|
||||||
return success(deptService.selectDeptTreeList(dept));
|
return success(deptService.selectDeptTreeList(dept));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送短信验证码修改密码
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/v1/sendPhoneMessage")
|
||||||
|
public AjaxResult sendPhoneMessage(@RequestBody Map<String,String> data){
|
||||||
|
return userService.sendPhoneMessage(data.get("phoneNumber"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户修改密码&【不需要token】
|
||||||
|
* @param alertUserPassVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping(value = "/v1/codeUpdatePwd")
|
||||||
|
public AjaxResult codeUpdatePwd(@RequestBody @Valid AlertUserPassVo alertUserPassVo){
|
||||||
|
return userService.updataUserPassWord(alertUserPassVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -570,6 +570,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult sendPhoneMessage(String phoneNumber){
|
public AjaxResult sendPhoneMessage(String phoneNumber){
|
||||||
|
if(StringUtils.isEmpty(phoneNumber)){
|
||||||
|
throw new ServiceException("手机号码不能为空!");
|
||||||
|
}
|
||||||
String key = "YANZHU.sendPhoneMessage."+phoneNumber;
|
String key = "YANZHU.sendPhoneMessage."+phoneNumber;
|
||||||
String obj = redisCache.getCacheObject(key);
|
String obj = redisCache.getCacheObject(key);
|
||||||
if(obj!=null){
|
if(obj!=null){
|
||||||
|
@ -577,7 +580,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
}
|
}
|
||||||
SysUser sysUser = userMapper.selectUserByUserName(phoneNumber);
|
SysUser sysUser = userMapper.selectUserByUserName(phoneNumber);
|
||||||
if(sysUser==null){
|
if(sysUser==null){
|
||||||
return AjaxResult.success(false);
|
throw new ServiceException("账号"+phoneNumber+"不存在,请重新输入!");
|
||||||
}
|
}
|
||||||
String yangZhengMa = RandomUtil.randomNumbers(6);
|
String yangZhengMa = RandomUtil.randomNumbers(6);
|
||||||
String content = "您正在修改密码,本次验证码为:" + yangZhengMa + ",有效期5分钟。请勿转发或泄漏,如果不是您的操作请忽略。";
|
String content = "您正在修改密码,本次验证码为:" + yangZhengMa + ",有效期5分钟。请勿转发或泄漏,如果不是您的操作请忽略。";
|
||||||
|
@ -609,7 +612,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
if(!SecurityUtils.matchesPassword(alertUserPassVo.getOldPass(),sysUser.getPassword())) {
|
if(!SecurityUtils.matchesPassword(alertUserPassVo.getOldPass(),sysUser.getPassword())) {
|
||||||
throw new ServiceException("旧密码错误,请重新输入!");
|
throw new ServiceException("旧密码错误,请重新输入!");
|
||||||
}
|
}
|
||||||
if(Objects.equals(alertUserPassVo.getPassword(),alertUserPassVo.getConfPass())){
|
if(!Objects.equals(alertUserPassVo.getPassword(),alertUserPassVo.getConfPass())){
|
||||||
throw new ServiceException("两次密码不一致,请重新输入!");
|
throw new ServiceException("两次密码不一致,请重新输入!");
|
||||||
}
|
}
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(alertUserPassVo.getPassword()));
|
sysUser.setPassword(SecurityUtils.encryptPassword(alertUserPassVo.getPassword()));
|
||||||
|
@ -623,7 +626,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
if(StringUtils.isEmpty(alertUserPassVo.getCode())){
|
if(StringUtils.isEmpty(alertUserPassVo.getCode())){
|
||||||
throw new ServiceException("验证码不能为空!");
|
throw new ServiceException("验证码不能为空!");
|
||||||
}
|
}
|
||||||
if(Objects.equals(alertUserPassVo.getPassword(),alertUserPassVo.getConfPass())){
|
if(!Objects.equals(alertUserPassVo.getPassword(),alertUserPassVo.getConfPass())){
|
||||||
throw new ServiceException("两次密码不一致,请重新输入!");
|
throw new ServiceException("两次密码不一致,请重新输入!");
|
||||||
}
|
}
|
||||||
String key = "YANZHU.sendPhoneMessage."+alertUserPassVo.getLoginName()+".VERIFY";
|
String key = "YANZHU.sendPhoneMessage."+alertUserPassVo.getLoginName()+".VERIFY";
|
||||||
|
|
|
@ -133,3 +133,21 @@ export function deptTreeSelect() {
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发送短信验证码
|
||||||
|
export function sendPhoneMessage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/v1/sendPhoneMessage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户修改密码
|
||||||
|
export function codeUpdatePwd(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/v1/codeUpdatePwd',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
|
@ -173,7 +173,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="投诉时间" align="center" prop="createTime">
|
<el-table-column label="投诉时间" align="center" prop="createTime">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.checkTime, "{y}-{m}-{d} {h}:{i}") }}</span>
|
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
|
@ -1,70 +1,153 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<div class="login-bg"></div>
|
<div class="login-bg"></div>
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
<div v-if="isLogin">
|
||||||
<h3 class="title">产发工程数字管理平台</h3>
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||||
<el-form-item prop="username">
|
<h3 class="title">产发工程数字管理平台</h3>
|
||||||
<el-input
|
<el-form-item prop="username">
|
||||||
v-model="loginForm.username"
|
<el-input
|
||||||
type="text"
|
v-model="loginForm.username"
|
||||||
auto-complete="off"
|
type="text"
|
||||||
placeholder="账号"
|
auto-complete="off"
|
||||||
>
|
placeholder="账号"
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
>
|
||||||
</el-input>
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
</el-form-item>
|
</el-input>
|
||||||
<el-form-item prop="password">
|
</el-form-item>
|
||||||
<el-input
|
<el-form-item prop="password">
|
||||||
v-model="loginForm.password"
|
<el-input
|
||||||
type="password"
|
v-model="loginForm.password"
|
||||||
auto-complete="off"
|
type="password"
|
||||||
placeholder="密码"
|
auto-complete="off"
|
||||||
@keyup.enter.native="handleLogin"
|
placeholder="密码"
|
||||||
>
|
@keyup.enter.native="handleLogin"
|
||||||
<svg-icon
|
>
|
||||||
slot="prefix"
|
<svg-icon
|
||||||
icon-class="password"
|
slot="prefix"
|
||||||
class="el-input__icon input-icon"
|
icon-class="password"
|
||||||
/>
|
class="el-input__icon input-icon"
|
||||||
</el-input>
|
/>
|
||||||
</el-form-item>
|
</el-input>
|
||||||
<el-form-item prop="code" v-if="captchaEnabled">
|
</el-form-item>
|
||||||
<el-input
|
<el-form-item prop="code" v-if="captchaEnabled">
|
||||||
v-model="loginForm.code"
|
<el-input
|
||||||
auto-complete="off"
|
v-model="loginForm.code"
|
||||||
placeholder="验证码"
|
auto-complete="off"
|
||||||
style="width: 68%"
|
placeholder="验证码"
|
||||||
@keyup.enter.native="handleLogin"
|
style="width: 68%"
|
||||||
>
|
@keyup.enter.native="handleLogin"
|
||||||
<svg-icon
|
>
|
||||||
slot="prefix"
|
<svg-icon
|
||||||
icon-class="validCode"
|
slot="prefix"
|
||||||
class="el-input__icon input-icon"
|
icon-class="validCode"
|
||||||
/>
|
class="el-input__icon input-icon"
|
||||||
</el-input>
|
/>
|
||||||
<div class="login-code">
|
</el-input>
|
||||||
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
<div class="login-code">
|
||||||
</div>
|
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px"
|
</el-form-item>
|
||||||
>记住密码</el-checkbox
|
<el-row>
|
||||||
>
|
<el-col :span="12">
|
||||||
<el-form-item style="width: 100%">
|
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px"
|
||||||
<el-button
|
>记住密码</el-checkbox
|
||||||
:loading="loading"
|
>
|
||||||
size="medium"
|
</el-col>
|
||||||
type="primary"
|
<el-col :span="12" style="text-align: right; font-size: 14px">
|
||||||
style="width: 100%"
|
<el-link type="primary" icon="el-icon-warning" @click="isLogin = false"
|
||||||
@click.native.prevent="handleLogin"
|
>忘记密码?立即修改</el-link
|
||||||
>
|
>
|
||||||
<span v-if="!loading">登 录</span>
|
</el-col>
|
||||||
<span v-else>登 录 中...</span>
|
</el-row>
|
||||||
</el-button>
|
<el-form-item style="width: 100%">
|
||||||
<div style="float: right" v-if="register">
|
<el-button
|
||||||
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
:loading="loading"
|
||||||
</div>
|
size="medium"
|
||||||
</el-form-item>
|
type="primary"
|
||||||
</el-form>
|
style="width: 100%"
|
||||||
|
@click.native.prevent="handleLogin"
|
||||||
|
>
|
||||||
|
<span v-if="!loading">登 录</span>
|
||||||
|
<span v-else>登 录 中...</span>
|
||||||
|
</el-button>
|
||||||
|
<div style="float: right" v-if="register">
|
||||||
|
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div v-if="!isLogin">
|
||||||
|
<el-form ref="passForm" :model="passForm" :rules="passRules" class="login-form">
|
||||||
|
<h3 class="title">产发工程数字管理平台</h3>
|
||||||
|
<el-form-item prop="loginName">
|
||||||
|
<el-input v-model="passForm.loginName" type="text" placeholder="手机账号">
|
||||||
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="pCode">
|
||||||
|
<el-input v-model="passForm.pCode" placeholder="验证码" style="width: 68%">
|
||||||
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="validCode"
|
||||||
|
class="el-input__icon input-icon"
|
||||||
|
/>
|
||||||
|
</el-input>
|
||||||
|
<div class="login-code">
|
||||||
|
<el-button
|
||||||
|
size="medium"
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%"
|
||||||
|
@click="sendPhoneMsg"
|
||||||
|
:disabled="disabled"
|
||||||
|
>
|
||||||
|
{{ buttonText }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="pw">
|
||||||
|
<el-input v-model="passForm.pw" type="password" placeholder="登录密码">
|
||||||
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="password"
|
||||||
|
class="el-input__icon input-icon"
|
||||||
|
/>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="cpw">
|
||||||
|
<el-input v-model="passForm.cpw" type="password" placeholder="确认密码">
|
||||||
|
<svg-icon
|
||||||
|
slot="prefix"
|
||||||
|
icon-class="password"
|
||||||
|
class="el-input__icon input-icon"
|
||||||
|
/>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="width: 100%">
|
||||||
|
<el-button
|
||||||
|
:loading="loading"
|
||||||
|
size="medium"
|
||||||
|
type="primary"
|
||||||
|
style="width: 100%"
|
||||||
|
@click="codeUpdatePwd"
|
||||||
|
>
|
||||||
|
<span v-if="!loading">修 改 密 码</span>
|
||||||
|
<span v-else>修 改 中...</span>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="width: 100%">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
:loading="loading"
|
||||||
|
size="medium"
|
||||||
|
type="info"
|
||||||
|
style="width: 100%"
|
||||||
|
@click="isLogin = true"
|
||||||
|
>
|
||||||
|
<span>返 回 登 录</span>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-login-footer">
|
<div class="el-login-footer">
|
||||||
<span>Copyright © 2023 西咸新区泾河新城产业发展集团 All Rights Reserved.</span>
|
<span>Copyright © 2023 西咸新区泾河新城产业发展集团 All Rights Reserved.</span>
|
||||||
|
@ -74,6 +157,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCodeImg } from "@/api/login";
|
import { getCodeImg } from "@/api/login";
|
||||||
|
import { codeUpdatePwd, sendPhoneMessage } from "@/api/system/user";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
||||||
|
|
||||||
|
@ -89,17 +173,35 @@ export default {
|
||||||
code: "",
|
code: "",
|
||||||
uuid: "",
|
uuid: "",
|
||||||
},
|
},
|
||||||
|
passForm: {
|
||||||
|
loginName: "",
|
||||||
|
pw: "",
|
||||||
|
cpw: "",
|
||||||
|
pCode: "",
|
||||||
|
source: "r",
|
||||||
|
},
|
||||||
loginRules: {
|
loginRules: {
|
||||||
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
|
username: [{ required: true, trigger: "change", message: "请输入您的账号" }],
|
||||||
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
password: [{ required: true, trigger: "change", message: "请输入您的密码" }],
|
||||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||||
},
|
},
|
||||||
|
passRules: {
|
||||||
|
loginName: [{ required: true, trigger: "change", message: "请输入您的账号" }],
|
||||||
|
pw: [{ required: true, trigger: "change", message: "请输入您的密码" }],
|
||||||
|
cpw: [{ required: true, trigger: "change", message: "请输入确认密码" }],
|
||||||
|
pCode: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||||
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
// 验证码开关
|
// 验证码开关
|
||||||
captchaEnabled: true,
|
captchaEnabled: true,
|
||||||
// 注册开关
|
// 注册开关
|
||||||
register: false,
|
register: false,
|
||||||
redirect: undefined,
|
redirect: undefined,
|
||||||
|
isLogin: true,
|
||||||
|
timer: null,
|
||||||
|
count: 30,
|
||||||
|
buttonText: "发送验证码",
|
||||||
|
disabled: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -134,9 +236,10 @@ export default {
|
||||||
password: password === undefined ? this.loginForm.password : decrypt(password),
|
password: password === undefined ? this.loginForm.password : decrypt(password),
|
||||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
|
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
|
||||||
};
|
};
|
||||||
|
this.passForm.loginName = "";
|
||||||
},
|
},
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.redirect=this.$route.query.redirect;
|
this.redirect = this.$route.query.redirect;
|
||||||
this.$refs.loginForm.validate((valid) => {
|
this.$refs.loginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -152,7 +255,7 @@ export default {
|
||||||
this.$store
|
this.$store
|
||||||
.dispatch("Login", this.loginForm)
|
.dispatch("Login", this.loginForm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
window.open( this.redirect || "#/index",'_self');
|
window.open(this.redirect || "#/index", "_self");
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -163,12 +266,67 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
resetCountdown() {
|
||||||
|
this.count = 30;
|
||||||
|
this.buttonText = "发送验证码";
|
||||||
|
this.disabled = false; // 恢复按钮可点击
|
||||||
|
},
|
||||||
|
startCountdown() {
|
||||||
|
this.disabled = true; // 禁用按钮
|
||||||
|
this.buttonText = `${this.count}秒后发送`;
|
||||||
|
this.timer = setInterval(() => {
|
||||||
|
this.count--;
|
||||||
|
this.buttonText = `${this.count}秒后发送`;
|
||||||
|
if (this.count <= 0) {
|
||||||
|
clearInterval(this.timer);
|
||||||
|
this.resetCountdown();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
//发送验证码
|
||||||
|
sendPhoneMsg() {
|
||||||
|
if (this.passForm.loginName) {
|
||||||
|
sendPhoneMessage({ phoneNumber: this.passForm.loginName }).then((res) => {
|
||||||
|
if (res.code == 200 && res.data) {
|
||||||
|
this.$modal.msgSuccess(`已发送验证码,请注意查收。5分钟内有效!`);
|
||||||
|
this.startCountdown();
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(`请稍后再试!`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError(`请输入正确的登录账号/手机号!`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
codeUpdatePwd() {
|
||||||
|
this.$refs.passForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if(this.passForm.pw!=this.passForm.cpw){
|
||||||
|
this.$modal.msgError(`两次输入的密码不一致,请重新输入!`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
this.passForm.password = this.passForm.pw;
|
||||||
|
this.passForm.confPass = this.passForm.cpw;
|
||||||
|
this.passForm.code = this.passForm.pCode;
|
||||||
|
codeUpdatePwd(this.passForm).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.$modal.msgSuccess(`密码修改成功!`);
|
||||||
|
this.loading = false;
|
||||||
|
this.isLogin = true;
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss">
|
<style rel="stylesheet/scss" lang="scss">
|
||||||
@media only screen and (min-width: 1600px){
|
@media only screen and (min-width: 1600px) {
|
||||||
.login-bg {
|
.login-bg {
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,26 +183,34 @@ public class WechatUserLoginController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送短信验证码修改密码
|
* 发送短信验证码修改密码
|
||||||
* @param phoneNumber
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/v1/sendPhoneMessage/{phoneNumber}")
|
@PostMapping("/v1/sendPhoneMessage")
|
||||||
public AjaxResult sendPhoneMessage(@PathVariable("phoneNumber") String phoneNumber){
|
public AjaxResult sendPhoneMessage(@RequestBody Map<String,String> data){
|
||||||
return sysUserService.sendPhoneMessage(phoneNumber);
|
return sysUserService.sendPhoneMessage(data.get("phoneNumber"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 修改密码
|
* 用户修改密码&需要token
|
||||||
* @Param: [map]
|
* @param alertUserPassVo
|
||||||
* @return: java.lang.Object
|
* @return
|
||||||
* @Author: wxw
|
|
||||||
* @Date: 2020/7/7 19:15
|
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/v1/updatePassword")
|
@PostMapping(value = "/v1/updatePassword")
|
||||||
public AjaxResult updatePassword(@RequestBody @Valid AlertUserPassVo alertUserPassVo){
|
public AjaxResult updatePassword(@RequestBody @Valid AlertUserPassVo alertUserPassVo){
|
||||||
return sysUserService.updataUserPassWord(alertUserPassVo);
|
return sysUserService.updataUserPassWord(alertUserPassVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户修改密码&【不需要token】
|
||||||
|
* @param alertUserPassVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/v1/codeUpdatePwd")
|
||||||
|
public AjaxResult codeUpdatePwd(@RequestBody @Valid AlertUserPassVo alertUserPassVo){
|
||||||
|
return sysUserService.updataUserPassWord(alertUserPassVo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退出登录
|
* 退出登录
|
||||||
* @param request
|
* @param request
|
||||||
|
|
Loading…
Reference in New Issue