普通用户申请成为管理员

This commit is contained in:
遥望-倪浩天 2024-10-14 17:04:00 +08:00
parent 17f0aca6ff
commit ed54d0d345
4 changed files with 29 additions and 8 deletions

View File

@ -20,3 +20,12 @@ export const auditAnApplication = (row) => request({
method: 'post', method: 'post',
data: row, data: row,
}); });
//修改用户信息
export const updateUserById = (row) => {
return request({
url: '/api/' + moduleName + '/ui/administrator/updateUserById',
method: 'post',
data: row
})
}

View File

@ -226,7 +226,7 @@ export const dynamicRoutes = [
name: 'applyForAdmin', name: 'applyForAdmin',
component: () => import('/@/views/systemManagement/applyForAdmin/index.vue'), component: () => import('/@/views/systemManagement/applyForAdmin/index.vue'),
meta: { meta: {
title: 'applyForAdmin', title: 'Administrator review',
isLink: '', isLink: '',
isHide: false, isHide: false,
isKeepAlive: true, isKeepAlive: true,

View File

@ -1,12 +1,12 @@
<template> <template>
<el-dialog title="" v-model="state.isShowDialog" width="60%" center> <el-dialog title="" v-model="state.isShowDialog" width="60%" center>
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<div class="my-header"> <!-- <div class="my-header">
<h4 class="titleClass1">Welcome to apply to become a website administrator</h4> <h4 class="titleClass1">Welcome to apply to become a website administrator</h4>
</div><br> </div><br>
<div class="my-header"> <div class="my-header">
<h4 class="titleClass2">Looking forward to your wisdom to the growth and development of the community</h4> <h4 class="titleClass2">Looking forward to your wisdom to the growth and development of the community</h4>
</div><br> </div><br>-->
<div class="my-header"> <div class="my-header">
<el-divider class="dividerStyle" content-position="center">Account Information</el-divider> <el-divider class="dividerStyle" content-position="center">Account Information</el-divider>
</div> </div>
@ -75,7 +75,7 @@
<script setup> <script setup>
import {onMounted, reactive, ref} from "vue"; import {onMounted, reactive, ref} from "vue";
const adminAddFormRef = ref(); const adminAddFormRef = ref();
import { auditAnApplication } from '/@/api/response/applyForAdmin.js'; import { auditAnApplication ,updateUserById} from '/@/api/response/applyForAdmin.js';
import {ElMessage} from "element-plus"; import {ElMessage} from "element-plus";
const emit = defineEmits(['callback']); const emit = defineEmits(['callback']);
const state = reactive({ const state = reactive({
@ -97,8 +97,21 @@ const Reject = () => {
const Pass = () => { const Pass = () => {
state.formData.applyForStatus=2 state.formData.applyForStatus=2
auditAnApplication(state.formData).then(res=>{ auditAnApplication(state.formData).then(res=>{
let submitformData = {
id: state.formData.userId,
realName: state.formData.realName,
country: state.formData.country,
organization: state.formData.organization,
occupation: state.formData.occupation,
education: state.formData.education,
researchField: state.formData.researchField,
introduction: state.formData.introduction
}
updateUserById(submitformData).then((res)=>{
})
ElMessage.success('Audit Completed'); ElMessage.success('Audit Completed');
}) })
closeDialog() closeDialog()
} }
// //
@ -108,7 +121,6 @@ const resetField = () => {
// //
const openDialog = (row) => { const openDialog = (row) => {
console.log(row)
state.formData=row state.formData=row
/*getUserById(row.id).then(res => { /*getUserById(row.id).then(res => {
state.formData = res state.formData = res

View File

@ -8,8 +8,8 @@
<el-select class="form-select" size="default" clearable placeholder="Apply For Status" <el-select class="form-select" size="default" clearable placeholder="Apply For Status"
v-model="state.search.applyForStatus"> v-model="state.search.applyForStatus">
<el-option value="0" label="Unreviewed">Unreviewed</el-option> <el-option value="0" label="Unreviewed">Unreviewed</el-option>
<el-option value="1" label="Declined">Declined</el-option> <el-option value="1" label="Refuse">Refuse</el-option>
<el-option value="2" label="Passed">Passed</el-option> <el-option value="2" label="Agree">Agree</el-option>
</el-select> </el-select>
<el-button size="default" type="primary" class="ml10" @click="getTableData"> <el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon> <el-icon>