Browse Source

滚动条回到顶部

gzb
guozhongbo 7 months ago
parent
commit
23683ed80a
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/utils/httpRequest.js

+ 6
- 0
src/utils/httpRequest.js View File

@@ -66,6 +66,12 @@ http.interceptors.request.use(
66 66
 http.interceptors.response.use(
67 67
   (response) => {
68 68
     let resData = response.data;
69
+    if (resData.code === 0) {
70
+      //滚动条回到顶部
71
+      if (document.querySelector(".main_root")) {
72
+        document.querySelector(".main_root").scrollTop = 0;
73
+      }
74
+    }
69 75
     if (resData.code === 2) {
70 76
       console.log(
71 77
         "文件名:httpRequest.js,退出原因:" +

Loading…
Cancel
Save