This commit is contained in:
陈鹏鹏 2023-09-27 17:31:21 +08:00
parent 913500e700
commit 74cf70ea39
6 changed files with 119 additions and 22 deletions

View File

@ -88,6 +88,12 @@ const routes = [
name: "field", name: "field",
meta: { title: "字段管理" }, meta: { title: "字段管理" },
}, },
{
path: "/web/xgmm",
component: () => import("@/views/form/changepassword.vue"),
name: "field",
meta: { title: "修改密码" },
},
], ],
}, },
{ {

View File

@ -39,6 +39,10 @@ axios.interceptors.response.use(
title: "请求错误", title: "请求错误",
message: "Status:500服务器发生错误", message: "Status:500服务器发生错误",
}); });
} else if (error.response.status == 600) {
router.replace({
path: '/web/xgmm'
});
} else { } else {
ElMessage.error(`Status:${error.response.status},未知错误!`); ElMessage.error(`Status:${error.response.status},未知错误!`);
} }

View File

@ -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>

View File

@ -34,6 +34,7 @@
<el-dropdown-item icon="Avatar">个人中心</el-dropdown-item> <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-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="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-item icon="SwitchButton" @click="handleUserMenu('logout')">退出</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@ -264,6 +265,9 @@ const handleUserMenu = (command) => {
}); });
} }
}; };
const modify = () =>{
router.push("/web/xgmm");
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="login_bg"> <div class="login_bg">
<div class="title"> <div class="title">
<img src="../../assets/images/login_07.png" alt="" /> <!-- <img src="../../assets/images/login_07.png" alt="" /> -->
</div> </div>
<div class="container"> <div class="container">
<div class="left_img"> <div class="left_img">
@ -43,16 +43,6 @@
/> />
</div> </div>
</el-form-item> </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-form-item prop="password">
<el-input <el-input
v-model="data.password" v-model="data.password"
@ -70,6 +60,21 @@
/> />
</div> </div>
</el-form-item> </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"> <!-- <div style="font-size: 0" class="rememb">
<el-checkbox v-model="remembIf" label="记住我" size="large" /> <el-checkbox v-model="remembIf" label="记住我" size="large" />
</div> --> </div> -->
@ -276,11 +281,16 @@ const slideVerifySuccess = () => {
name: resp.data.userInfo.userName, name: resp.data.userInfo.userName,
menus: resp.data.menuList, menus: resp.data.menuList,
permissions: resp.data.permissions, permissions: resp.data.permissions,
need_init_password:resp.data.need_init_password
}; };
tools.data.set("user", user); tools.data.set("user", user);
ElMessage.success("登录成功"); ElMessage.success("登录成功");
Router.push("/"); Router.push("/");
if (resp.data.need_init_password) {
Router.push("/web/xgmm");
}
} else { } else {
authCode();
ElMessage.error(resp.message); ElMessage.error(resp.message);
loading.value = false; loading.value = false;
} }
@ -706,4 +716,11 @@ const tabLogin = ref(true);
:deep(#rehtml-llq4lc0y .text-kbsp78ls) { :deep(#rehtml-llq4lc0y .text-kbsp78ls) {
display: none; display: none;
} }
.identifying{
display: flex;
img{
margin-left: 20px;
width: 130px;
}
}
</style> </style>

View File

@ -8,6 +8,7 @@ import Components from "unplugin-vue-components/vite";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: './',
plugins: [ plugins: [
vue(), vue(),
AutoImport({ AutoImport({
@ -18,6 +19,7 @@ export default defineConfig({
directoryAsNamespace: true directoryAsNamespace: true
}), }),
], ],
resolve: { resolve: {
extensions: ['.js', '.vue'], extensions: ['.js', '.vue'],
alias: { alias: {