Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions client_code/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'
import index from '../views'
import home from '../views/pages/home.vue'
import login from '../views/pages/login.vue'
import findBack from '../views/pages/findBack.vue'
import newsList from '@/views/pages/news/list'
import messagesList from '@/views/pages/messages/list'
import syslogList from '@/views/pages/syslog/list'
Expand Down Expand Up @@ -235,6 +236,10 @@ const routes = [{
path: '/yonghuRegister',
component: yonghuRegister
}
,{
path: '/findBack',
component: findBack
}
]

const router = createRouter({
Expand Down
227 changes: 227 additions & 0 deletions client_code/src/views/pages/findBack.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
<template>
<div>
<div class="login_view">
<div class="outTitle_view">
<div class="outTilte">账号找回</div>
</div>
<el-form :model="findForm" class="login_form">
<div class="list_item">
<div class="list_label">
手机号:
</div>
<input class="list_inp" v-model="findForm.shouji" placeholder="请输入账号绑定的手机号" />
</div>
<div class="list_item">
<div class="list_label">
验证码:
</div>
<input class="list_inp" v-model="findForm.verifyCode" placeholder="请输入验证码" />
<el-button class="list_btn" @click="sendCode" :disabled="countdown > 0">{{ countdown > 0 ? countdown + 's后重新获取' : '获取验证码' }}</el-button>
</div>
<div class="btn_view">
<el-button class="login" type="success" @click="findBack">找回账号</el-button>
<el-button class="register" @click="goBack">返回登录</el-button>
</div>
</el-form>
</div>
</div>
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
const findForm = ref({
shouji: '',
verifyCode: ''
})
const countdown = ref(0)
const context = getCurrentInstance()?.appContext.config.globalProperties;

const sendCode = async () => {
if (!findForm.value.shouji) {
context?.$toolUtil.message('请输入手机号', 'error')
return;
}
try {
const res = await context?.$http.post('/yonghu/sendVerifyCode', { shouji: findForm.value.shouji })
if (res.data.code === 0) {
context?.$toolUtil.message('验证码已发送', 'success')
// 开始倒计时
countdown.value = 60
const timer = setInterval(() => {
countdown.value--
if (countdown.value <= 0) {
clearInterval(timer)
}
}, 1000)
} else {
context?.$toolUtil.message(res.data.msg || '发送失败', 'error')
}
} catch (error) {
context?.$toolUtil.message('发送失败', 'error')
}
}

const findBack = async () => {
if (!findForm.value.shouji) {
context?.$toolUtil.message('请输入手机号', 'error')
return;
}
if (!findForm.value.verifyCode) {
context?.$toolUtil.message('请输入验证码', 'error')
return;
}
try {
const res = await context?.$http.post('/yonghu/findBackAccount', {
shouji: findForm.value.shouji,
verifyCode: findForm.value.verifyCode
})
if (res.data.code === 0) {
context?.$toolUtil.message('账号找回成功,请登录', 'success')
context?.$router.push('/login')
} else {
context?.$toolUtil.message(res.data.msg || '找回失败', 'error')
}
} catch (error) {
context?.$toolUtil.message('找回失败', 'error')
}
}

const goBack = () => {
context?.$router.push('/login')
}
</script>

<style lang="scss" scoped>
.login_view {
background-image: url("http://clfile.zggen.cn/20250118/2e4ceeeee8254e16adf5ec27bff6ed95.jpg")!important;
// 标题盒子
.outTitle_view {
.outTilte {
}
}
// 表单盒子
.login_form {
}
// item盒子
.list_item {
// label
.list_label {
}
// 输入框
.list_inp {
}
// 按钮
.list_btn {
margin-left: 10px;
}
}
// 按钮盒子
.btn_view {
// 登录
.login {
}
// 注册
.register {
}
}
}

</style>
<style>

.login_view {
min-height: 100vh;
position: relative;
background: url(http://clfile.zggen.cn/20250118/2e4ceeeee8254e16adf5ec27bff6ed95.jpg) no-repeat center center / cover;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.login_view .login_form{
width: 600px;
margin: 20px 40% 40px 0;
padding: 30px 60px 30px 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
border-radius: 10px;
background: #fff;
border:10px solid #ddd;
}

.login_view .outTitle_view{
display: flex;
align-items: center;
padding: 0px 0px 10px;
margin: 0 40% 0 0;
}
.login_view .outTitle_view .outTilte{
color: #333;
font-size: 26px;
font-weight: 600;
}

.login_view .login_form .list_item{
display: flex;
align-items: center;
width: 100%;
justify-content: center;
margin: 0px 10px 20px 0px;
}
.login_view .login_form .list_item .list_label{
width: 120px;
text-align: right;
font-size: 16px;
}
.login_view .login_form .list_item .list_inp{
height: 36px;
line-height: 36px;
border:none;
border-bottom: 1px solid rgb(221, 221, 221);
padding: 0px 10px;
width: calc(100% - 220px);
font-size: 16px;
}
.login_view .login_form .list_item .list_btn{
width: 100px;
margin-left: 10px;
}

.login_view .login_form .btn_view{
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0px 0px 0px 120px;
width: 100%;
}
.login_view .login_form .btn_view .login{
margin: 0px 20px 12px 0px;
padding: 0px 10px;
width: auto;
height: 34px;
font-size: 16px;
color: rgb(255, 255, 255);
border-radius: 0px;
border: 0px;
background: var(--theme);
cursor: pointer;
min-width:80px;
}
.login_view .login_form .btn_view .register{
margin: 0px 20px 12px 0px;
padding: 0px;
width: auto;
height: 34px;
font-size: 16px;
color: #333;
border-radius: 4px;
border: 0px;
background: none;
cursor: pointer;
}
.login_view .login_form .btn_view .register:hover{
color: var(--theme);
}

</style>
9 changes: 7 additions & 2 deletions client_code/src/views/pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<div class="btn_view">
<el-button class="login" v-if="loginType==1" type="success" @click="handleLogin">登录</el-button>
<el-button class="register" type="primary" @click="handleRegister('yonghu')">注册用户</el-button>
<el-button class="forget" @click="goFindBack">找回账号</el-button>
</div>
</el-form>
</div>
Expand Down Expand Up @@ -63,8 +64,12 @@
const context = getCurrentInstance()?.appContext.config.globalProperties;
//注册
const handleRegister = (tableName) => {
context?.$router.push(`/${tableName}Register`)

context?.$router.push(`/${tableName}Register`)

}
//找回账号
const goFindBack = () => {
context?.$router.push('/findBack')
}
const handleLogin = () => {
if (!loginForm.value.username) {
Expand Down
25 changes: 25 additions & 0 deletions client_code/src/views/pages/yonghu/center.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<div class="formModel_btn_box">
<el-button class="formModel_confirm" @click="updateSession">更新信息</el-button>
<el-button class="formModel_cancel" @click="loginout" type="danger">退出登录</el-button>
<el-button class="formModel_cancel" @click="zhuxiaoClick" type="warning">用户注销</el-button>
</div>
</el-form>
</div>
Expand Down Expand Up @@ -366,6 +367,30 @@
context?.$toolUtil.storageClear()
router.replace('/index/home')
}
//用户注销
const zhuxiaoClick = () => {
ElMessageBox.confirm(
'确定要注销账号吗?注销后七天内可以通过手机号找回账号,七天后将自动删除账号。',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
context.$http.get(`yonghu/zhuxiao/${userForm.value.id}`).then(res => {
if (res.data && res.data.code == 0) {
context?.$toolUtil.message('注销成功', 'success')
context?.$toolUtil.storageClear()
router.replace('/index/home')
} else {
context?.$toolUtil.message(res.data.msg || '注销失败', 'error')
}
})
}).catch(() => {
// 用户点击取消
})
}
const recordList = ref([])
const chatVisible = ref(false)
const nowfid = ref(0)
Expand Down
32 changes: 22 additions & 10 deletions manage_code/src/views/yonghu/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,28 @@
</template>
</el-table-column>
<el-table-column min-width="140"
:resizable='true'
:sortable='true'
align="left"
header-align="left"
prop="shouji"
label="手机">
<template #default="scope">
{{scope.row.shouji}}
</template>
</el-table-column>
:resizable='true'
:sortable='true'
align="left"
header-align="left"
prop="shouji"
label="手机">
<template #default="scope">
{{scope.row.shouji}}
</template>
</el-table-column>
<el-table-column min-width="140"
:resizable='true'
:sortable='true'
align="left"
header-align="left"
prop="isZhuxiao"
label="状态">
<template #default="scope">
<el-tag v-if="scope.row.isZhuxiao === 1" type="danger">已注销</el-tag>
<el-tag v-else type="success">正常</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="300" :resizable='true' :sortable='true' align="left" header-align="left">
<template #default="scope">
<el-button class="view_btn" type="info" v-if=" btnAuth('yonghu','查看')" @click="infoClick(scope.row.id)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan(basePackages = {"com.cl.dao"})
@EnableScheduling
public class SpringbootSchemaApplication extends SpringBootServletInitializer{

public static void main(String[] args) {
Expand Down
Loading