This commit is contained in:
parent
913500e700
commit
74cf70ea39
|
@ -88,6 +88,12 @@ const routes = [
|
|||
name: "field",
|
||||
meta: { title: "字段管理" },
|
||||
},
|
||||
{
|
||||
path: "/web/xgmm",
|
||||
component: () => import("@/views/form/changepassword.vue"),
|
||||
name: "field",
|
||||
meta: { title: "修改密码" },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -39,6 +39,10 @@ axios.interceptors.response.use(
|
|||
title: "请求错误",
|
||||
message: "Status:500,服务器发生错误!",
|
||||
});
|
||||
} else if (error.response.status == 600) {
|
||||
router.replace({
|
||||
path: '/web/xgmm'
|
||||
});
|
||||
} else {
|
||||
ElMessage.error(`Status:${error.response.status},未知错误!`);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="past">
|
||||
<el-text class="past_right">旧密码</el-text>
|
||||
<el-input
|
||||
v-model="state.formState.oldPassword"
|
||||
placeholder="请输入"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</div>
|
||||
<div class="past">
|
||||
<el-text class="past_right">新密码</el-text>
|
||||
<el-input
|
||||
v-model="state.formState.newPassword"
|
||||
placeholder="请输入"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</div>
|
||||
<div class="past">
|
||||
<el-text class="past_right">重新输入密码</el-text>
|
||||
<el-input
|
||||
v-model="state.formState.rePassword"
|
||||
placeholder="请输入"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</div>
|
||||
<el-button @click="onAffirm()">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
// import { message } from "ant-design-vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { encrypt } from "@/utils";
|
||||
import http from "@/utils/request";
|
||||
const state = reactive({
|
||||
formState: {
|
||||
oldPassword: "",
|
||||
newPassword: "",
|
||||
rePassword: "",
|
||||
},
|
||||
});
|
||||
const onAffirm = () => {
|
||||
let user = {
|
||||
oldPassword: encrypt(state.formState.oldPassword),
|
||||
newPassword: encrypt(state.formState.newPassword),
|
||||
rePassword: encrypt(state.formState.rePassword),
|
||||
};
|
||||
http.post(`/api/upms/admin/edit_password`,user).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.past {
|
||||
display: flex;
|
||||
margin-top: 20px;
|
||||
.past_right {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -34,6 +34,7 @@
|
|||
<el-dropdown-item icon="Avatar">个人中心</el-dropdown-item>
|
||||
<el-dropdown-item icon="Connection" v-if="isbind" @click="zzdSubmt('n')">浙政钉解绑</el-dropdown-item>
|
||||
<el-dropdown-item icon="Connection" v-else @click="zzdSubmt('y')">浙政钉绑定</el-dropdown-item>
|
||||
<el-dropdown-item icon="Grid" @click="modify()">修改密码</el-dropdown-item>
|
||||
<el-dropdown-item icon="SwitchButton" @click="handleUserMenu('logout')">退出</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
|
@ -264,6 +265,9 @@ const handleUserMenu = (command) => {
|
|||
});
|
||||
}
|
||||
};
|
||||
const modify = () =>{
|
||||
router.push("/web/xgmm");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="login_bg">
|
||||
<div class="title">
|
||||
<img src="../../assets/images/login_07.png" alt="" />
|
||||
<!-- <img src="../../assets/images/login_07.png" alt="" /> -->
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="left_img">
|
||||
|
@ -43,16 +43,6 @@
|
|||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captchaCode">
|
||||
<el-input
|
||||
v-model="data.captchaCode"
|
||||
style="width: 100%"
|
||||
type="text"
|
||||
placeholder="验证码"
|
||||
>
|
||||
</el-input>
|
||||
<img :src="codeImg" alt="加载错误" @click="authCode()" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="data.password"
|
||||
|
@ -70,6 +60,21 @@
|
|||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="captchaCode">
|
||||
<div class="identifying">
|
||||
<el-input
|
||||
v-model="data.captchaCode"
|
||||
style="width: 60%"
|
||||
type="text"
|
||||
placeholder="验证码输入"
|
||||
>
|
||||
|
||||
</el-input>
|
||||
<img :src="codeImg" alt="加载错误" @click="authCode()" />
|
||||
</div>
|
||||
|
||||
</el-form-item>
|
||||
<!-- <div style="font-size: 0" class="rememb">
|
||||
<el-checkbox v-model="remembIf" label="记住我" size="large" />
|
||||
</div> -->
|
||||
|
@ -276,11 +281,16 @@ const slideVerifySuccess = () => {
|
|||
name: resp.data.userInfo.userName,
|
||||
menus: resp.data.menuList,
|
||||
permissions: resp.data.permissions,
|
||||
need_init_password:resp.data.need_init_password
|
||||
};
|
||||
tools.data.set("user", user);
|
||||
ElMessage.success("登录成功");
|
||||
Router.push("/");
|
||||
if (resp.data.need_init_password) {
|
||||
Router.push("/web/xgmm");
|
||||
}
|
||||
} else {
|
||||
authCode();
|
||||
ElMessage.error(resp.message);
|
||||
loading.value = false;
|
||||
}
|
||||
|
@ -706,4 +716,11 @@ const tabLogin = ref(true);
|
|||
:deep(#rehtml-llq4lc0y .text-kbsp78ls) {
|
||||
display: none;
|
||||
}
|
||||
.identifying{
|
||||
display: flex;
|
||||
img{
|
||||
margin-left: 20px;
|
||||
width: 130px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -8,6 +8,7 @@ import Components from "unplugin-vue-components/vite";
|
|||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
|
@ -18,6 +19,7 @@ export default defineConfig({
|
|||
directoryAsNamespace: true
|
||||
}),
|
||||
],
|
||||
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue'],
|
||||
alias: {
|
||||
|
|
Loading…
Reference in New Issue