diff --git a/package.json b/package.json index 3d58976093431298149e77c4773c784e18eabcf0..10691322fcfe4768343134cdd5a89b939e39efce 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --port 3001", + "serve": "vue-cli-service serve --port 3001", "build": "vue-cli-service build" }, "dependencies": { diff --git a/src/components/menus/MyChat.vue b/src/components/menus/MyChat.vue index ae00bd523164a877e72f0663788b33d2a25d9a02..bff5b50dd4ac085d3e8f0b293b9738a908581bba 100644 --- a/src/components/menus/MyChat.vue +++ b/src/components/menus/MyChat.vue @@ -54,7 +54,7 @@ export default { // 用户列表数据 userlist: [], loading: false, - currentPage: 1, + currentPage: localStorage.getItem("lastPage") || 1, pageSize: 5, total: 0, }; @@ -64,7 +64,15 @@ export default { // 调用请求数据的方法 this.initCartList(); }, - + mounted() { + console.log(this.$refs) + var lastPage = localStorage.getItem("lastPage"); + if (lastPage) { + this.$nextTick(() => { + this.$refs.pagination.setCurrentPage(Number(lastPage)); + }); + } + }, methods: { refreshPage() { location.reload(); @@ -87,6 +95,7 @@ export default { if (res.code === 200) { this.userlist = res.result.records; this.total = res.result.total; + localStorage.setItem("lastPage", this.currentPage); } this.loading = false; }, @@ -118,4 +127,4 @@ export default { margin-right: 15px; font-size: 20px; } - + \ No newline at end of file diff --git a/src/components/user/MyChatDetail.vue b/src/components/user/MyChatDetail.vue index 6d269f12b08dedd57e27be71b461c5f03e42cf27..ba95b7de3762adddc92ea275c2b761189a7dae34 100644 --- a/src/components/user/MyChatDetail.vue +++ b/src/components/user/MyChatDetail.vue @@ -36,7 +36,6 @@