密码超时修改等

20231126-yw
anthonywj 2 years ago
parent 9859b53f8a
commit b0eff74354

@ -5,7 +5,7 @@ VUE_APP_TITLE = UDI管理系统
ENV = 'development'
# 开发环境
VUE_APP_BASE_API = 'http://127.0.0.1:9991'
VUE_APP_BASE_API = 'http://192.168.0.166:9991'
VUE_APP_SYNC_API ="http://127.0.0.1:10001"

@ -8,7 +8,7 @@ ENV = 'production'
#林纪裕cd
VUE_APP_BASE_API = 'http://www.linjiyu.lol:81/UDI_WMS_MC/'
# VUE_APP_BASE_API = 'http://www.linjiyu.lol:81/UDI_WMS_MC/'
# VUE_APP_BASE_API = 'http://www.linjiyu.lol:83/UDI_WMS_MC/'
# VUE_APP_BASE_API = 'http://127.0.0.1:9150/UDI_WMS_MC/'
@ -37,7 +37,7 @@ VUE_APP_BASE_API = 'http://www.linjiyu.lol:81/UDI_WMS_MC/'
# VUE_APP_BASE_API = 'http://116.204.106.103:9150/UDI_WMS_MC/'
# 漳州中医院
# VUE_APP_BASE_API = 'http://192.168.240.119:9150/UDI_WMS_MC/'
VUE_APP_BASE_API = 'http://192.168.240.119:9150/UDI_WMS_MC/'
# 片仔癀诊断
# VUE_APP_BASE_API = 'http://192.168.0.100:9160/UDI_WMS_MC/'

@ -49,6 +49,7 @@
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"js-sha256": "^0.10.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"pinyin": "^2.10.2",

@ -1,5 +1,6 @@
import {login, logout, getInfo} from '@/api/login'
import {getToken, setToken, removeToken, removeAdminId, setAdminId} from '@/utils/auth'
import {sha256} from "js-sha256";
const user = {
state: {
@ -66,18 +67,18 @@ const user = {
// 登录
Login({commit}, userInfo) {
const username = userInfo.username.trim()
const password = userInfo.password
const password = sha256(userInfo.password)
const code = userInfo.code
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
if(res.code == 20000){
if (res.code == 20000) {
setToken(res.data.token)
setAdminId(res.data.id)
commit('SET_TOKEN', res.data.token)
commit('SET_ADMINID', res.data.id)
resolve()
}else{
resolve(res)
} else {
reject(res.message);
}
}).catch(error => {

@ -79,6 +79,29 @@
</el-card>
</el-form>
<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
style="
position: absolute;
@ -136,7 +159,13 @@ export default {
showDialog: false, // dialog
redirect: null, //
hospName: "",
title: "福建省XXX医院"
title: "福建省XXX医院",
passwordFormVisible: false,
passwordFormData: {
oldPassword: "",
newPassword: "",
check_new_password: "",
},
};
},
methods: {
@ -220,10 +249,34 @@ export default {
this.$store
.dispatch("Login", this.loginForm)
.then((res) => {
this.$router
.push({path: this.redirect || "/"})
.catch((res) => {
debugger
if (res.data.needChangePwd == true) {
this.$confirm('系统检测到您的密码长时间未修改,为保证您的账号安全建议立即修改密码?', '提示', {
confirmButtonText: '立即修改',
cancelButtonText: '忽略',
type: 'warning'
}).then(() => {
this.passwordFormVisible = true;
this.passwordFormData = {
oldPassword: "",
newPassword: "",
check_new_password: "",
};
}).catch(() => {
this.$router
.push({path: this.redirect || "/"})
.catch((res) => {
});
});
} else {
this.$router
.push({path: this.redirect || "/"})
.catch((res) => {
});
}
})
.catch((res) => {
this.loading = false;

Loading…
Cancel
Save