Merge remote-tracking branch 'origin/busUser' into busUser

busUser
anthonywj 2 years ago
commit 2780e5dbb0

2
.gitignore vendored

@ -3,6 +3,8 @@ node_modules
/dist
/stage
package-lock.json
# local env files
.env.local
.env.*.local

@ -13,15 +13,16 @@
"axios": "^0.23.0",
"babel-polyfill": "^6.26.0",
"element-china-area-data": "^5.0.2",
"element-ui": "^2.15.7",
"element-ui": "^2.15.13",
"file-saver": "^2.0.5",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"mockjs": "^1.0.1-beta3",
"node-sass": "^6.0.1",
"nprogress": "^0.2.0",
"pinyin": "^2.10.2",
"qrcodejs2": "^0.0.2",
"vue": "2.5.16",
"vue": "2.6.12",
"vue-router": "^3.0.1",
"vue2-verify": "^1.1.5",
"vuedraggable": "^2.17.0",
@ -37,7 +38,7 @@
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"sass-loader": "^7.0.1",
"vue-template-compiler": "2.5.16"
"vue-template-compiler": "2.6.12"
},
"browserslist": [
"> 1%",

@ -12,7 +12,6 @@ export function userInfo(id, token) {
}
export function loginName(username, password) {
console.log(username + " " + password);
return axios({
url: "/login",
method: "post",

@ -19,6 +19,8 @@ import myReq2 from "./utils/axios2";
import {parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree} from "@/utils/ruoyi";
import {getUUID} from "@/utils/strUtil";
import md5 from 'js-md5';
Vue.prototype.$md5 = md5;
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm

@ -12,6 +12,7 @@ import {
// import { $NOT_NETWORK } from '../../utils/errorCode'
import {Message} from "element-ui";
import {RECEIVE_ADMIN_EMPLOY_NAME} from "../mutation-types";
import md5 from 'js-md5';
// initial state
const state = {
@ -48,7 +49,7 @@ const actions = {
// 用户名登录
loginName({commit}, userInfo) {
const userName = userInfo.userName ? userInfo.userName.trim() : "";
const pwd = userInfo.pwd ? userInfo.pwd : "";
const pwd = md5(userInfo.pwd);
return new Promise((resolve, reject) => {
loginName(userName, pwd)
.then(response => {

@ -91,15 +91,60 @@
<!-- 开发单位厦门高立新鹏软件科技有限公司 技术支持13459286066-->
<!-- </div>-->
<!--新增界面-->
<el-dialog title="修改密码" :visible.sync="passwordFormVisible" width="85%" top="5vh"
:close-on-click-modal="false"
:show-close="false"
:close-on-press-escape="false">
<el-form :model="passwordFormData" :rules="passwordFormDataRules" ref="passwordFormData">
<el-form-item label="原始密码" prop="old_password">
<el-input type="password" v-model="passwordFormData.oldPassword" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="新密码" prop="new_password">
<el-input type="password" v-model="passwordFormData.newPassword" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="check_new_password">
<el-input type="password" v-model="passwordFormData.check_new_password" auto-complete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click.native="passwordFormVisible = !passwordFormVisible">取消</el-button> -->
<el-button type="primary" @click.native="addSubmit('passwordFormData')" :loading="passwordLoading">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Verify from 'vue2-verify'
import axios from "axios";
import {password} from "../../api/auth/login";
import {getAdminId} from "../../utils/auth";
export default {
data() {
let validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
if (this.passwordFormData.check_new_password !== "") {
this.$refs.passwordFormData.validateField("check_new_password");
}
callback();
}
};
let validatePass2 = (rule, value, callback) => {
console.log(this.passwordFormData)
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.passwordFormData.newPassword) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
let validatePwd = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
@ -125,9 +170,78 @@ export default {
showDialog: false, // dialog
redirect: null, //
hospName: "",
passwordLoading: false,
passwordFormVisible: false,
passwordFormData: {
oldPassword: "",
newPassword: "",
check_new_password: "",
},
passwordFormDataRules: {
oldPassword: [
{
required: true,
message: "请输入原始密码",
trigger: "blur",
},
],
newPassword: [
{
required: true,
message: "请输入新密码",
trigger: "blur",
},
{validator: validatePass, trigger: "blur"},
],
check_new_password: [
{
required: true,
message: "请再次输入密码",
trigger: "blur",
},
{validator: validatePass2, trigger: "blur"},
],
},
};
},
methods: {
addSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.passwordLoading = true;
let data = Object.assign({}, this.passwordFormData);
data.adminId = getAdminId();
password(data)
.then((res) => {
this.passwordLoading = false;
if (res.code !== 20000) {
this.$message({
message: res.message,
type: "error",
});
} else {
this.$message({
message: "修改成功",
type: "success",
});
//
this.$refs["passwordFormData"].resetFields();
this.passwordFormVisible = false;
this.$store.dispatch("loginOut").then(() => {
location.reload(); // vue-router bug
});
}
})
.catch(() => {
// this.$message({
// type: "error",
// message: "",
// });
});
}
});
},
verifyAlert(text) {
if (text === 'success') {
this.ruleForm.verificationCode = true;
@ -156,16 +270,41 @@ export default {
this.$message.error(response.message);
return;
}
let path = "/";
if (this.redirect) {
path = this.redirect;
if(response.data.needChangePwd){
this.$confirm('系统检测到您的密码长时间未修改,为保证您的账号安全建议立即修改密码?', '提示', {
confirmButtonText: '立即修改',
cancelButtonText: '忽略',
type: 'warning'
}).then(() => {
this.passwordFormVisible = true;
this.passwordFormData = {
oldPassword: "",
newPassword: "",
check_new_password: "",
};
}).catch(() => {
let path = "/";
if (this.redirect) {
path = this.redirect;
}
console.log("path = " + path);
this.$router.push({
path: "../main",
});
});
}else {
let path = "/";
if (this.redirect) {
path = this.redirect;
}
console.log("path = " + path);
this.$router.push({
path: "../main",
});
// window.location.replace(path);
// this.showDialog = true
}
console.log("path = " + path);
this.$router.push({
path: "../main",
});
// window.location.replace(path);
// this.showDialog = true
})
.catch(() => {
this.ruleForm.verificationCode = false;
@ -213,7 +352,7 @@ $light_gray: #eee;
background-size: 100vw 100vh;
height: 100%;
input:-webkit-autofill {
.login-form input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px #293444 inset !important;
-webkit-text-fill-color: #fff !important;
}
@ -228,12 +367,12 @@ $light_gray: #eee;
}
}
input {
.login-form input {
background: transparent;
border: 0;
-webkit-appearance: none;
border-radius: 0;
padding: 0.46rem 0.0666rem 0.16rem 0.2rem;
padding: 0.46rem 0.0666rem 0.16rem 1.5rem;
color: $dark_gray;
height: 100%;
}
@ -287,7 +426,7 @@ $light_gray: #eee;
padding: 10em 10em 15em 10em;
}
.el-form-item {
.login-form .el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(0, 0, 0, 0.1);
border-radius: 0.0666rem;

@ -1,4 +1,5 @@
module.exports = {
lintOnSave:false,
baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
outputDir: process.env.outputDir,
configureWebpack: config => {
@ -22,5 +23,4 @@ module.exports = {
return args;
});
},
lintOnSave: false //不打印lint
};

Loading…
Cancel
Save