提交 d05ab7e8 编写于 作者: 檀越@新空间's avatar 檀越@新空间 🐭

整理

上级 cdc9776b
.login-container[data-v-1be4e8ce]{background-color:#35495e;height:100%}.login-container .login-box[data-v-1be4e8ce]{width:400px;height:250px;background-color:#fff;border-radius:3px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 6px hsla(0,0%,100%,.5)}.login-container .login-box .form-login[data-v-1be4e8ce]{position:absolute;bottom:0;left:0;width:100%;box-sizing:border-box}.form-control[data-v-1be4e8ce]{flex:1}.avatar-box[data-v-1be4e8ce]{position:absolute;width:100%;top:-65px;left:0}.avatar-box .avatar[data-v-1be4e8ce]{width:120px;height:120px;border-radius:50%!important;box-shadow:0 0 6px #efefef}.layout-header-container[data-v-1eaf2085]{height:60px;border-bottom:1px solid #eaeaea}.layout-header-left-img[data-v-1eaf2085]{height:50px}.layout-aside-container[data-v-6479828c]{width:200px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-6479828c]{font-size:20px}.el-main{padding:20px 3px!important}.el-header[data-v-15b8f4b2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-15b8f4b2]{color:#333}.pagination[data-v-15b8f4b2]{margin-top:16px;text-align:right}.arrow-button[data-v-15b8f4b2]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-15b8f4b2]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-15b8f4b2]{pointer-events:none;opacity:.1}.el-header[data-v-6e64ea6a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-6e64ea6a]{color:#333}.pagination[data-v-6e64ea6a]{margin-top:16px;text-align:right}.header-button-item[data-v-6e64ea6a]{margin-right:15px;font-size:20px}.backtop[data-v-6e64ea6a]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.backtop[data-v-6e64ea6a]:hover{background-color:#0050a0}.el-header[data-v-390be27e]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-390be27e]{color:#333}.pagination[data-v-390be27e]{margin-top:16px;text-align:right}.header-button-item[data-v-390be27e]{margin-right:15px;font-size:20px}.red-title[data-v-390be27e]{line-height:24px;font-size:18px;color:red}.backtop[data-v-390be27e]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-390be27e]{width:100%;text-align:left}.backtop[data-v-390be27e]:hover{background-color:#0050a0}.el-header[data-v-d76d608e]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-d76d608e]{color:#333}.pagination[data-v-d76d608e]{margin-top:16px;text-align:right}.header-button-item[data-v-d76d608e]{margin-right:15px;font-size:20px}.red-title[data-v-d76d608e]{line-height:24px;font-size:18px;color:red}.backtop[data-v-d76d608e]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-d76d608e]{width:100%;text-align:left}.backtop[data-v-d76d608e]:hover{background-color:#0050a0}.el-header[data-v-23696584]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-23696584]{color:#333}.pagination[data-v-23696584]{margin-top:16px;text-align:right}.header-button-item[data-v-23696584]{margin-right:15px;font-size:20px}.red-title[data-v-23696584]{line-height:24px;font-size:18px;color:red}.backtop[data-v-23696584]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-23696584]{width:100%;text-align:left}.backtop[data-v-23696584]:hover{background-color:#0050a0}.button-container[data-v-9d5d30a4]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-ddc6c3e0]{display:flex;justify-content:center;align-items:center;height:30vh} .login-container[data-v-1be4e8ce]{background-color:#35495e;height:100%}.login-container .login-box[data-v-1be4e8ce]{width:400px;height:250px;background-color:#fff;border-radius:3px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-shadow:0 0 6px hsla(0,0%,100%,.5)}.login-container .login-box .form-login[data-v-1be4e8ce]{position:absolute;bottom:0;left:0;width:100%;box-sizing:border-box}.form-control[data-v-1be4e8ce]{flex:1}.avatar-box[data-v-1be4e8ce]{position:absolute;width:100%;top:-65px;left:0}.avatar-box .avatar[data-v-1be4e8ce]{width:120px;height:120px;border-radius:50%!important;box-shadow:0 0 6px #efefef}.layout-header-container[data-v-1eaf2085]{height:60px;border-bottom:1px solid #eaeaea}.layout-header-left-img[data-v-1eaf2085]{height:50px}.layout-aside-container[data-v-0d1aafb8]{width:200px;height:100%;border-right:1px solid #eaeaea}.left-aside-item[data-v-0d1aafb8]{font-size:20px}.el-main{padding:20px 3px!important}.el-header[data-v-15b8f4b2]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-15b8f4b2]{color:#333}.pagination[data-v-15b8f4b2]{margin-top:16px;text-align:right}.arrow-button[data-v-15b8f4b2]{display:flex;align-items:center;justify-content:center;border:none;background-color:transparent;cursor:pointer}.custom-icon[data-v-15b8f4b2]{font-size:24px;color:#f90;margin-right:6px}.arrow-button.disabled[data-v-15b8f4b2]{pointer-events:none;opacity:.1}.el-header[data-v-6e64ea6a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-6e64ea6a]{color:#333}.pagination[data-v-6e64ea6a]{margin-top:16px;text-align:right}.header-button-item[data-v-6e64ea6a]{margin-right:15px;font-size:20px}.backtop[data-v-6e64ea6a]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.backtop[data-v-6e64ea6a]:hover{background-color:#0050a0}.el-header[data-v-95571512]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-95571512]{color:#333}.pagination[data-v-95571512]{margin-top:16px;text-align:right}.header-button-item[data-v-95571512]{margin-right:15px;font-size:20px}.red-title[data-v-95571512]{line-height:24px;font-size:18px;color:red}.backtop[data-v-95571512]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-95571512]{width:100%;text-align:left}.backtop[data-v-95571512]:hover{background-color:#0050a0}.el-header[data-v-047b0f9a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-047b0f9a]{color:#333}.pagination[data-v-047b0f9a]{margin-top:16px;text-align:right}.header-button-item[data-v-047b0f9a]{margin-right:15px;font-size:20px}.red-title[data-v-047b0f9a]{line-height:24px;font-size:18px;color:red}.backtop[data-v-047b0f9a]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-047b0f9a]{width:100%;text-align:left}.backtop[data-v-047b0f9a]:hover{background-color:#0050a0}.el-header[data-v-b9c27f4a]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-b9c27f4a]{color:#333}.pagination[data-v-b9c27f4a]{margin-top:16px;text-align:right}.header-button-item[data-v-b9c27f4a]{margin-right:15px;font-size:20px}.red-title[data-v-b9c27f4a]{line-height:24px;font-size:18px;color:red}.backtop[data-v-b9c27f4a]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-b9c27f4a]{width:100%;text-align:left}.backtop[data-v-b9c27f4a]:hover{background-color:#0050a0}.el-header[data-v-2b7a0ba8]{background-color:#b3c0d1;color:#333;line-height:60px}.el-aside[data-v-2b7a0ba8]{color:#333}.pagination[data-v-2b7a0ba8]{margin-top:16px;text-align:right}.header-button-item[data-v-2b7a0ba8]{margin-right:15px;font-size:20px}.red-title[data-v-2b7a0ba8]{line-height:24px;font-size:18px;color:red}.backtop[data-v-2b7a0ba8]{position:fixed;bottom:50px;right:50px;height:40px;width:40px;line-height:40px;text-align:center;border-radius:20px;background-color:#007aff;color:#fff;cursor:pointer;z-index:999}.custom-textarea[data-v-2b7a0ba8]{width:100%;text-align:left}.backtop[data-v-2b7a0ba8]:hover{background-color:#0050a0}.button-container[data-v-9d5d30a4]{position:fixed;bottom:0;right:0;margin:16px}.container[data-v-ddc6c3e0]{display:flex;justify-content:center;align-items:center;height:30vh}
/*! /*!
* Bootstrap v4.5.0 (https://getbootstrap.com/) * Bootstrap v4.5.0 (https://getbootstrap.com/)
......
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/kwan.png"><title>kwan</title><link href="/css/app.73291ccc.css" rel="preload" as="style"><link href="/css/chunk-vendors.bedbfba9.css" rel="preload" as="style"><link href="/js/app.fb62f40e.js" rel="preload" as="script"><link href="/js/chunk-vendors.8385d186.js" rel="preload" as="script"><link href="/css/chunk-vendors.bedbfba9.css" rel="stylesheet"><link href="/css/app.73291ccc.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.8385d186.js"></script><script src="/js/app.fb62f40e.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/kwan.png"><title>kwan</title><link href="/css/app.50f7846e.css" rel="preload" as="style"><link href="/css/chunk-vendors.bedbfba9.css" rel="preload" as="style"><link href="/js/app.569e7a2e.js" rel="preload" as="script"><link href="/js/chunk-vendors.8385d186.js" rel="preload" as="script"><link href="/css/chunk-vendors.bedbfba9.css" rel="stylesheet"><link href="/css/app.50f7846e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but kwan doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.8385d186.js"></script><script src="/js/app.569e7a2e.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
...@@ -96,201 +96,201 @@ ...@@ -96,201 +96,201 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'MyInterview', name: 'MyInterview',
data() { data() {
return { return {
// 用户列表数据 // 用户列表数据
algorithmicList: [], algorithmicList: [],
randomAlgorithmic: { randomAlgorithmic: {
poetryText: '', poetryText: '',
}, },
loading: false, loading: false,
elementui_page_component_key: 0, elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('poetryLastPage')) || 1, currentPage: Number(localStorage.getItem('poetryLastPage')) || 1,
pageSize: 9, pageSize: 9,
total: 0, total: 0,
formInline: { formInline: {
poetryText: '', poetryText: '',
}, },
// 新增的内容 // 新增的内容
dialogFormVisible: false, dialogFormVisible: false,
randomFormVisible: false, randomFormVisible: false,
dialogMutiFormVisible: false, dialogMutiFormVisible: false,
form: { form: {
poetryText: '', poetryText: '',
}, },
formLabelWidth: '120px', formLabelWidth: '120px',
dialogVisible: false, dialogVisible: false,
editVisible: false, editVisible: false,
currentRowId: null, currentRowId: null,
} }
}, },
watch: { watch: {
'formInline.poetryText'(newVal) { 'formInline.poetryText'(newVal) {
if (newVal === '') { if (newVal === '') {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('poetryLastPage', this.currentPage) localStorage.setItem('poetryLastPage', this.currentPage)
this.interviewPage() this.interviewPage()
} }
}, },
// 监听currentPage的变化,将新值保存到localStorage中 // 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) { currentPage(newPage) {
localStorage.setItem('poetryLastPage', newPage.toString()) localStorage.setItem('poetryLastPage', newPage.toString())
}, },
}, },
created() { created() {
//获取问题类型的枚举 //获取问题类型的枚举
this.interviewPage() this.interviewPage()
}, },
mounted() { mounted() {
this.currentPage = 1 this.currentPage = 1
// // 在页面加载时从localStorage中获取currentPage的值 // // 在页面加载时从localStorage中获取currentPage的值
// const storedPage = localStorage.getItem('poetryLastPage') // const storedPage = localStorage.getItem('poetryLastPage')
// if (storedPage) { // if (storedPage) {
// this.currentPage = parseInt(storedPage) // this.currentPage = parseInt(storedPage)
// } // }
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
this.form.poetryText = '' this.form.poetryText = ''
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
prepareRandom() { prepareRandom() {
this.randomAlgorithmic = [] this.randomAlgorithmic = []
this.randomFormVisible = true this.randomFormVisible = true
this.interviewRandom() this.interviewRandom()
}, },
prepareMutiAdd() { prepareMutiAdd() {
this.form.poetryText = '' this.form.poetryText = ''
this.dialogMutiFormVisible = true this.dialogMutiFormVisible = true
}, },
prepareDelete(id) { prepareDelete(id) {
this.currentRowId = id this.currentRowId = id
this.dialogVisible = true this.dialogVisible = true
}, },
preEdit(id, poetryText) { preEdit(id, poetryText) {
this.form.poetryText = poetryText this.form.poetryText = poetryText
this.currentRowId = id this.currentRowId = id
this.editVisible = true this.editVisible = true
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
.then((_) => { .then((_) => {
done() done()
}) })
.catch((_) => {}) .catch((_) => {})
}, },
handleConfirm(addType) { handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框 this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false this.dialogMutiFormVisible = false
this.addQuestion(addType) // 发送请求 this.addQuestion(addType) // 发送请求
}, },
async addQuestion(addType) { async addQuestion(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/add', { const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/add', {
addType: addType, addType: addType,
poetryText: this.form.poetryText, poetryText: this.form.poetryText,
degreeOfImportance: this.form.degreeOfImportance, degreeOfImportance: this.form.degreeOfImportance,
degreeOfDifficulty: this.form.degreeOfDifficulty, degreeOfDifficulty: this.form.degreeOfDifficulty,
difficultyOfScore: this.form.difficultyOfScore, difficultyOfScore: this.form.difficultyOfScore,
leetcodeNumber: this.form.leetcodeNumber, leetcodeNumber: this.form.leetcodeNumber,
leetcodeLink: this.form.leetcodeLink, leetcodeLink: this.form.leetcodeLink,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.poetryText = '' this.form.poetryText = ''
this.currentPage=1 this.currentPage = 1
this.interviewPage() this.interviewPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
this.errorMsg(res.message) this.errorMsg(res.message)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the poetryText:', error) console.error('An error occurred while adding the poetryText:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
errorMsg(msg) { errorMsg(msg) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: msg, message: msg,
type: 'error', type: 'error',
}) })
}, },
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/update', { const { data: res } = await axios.post('http://120.79.36.53:8888/aphorismPoetry/update', {
id: this.currentRowId, id: this.currentRowId,
poetryText: this.form.poetryText, poetryText: this.form.poetryText,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.poetryText = '' this.form.poetryText = ''
this.editVisible = false this.editVisible = false
currentRowId: null currentRowId: null
this.interviewPage() this.interviewPage()
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the poetryText:', error) console.error('An error occurred while adding the poetryText:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/delete', { const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/delete', {
params: { params: {
id: id, id: id,
}, },
}) })
this.interviewPage() this.interviewPage()
this.loading = false this.loading = false
}, },
refreshPage() { refreshPage() {
//获取问题类型的枚举 //获取问题类型的枚举
this.interviewPage() this.interviewPage()
location.reload() location.reload()
}, },
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/page', { const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
poetryText: this.formInline.poetryText, poetryText: this.formInline.poetryText,
}, },
}) })
if (res.code === 200) { if (res.code === 200) {
this.total = res.result.totalElements this.total = res.result.totalElements
this.algorithmicList = res.result.content this.algorithmicList = res.result.content
} }
this.loading = false this.loading = false
}, },
async interviewRandom() { async interviewRandom() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/random', { params: {} }) const { data: res } = await axios.get('http://120.79.36.53:8888/aphorismPoetry/random', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.randomAlgorithmic.poetryText = res.result.poetryText this.randomAlgorithmic.poetryText = res.result.poetryText
} }
this.loading = false this.loading = false
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.interviewPage() this.interviewPage()
}, },
}, },
} }
</script> </script>
......
<template>
<div>
<el-container>
<el-main>
<el-dialog title="新增用户" :visible.sync="dialogFormVisible" style="width: 100%">
<el-form :model="form" class="custom-form">
<el-form-item label="用户名称" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.userName" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="用户昵称" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.nickName" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="用户权重" :label-width="formLabelWidth" class="form-item">
<el-select v-model="form.userWeight" placeholder="请选择">
<el-option v-for="item in allOptions" :key="item.type" :label="item.name" :value="item.type"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(0)">确 定</el-button>
</div>
</el-dialog>
<el-dialog class="red-title" :visible.sync="dialogMutiFormVisible">
<div class="red-title" slot="title">批量新增用户(多个用户换行填写)</div>
<el-form :model="form" class="custom-form">
<el-form-item label="用户名称" :label-width="formLabelWidth" class="form-item">
<el-input type="textarea" v-model="form.userName" autocomplete="off" :rows="5" :cols="30" style="width: 100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogMutiFormVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm(1)">确 定</el-button>
</div>
</el-dialog>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item>
<el-input clearable v-model="formInline.userName" placeholder="请输入用户名" @keydown.enter.native="userPage"></el-input>
</el-form-item>
<el-form-item>
<el-input clearable v-model="formInline.nickName" placeholder="请输入用户昵称" @keydown.enter.native="userPage"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userPage">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="prepareAdd">新增</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="prepareMutiAdd">批量新增</el-button>
</el-form-item>
</el-form>
<el-table border :data="csdnUserList" v-loading="loading">
<el-table-column prop="userName" label="用户名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="nickName" label="用户昵称" show-overflow-tooltip></el-table-column>
<el-table-column prop="likeStatusName" label="点赞状态" show-overflow-tooltip></el-table-column>
<el-table-column prop="collectStatusName" label="收藏状态" show-overflow-tooltip></el-table-column>
<el-table-column prop="commentStatusName" label="评论状态" show-overflow-tooltip></el-table-column>
<el-table-column prop="userWeightName" label="用户权重" show-overflow-tooltip></el-table-column>
<el-table-column prop="articleType" label="文章类型" show-overflow-tooltip :width="100"></el-table-column>
<el-table-column label="创建时间" width="170">
<template slot-scope="props">
{{ props.row.createTime | dateFormat }}
</template>
</el-table-column>
<el-table-column label="更新时间" width="170">
<template slot-scope="props">
{{ props.row.updateTime | dateFormat }}
</template>
</el-table-column>
<el-table-column prop="操作" label="操作" width="180">
<template slot-scope="props">
<el-button type="success" @click.prevent="preEdit(props.row.id, props.row.userName, props.row.nickName, props.row.userWeight)" width="200">编辑</el-button>
<el-dialog title="编辑用户信息" :visible.sync="editVisible">
<el-form :model="form">
<el-form-item label="用户名称" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.userName" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="用户昵称" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.nickName" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
<el-form-item label="用户权重" :label-width="formLabelWidth" class="form-item">
<el-input v-model="form.userWeight" autocomplete="off" style="width: 100%"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="editVisible = false">取 消</el-button>
<el-button type="primary" @click="editConfirm">确 定</el-button>
</div>
</el-dialog>
<el-button type="danger" @click="prepareDelete(props.row.id)">删除</el-button>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<span>确认删除?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click.prevent="onDelete(currentRowId)">确 定</el-button>
</span>
</el-dialog>
</template>
</el-table-column>
</el-table>
<el-pagination class="pagination" background :key="elementui_page_component_key" :current-page.sync="currentPage" :page-size="pageSize" :total="total" @current-change="handleCurrentChange"></el-pagination>
</el-main>
<el-backtop class="backtop"></el-backtop>
</el-container>
</div>
</template>
<script>
import axios from 'axios'
export default {
name: 'MyCsdnUser',
data() {
return {
form: {
userName: '',
nickName: '',
userWeight: 0,
},
formInline: {
userName: '',
nickName: '',
},
allOptions: [
{
type: 9,
name: '铁子',
},
{ type: 8, name: '闺蜜' },
{ type: 7, name: '基友' },
{ type: 0, name: '默认' },
],
likeStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经点过赞' },
{ type: 2, name: '点赞已满' },
{ type: 3, name: '取消点赞' },
{ type: 9, name: '点赞成功' },
],
collectStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经收藏过' },
{ type: 2, name: '收藏已满' },
{ type: 3, name: '参数缺失' },
{ type: 9, name: '收藏成功' },
],
commentStatus: [
{
type: 0,
name: '未处理',
},
{ type: 1, name: '已经评论过' },
{ type: 2, name: '评论已满' },
{ type: 3, name: '禁言' },
{ type: 4, name: '评论太快' },
{ type: 5, name: '评论已经到了49条' },
{ type: 8, name: '其他错误' },
{ type: 9, name: '收藏成功' },
],
dialogFormVisible: false,
dialogMutiFormVisible: false,
dialogVisible: false,
editVisible: false,
// 用户列表数据
csdnUserList: [],
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('csdnUserPage')) || 1,
pageSize: 9,
total: 0,
// 新增的内容
formLabelWidth: '120px',
currentRowId: null,
}
},
watch: {
'formInline.userName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
'formInline.nickName'(newVal) {
if (newVal === '') {
this.currentPage = 1
localStorage.setItem('csdnUserPage', this.currentPage)
this.userPage()
}
},
// 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) {
localStorage.setItem('csdnUserPage', newPage.toString())
},
},
created() {
//获取问题类型的枚举
this.userPage()
},
mounted() {
this.currentPage = 1
},
methods: {
prepareAdd() {
this.form.userName = ''
this.form.nickName = ''
this.dialogFormVisible = true
},
prepareMutiAdd() {
this.form.userName = ''
this.dialogMutiFormVisible = true
},
prepareDelete(id) {
this.currentRowId = id
this.dialogVisible = true
},
preEdit(id, userName, nickName, userWeight) {
this.form.userName = userName
this.form.nickName = nickName
this.form.userWeight = userWeight
this.currentRowId = id
this.editVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then((_) => {
done()
})
.catch((_) => {})
},
handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false
this.addUser(addType) // 发送请求
},
async addUser(addType) {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/add', {
addType: addType,
userName: this.form.userName,
nickName: this.form.nickName,
userWeight: this.form.userWeight,
})
if (res.code === 200) {
this.currentPage = 1
this.form.userName = ''
this.form.nickName = ''
this.form.userWeight = 0
this.userPage()
} else {
console.error('Received non-200 status code', res)
this.errorMsg(res.message)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
errorMsg(msg) {
this.$message({
showClose: true,
message: msg,
type: 'error',
})
},
async editConfirm() {
try {
this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/csdn/user/update', {
id: this.currentRowId,
userName: this.form.userName,
nickName: this.form.nickName,
userWeight: this.form.userWeight,
})
if (res.code === 200) {
this.form.userName = ''
this.form.nickName = ''
this.form.userWeight = 0
this.editVisible = false
currentRowId: null
this.userPage()
} else {
console.error('Received non-200 status code', res)
}
} catch (error) {
console.error('An error occurred while adding the questionName:', error)
// 异常处理逻辑
} finally {
this.loading = false
}
},
async onDelete(id) {
this.dialogVisible = false
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/csdn/user/delete', {
params: {
id: id,
},
})
this.userPage()
this.loading = false
},
refreshPage() {
//获取问题类型的枚举
this.userPage()
location.reload()
},
async userPage() {
this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/csdn/user/page', {
params: {
page: this.currentPage,
pageSize: this.pageSize,
userName: this.formInline.userName,
nickName: this.formInline.nickName,
},
})
if (res.code === 200) {
this.total = res.result.totalElements
const userWeightMap = {}
this.allOptions.forEach((option) => {
userWeightMap[option.type] = option.name
})
res.result.content.forEach((item) => {
item.userWeightName = userWeightMap[item.userWeight]
})
const likeStatusMap = {}
this.likeStatus.forEach((option) => {
likeStatusMap[option.type] = option.name
})
res.result.content.forEach((item) => {
item.likeStatusName = likeStatusMap[item.likeStatus]
})
const collectStatusMap = {}
this.collectStatus.forEach((option) => {
collectStatusMap[option.type] = option.name
})
res.result.content.forEach((item) => {
item.collectStatusName = collectStatusMap[item.collectStatus]
})
const commentStatusMap = {}
this.commentStatus.forEach((option) => {
commentStatusMap[option.type] = option.name
})
res.result.content.forEach((item) => {
item.commentStatusName = commentStatusMap[item.commentStatus]
})
this.csdnUserList = res.result.content
}
this.loading = false
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage
this.userPage()
},
},
}
</script>
<style lang="less" scoped>
.el-header {
background-color: #b3c0d1;
color: #333;
line-height: 60px;
}
.el-aside {
color: #333;
}
.pagination {
margin-top: 16px;
text-align: right;
}
.header-button-item {
margin-right: 15px;
font-size: 20px;
}
.red-title {
line-height: 24px;
font-size: 18px;
color: red;
}
.backtop {
position: fixed;
bottom: 50px;
right: 50px;
height: 40px;
width: 40px;
line-height: 40px;
text-align: center;
border-radius: 20px;
background-color: #007aff;
color: #fff;
cursor: pointer;
z-index: 999;
}
.custom-textarea {
width: 100%;
text-align: left;
}
.backtop:hover {
background-color: #0050a0;
}
</style>
\ No newline at end of file
...@@ -105,332 +105,332 @@ ...@@ -105,332 +105,332 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'MyInterview', name: 'MyInterview',
data() { data() {
return { return {
// 用户列表数据 // 用户列表数据
userlist: [], userlist: [],
loading: false, loading: false,
elementui_page_component_key: 0, elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem('interviewLastPage')) || 1, currentPage: Number(localStorage.getItem('interviewLastPage')) || 1,
pageSize: 9, pageSize: 9,
total: 0, total: 0,
formInline: { formInline: {
question: '', question: '',
}, },
options: [], options: [],
questionType: 0, questionType: 0,
// 新增的内容 // 新增的内容
dialogFormVisible: false, dialogFormVisible: false,
dialogMutiFormVisible: false, dialogMutiFormVisible: false,
form: { form: {
question: '', question: '',
questionType: 0, questionType: 0,
}, },
formLabelWidth: '120px', formLabelWidth: '120px',
dialogVisible: false, dialogVisible: false,
editVisible: false, editVisible: false,
currentRowId: null, currentRowId: null,
colorMap: {}, // 创建一个空的颜色映射关系对象 colorMap: {}, // 创建一个空的颜色映射关系对象
} }
}, },
watch: { watch: {
'formInline.question'(newVal) { 'formInline.question'(newVal) {
if (newVal === '') { if (newVal === '') {
this.currentPage = 1 this.currentPage = 1
localStorage.setItem('interviewLastPage', this.currentPage) localStorage.setItem('interviewLastPage', this.currentPage)
this.getQuestionType() this.getQuestionType()
} }
}, },
// 监听currentPage的变化,将新值保存到localStorage中 // 监听currentPage的变化,将新值保存到localStorage中
currentPage(newPage) { currentPage(newPage) {
localStorage.setItem('interviewLastPage', newPage.toString()) localStorage.setItem('interviewLastPage', newPage.toString())
}, },
}, },
created() { created() {
//获取问题列表 //获取问题列表
this.getQuestionType() this.getQuestionType()
}, },
mounted() { mounted() {
this.currentPage = 1 this.currentPage = 1
// // 在页面加载时从localStorage中获取currentPage的值 // // 在页面加载时从localStorage中获取currentPage的值
// const storedPage = localStorage.getItem('interviewLastPage') // const storedPage = localStorage.getItem('interviewLastPage')
// if (storedPage) { // if (storedPage) {
// this.currentPage = parseInt(storedPage) // this.currentPage = parseInt(storedPage)
// } // }
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
this.form.question = '' this.form.question = ''
this.form.questionType = 0 this.form.questionType = 0
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
prepareMutiAdd() { prepareMutiAdd() {
this.form.question = '' this.form.question = ''
this.form.questionType = 0 this.form.questionType = 0
this.dialogMutiFormVisible = true this.dialogMutiFormVisible = true
}, },
prepareDelete(id) { prepareDelete(id) {
this.currentRowId = id this.currentRowId = id
this.dialogVisible = true this.dialogVisible = true
}, },
preEdit(id, question, questionTypeName) { preEdit(id, question, questionTypeName) {
this.form.question = question this.form.question = question
// 定义一个映射(map)来存储 questionType 到 name 的转换 // 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {} const questionTypeToNameMap = {}
this.options.forEach((option) => { this.options.forEach((option) => {
questionTypeToNameMap[option.name] = option.questionType questionTypeToNameMap[option.name] = option.questionType
}) })
this.form.questionType = questionTypeToNameMap[questionTypeName] this.form.questionType = questionTypeToNameMap[questionTypeName]
this.currentRowId = id this.currentRowId = id
this.editVisible = true this.editVisible = true
}, },
handleClose(done) { handleClose(done) {
this.$confirm('确认关闭?') this.$confirm('确认关闭?')
.then((_) => { .then((_) => {
done() done()
}) })
.catch((_) => {}) .catch((_) => {})
}, },
handleConfirm(addType) { handleConfirm(addType) {
this.dialogFormVisible = false // 关闭对话框 this.dialogFormVisible = false // 关闭对话框
this.dialogMutiFormVisible = false this.dialogMutiFormVisible = false
this.addQuestion(addType) // 发送请求 this.addQuestion(addType) // 发送请求
}, },
async addQuestion(addType) { async addQuestion(addType) {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/add', { const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/add', {
addType: addType, addType: addType,
question: this.form.question, question: this.form.question,
questionType: this.form.questionType, questionType: this.form.questionType,
}) })
if (res.code === 200) { if (res.code === 200) {
this.currentPage = 1 this.currentPage = 1
this.form.question = '' this.form.question = ''
this.form.questionType = 0 this.form.questionType = 0
this.getQuestionType() // 确保这个方法是有效的 this.getQuestionType() // 确保这个方法是有效的
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
this.errorMsg(res.message) this.errorMsg(res.message)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the question:', error) console.error('An error occurred while adding the question:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
errorMsg(msg) { errorMsg(msg) {
this.$message({ this.$message({
showClose: true, showClose: true,
message: msg, message: msg,
type: 'error', type: 'error',
}) })
}, },
async editConfirm() { async editConfirm() {
try { try {
this.loading = true this.loading = true
const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/update', { const { data: res } = await axios.post('http://120.79.36.53:8888/interviewQuestion/update', {
id: this.currentRowId, id: this.currentRowId,
question: this.form.question, question: this.form.question,
questionType: this.form.questionType, questionType: this.form.questionType,
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.question = '' this.form.question = ''
this.form.questionType = 0 this.form.questionType = 0
this.editVisible = false this.editVisible = false
currentRowId: null currentRowId: null
this.getQuestionType() // 确保这个方法是有效的 this.getQuestionType() // 确保这个方法是有效的
} else { } else {
console.error('Received non-200 status code', res) console.error('Received non-200 status code', res)
} }
} catch (error) { } catch (error) {
console.error('An error occurred while adding the question:', error) console.error('An error occurred while adding the question:', error)
// 异常处理逻辑 // 异常处理逻辑
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
async onDelete(id) { async onDelete(id) {
this.dialogVisible = false this.dialogVisible = false
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/delete', { const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/delete', {
params: { params: {
id: id, id: id,
}, },
}) })
this.getQuestionType() this.getQuestionType()
this.loading = false this.loading = false
}, },
refreshPage() { refreshPage() {
//获取问题类型的枚举 //获取问题类型的枚举
this.getQuestionType() this.getQuestionType()
location.reload() location.reload()
}, },
async getQuestionType() { async getQuestionType() {
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/questionType', { params: {} }) const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/questionType', { params: {} })
if (res.code === 200) { if (res.code === 200) {
this.options = res.result this.options = res.result
this.interviewPage() this.interviewPage()
} }
}, },
async interviewPage() { async interviewPage() {
this.loading = true this.loading = true
const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/page', { const { data: res } = await axios.get('http://120.79.36.53:8888/interviewQuestion/page', {
params: { params: {
page: this.currentPage, page: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
question: this.formInline.question, question: this.formInline.question,
questionType: this.questionType, questionType: this.questionType,
}, },
}) })
if (res.code === 200) { if (res.code === 200) {
this.total = res.result.totalElements this.total = res.result.totalElements
// 定义一个映射(map)来存储 questionType 到 name 的转换 // 定义一个映射(map)来存储 questionType 到 name 的转换
const questionTypeToNameMap = {} const questionTypeToNameMap = {}
this.options.forEach((option) => { this.options.forEach((option) => {
questionTypeToNameMap[option.questionType] = option.name questionTypeToNameMap[option.questionType] = option.name
}) })
// 修改 userlist 中的每一个元素,将 questionType 转换为 name // 修改 userlist 中的每一个元素,将 questionType 转换为 name
res.result.content.forEach((user) => { res.result.content.forEach((user) => {
user.questionTypeName = questionTypeToNameMap[user.questionType] || 'Unknown' user.questionTypeName = questionTypeToNameMap[user.questionType] || 'Unknown'
}) })
this.userlist = res.result.content this.userlist = res.result.content
} }
this.loading = false this.loading = false
}, },
handleCurrentChange(currentPage) { handleCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.getQuestionType() this.getQuestionType()
}, },
getColorForValue(value) { getColorForValue(value) {
// 检查颜色映射关系中是否已经有该值对应的颜色 // 检查颜色映射关系中是否已经有该值对应的颜色
if (!this.colorMap[value]) { if (!this.colorMap[value]) {
// 如果没有,随机生成一个颜色并将其关联到该值 // 如果没有,随机生成一个颜色并将其关联到该值
this.colorMap[value] = this.getRandomColor() this.colorMap[value] = this.getRandomColor()
} }
// 返回值对应的颜色 // 返回值对应的颜色
return this.colorMap[value] return this.colorMap[value]
}, },
getRandomColor() { getRandomColor() {
// 从颜色数组中随机选取一个颜色 // 从颜色数组中随机选取一个颜色
const colorArray = [ const colorArray = [
'red', 'red',
'blue', 'blue',
'green', 'green',
'yellow', 'yellow',
'purple', 'purple',
'orange', 'orange',
'pink', 'pink',
'brown', 'brown',
'cyan', 'cyan',
'magenta', 'magenta',
'maroon', 'maroon',
'navy', 'navy',
'olive', 'olive',
'teal', 'teal',
'lime', 'lime',
'aqua', 'aqua',
'silver', 'silver',
'gray', 'gray',
'white', 'white',
'indigo', 'indigo',
'violet', 'violet',
'lavender', 'lavender',
'coral', 'coral',
'gold', 'gold',
'salmon', 'salmon',
'turquoise', 'turquoise',
'orchid', 'orchid',
'khaki', 'khaki',
'slategray', 'slategray',
'thistle', 'thistle',
'burlywood', 'burlywood',
'cadetblue', 'cadetblue',
'chartreuse', 'chartreuse',
'chocolate', 'chocolate',
'crimson', 'crimson',
'darkblue', 'darkblue',
'darkcyan', 'darkcyan',
'darkgoldenrod', 'darkgoldenrod',
'darkgray', 'darkgray',
'darkgreen', 'darkgreen',
'darkkhaki', 'darkkhaki',
'darkmagenta', 'darkmagenta',
'darkolivegreen', 'darkolivegreen',
'darkorange', 'darkorange',
'darkorchid', 'darkorchid',
'darkred', 'darkred',
'darksalmon', 'darksalmon',
'darkseagreen', 'darkseagreen',
'darkslateblue', 'darkslateblue',
'darkslategray', 'darkslategray',
'darkturquoise', 'darkturquoise',
'darkviolet', 'darkviolet',
'deeppink', 'deeppink',
'deepskyblue', 'deepskyblue',
'dodgerblue', 'dodgerblue',
'firebrick', 'firebrick',
'forestgreen', 'forestgreen',
'fuchsia', 'fuchsia',
'gold', 'gold',
'greenyellow', 'greenyellow',
'hotpink', 'hotpink',
'indianred', 'indianred',
'lawngreen', 'lawngreen',
'lightcoral', 'lightcoral',
'lightgreen', 'lightgreen',
'lightpink', 'lightpink',
'lightsalmon', 'lightsalmon',
'lightseagreen', 'lightseagreen',
'lightskyblue', 'lightskyblue',
'lightslategray', 'lightslategray',
'lightsteelblue', 'lightsteelblue',
'mediumaquamarine', 'mediumaquamarine',
'mediumblue', 'mediumblue',
'mediumorchid', 'mediumorchid',
'mediumpurple', 'mediumpurple',
'mediumseagreen', 'mediumseagreen',
'mediumslateblue', 'mediumslateblue',
'mediumspringgreen', 'mediumspringgreen',
'mediumturquoise', 'mediumturquoise',
'mediumvioletred', 'mediumvioletred',
'midnightblue', 'midnightblue',
'orangered', 'orangered',
'palegoldenrod', 'palegoldenrod',
'palegreen', 'palegreen',
'paleturquoise', 'paleturquoise',
'palevioletred', 'palevioletred',
'peru', 'peru',
'powderblue', 'powderblue',
'rosybrown', 'rosybrown',
'saddlebrown', 'saddlebrown',
'seagreen', 'seagreen',
'sienna', 'sienna',
'skyblue', 'skyblue',
'slateblue', 'slateblue',
'springgreen', 'springgreen',
'tan', 'tan',
'thistle', 'thistle',
'tomato', 'tomato',
'turquoise', 'turquoise',
'violet', 'violet',
] ]
const randomIndex = Math.floor(Math.random() * colorArray.length) const randomIndex = Math.floor(Math.random() * colorArray.length)
return colorArray[randomIndex] return colorArray[randomIndex]
}, },
}, },
} }
</script> </script>
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
<span slot="title">图片管理</span> <span slot="title">图片管理</span>
</el-menu-item> </el-menu-item>
</router-link> </router-link>
<router-link to="/home/users"> <router-link to="/home/csdnUser">
<el-menu-item index="/users" class="left-aside-item"> <el-menu-item index="/csdnUser" class="left-aside-item">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
<span slot="title">用户管理</span> <span slot="title">用户管理</span>
</el-menu-item> </el-menu-item>
......
<template>
<div>
<button type="button" class="btn btn-light btn-sm" @click="$router.back()">后退</button>
<h4 class="text-center">用户详情 --- {{ id }}</h4>
</div>
</template>
<script>
export default {
name: 'MyUserDetail',
props: ['id'],
}
</script>
<style lang="less" scoped></style>
\ No newline at end of file
...@@ -6,13 +6,12 @@ import pathArr from '@/router/pathArr.js' ...@@ -6,13 +6,12 @@ import pathArr from '@/router/pathArr.js'
import Login from '@/components/MyLogin.vue' import Login from '@/components/MyLogin.vue'
import Home from '@/components/MyHome.vue' import Home from '@/components/MyHome.vue'
import Users from '@/components/menus/MyUsers.vue'
import Pic from '@/components/menus/MyPic.vue' import Pic from '@/components/menus/MyPic.vue'
import Chat from '@/components/menus/MyChat.vue' import Chat from '@/components/menus/MyChat.vue'
import Interview from '@/components/menus/MyInterview.vue' import Interview from '@/components/menus/MyInterview.vue'
import Algorithmic from '@/components/menus/MyAlgorithmic.vue' import Algorithmic from '@/components/menus/MyAlgorithmic.vue'
import AphorismPoetry from '@/components/menus/MyAphorismPoetry.vue' import AphorismPoetry from '@/components/menus/MyAphorismPoetry.vue'
import UserDetail from '@/components/user/MyUserDetail.vue' import MyCsdnUser from '@/components/menus/MyCsdnUser.vue'
import MyChatDetail from '@/components/user/MyChatDetail.vue' import MyChatDetail from '@/components/user/MyChatDetail.vue'
import AddChatDetail from '@/components/user/AddChatDetail.vue' import AddChatDetail from '@/components/user/AddChatDetail.vue'
...@@ -73,21 +72,13 @@ const router = new VueRouter({ ...@@ -73,21 +72,13 @@ const router = new VueRouter({
title: '图片' // 设置默认标题 title: '图片' // 设置默认标题
} }
}, { }, {
path: 'users', path: 'csdnUser',
component: Users, component: MyCsdnUser,
meta: { meta: {
title: '用户管理' // 设置默认标题 title: '用户管理' // 设置默认标题
} }
}, },
// 用户详情页的路由规则
{ {
path: 'userinfo/:id',
component: UserDetail,
props: true,
meta: {
title: '用户信息' // 设置默认标题
}
}, {
path: 'chatinfo/:id', path: 'chatinfo/:id',
component: MyChatDetail, component: MyChatDetail,
props: true, props: true,
......
export default['/home', '/home/users', '/home/pic'] export default['/home', '/home/pic']
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册