普通用户申请成为管理员

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',
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',
component: () => import('/@/views/systemManagement/applyForAdmin/index.vue'),
meta: {
title: 'applyForAdmin',
title: 'Administrator review',
isLink: '',
isHide: false,
isKeepAlive: true,

View File

@ -1,12 +1,12 @@
<template>
<el-dialog title="" v-model="state.isShowDialog" width="60%" center>
<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>
</div><br>
<div class="my-header">
<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">
<el-divider class="dividerStyle" content-position="center">Account Information</el-divider>
</div>
@ -75,7 +75,7 @@
<script setup>
import {onMounted, reactive, ref} from "vue";
const adminAddFormRef = ref();
import { auditAnApplication } from '/@/api/response/applyForAdmin.js';
import { auditAnApplication ,updateUserById} from '/@/api/response/applyForAdmin.js';
import {ElMessage} from "element-plus";
const emit = defineEmits(['callback']);
const state = reactive({
@ -97,8 +97,21 @@ const Reject = () => {
const Pass = () => {
state.formData.applyForStatus=2
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');
})
closeDialog()
}
//
@ -108,7 +121,6 @@ const resetField = () => {
//
const openDialog = (row) => {
console.log(row)
state.formData=row
/*getUserById(row.id).then(res => {
state.formData = res

View File

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