整理

上级 57cce4a8
...@@ -223,11 +223,12 @@ export default { ...@@ -223,11 +223,12 @@ export default {
this.getAllQuestionType() this.getAllQuestionType()
}, },
mounted() { mounted() {
// 在页面加载时从localStorage中获取currentPage的值 this.currentPage = 1
const storedPage = localStorage.getItem('algorithmLastPage') // // 在页面加载时从localStorage中获取currentPage的值
if (storedPage) { // const storedPage = localStorage.getItem('algorithmLastPage')
this.currentPage = parseInt(storedPage) // if (storedPage) {
} // this.currentPage = parseInt(storedPage)
// }
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
...@@ -296,6 +297,7 @@ export default { ...@@ -296,6 +297,7 @@ export default {
leetcodeLink: this.form.leetcodeLink, leetcodeLink: this.form.leetcodeLink,
}) })
if (res.code === 200) { if (res.code === 200) {
this.currentPage = 1
this.form.questionName = '' this.form.questionName = ''
this.form.questionType = 0 this.form.questionType = 0
this.form.degreeOfImportance = 5 this.form.degreeOfImportance = 5
......
...@@ -144,11 +144,12 @@ export default { ...@@ -144,11 +144,12 @@ export default {
this.interviewPage() this.interviewPage()
}, },
mounted() { mounted() {
// 在页面加载时从localStorage中获取currentPage的值 this.currentPage = 1
const storedPage = localStorage.getItem('poetryLastPage') // // 在页面加载时从localStorage中获取currentPage的值
if (storedPage) { // const storedPage = localStorage.getItem('poetryLastPage')
this.currentPage = parseInt(storedPage) // if (storedPage) {
} // this.currentPage = parseInt(storedPage)
// }
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
...@@ -203,6 +204,8 @@ export default { ...@@ -203,6 +204,8 @@ export default {
}) })
if (res.code === 200) { if (res.code === 200) {
this.form.poetryText = '' this.form.poetryText = ''
this.currentPage=1
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)
......
...@@ -153,11 +153,12 @@ export default { ...@@ -153,11 +153,12 @@ export default {
this.getQuestionType() this.getQuestionType()
}, },
mounted() { mounted() {
// 在页面加载时从localStorage中获取currentPage的值 this.currentPage = 1
const storedPage = localStorage.getItem('interviewLastPage') // // 在页面加载时从localStorage中获取currentPage的值
if (storedPage) { // const storedPage = localStorage.getItem('interviewLastPage')
this.currentPage = parseInt(storedPage) // if (storedPage) {
} // this.currentPage = parseInt(storedPage)
// }
}, },
methods: { methods: {
prepareAdd() { prepareAdd() {
...@@ -210,6 +211,7 @@ export default { ...@@ -210,6 +211,7 @@ export default {
questionType: this.form.questionType, questionType: this.form.questionType,
}) })
if (res.code === 200) { if (res.code === 200) {
this.currentPage = 1
this.form.question = '' this.form.question = ''
this.form.questionType = 0 this.form.questionType = 0
this.getQuestionType() // 确保这个方法是有效的 this.getQuestionType() // 确保这个方法是有效的
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册