Browse Source

系统模块功能优化

fanghuisheng 2 years ago
parent
commit
f7a441ef29

+ 1 - 1
src/pages/mine/index.vue

@@ -172,7 +172,7 @@ page {
     top: -50px;
 
     .mine-actions {
-      margin: 15px 15px;
+      margin: 0.625rem 0.625rem;
       padding: 20px 0px;
       border-radius: 8px;
       background-color: white;

+ 5 - 3
src/pages/mine/info/edit.vue

@@ -20,7 +20,7 @@
   </view>
 </template>
 
-<script>
+<script setup>
 import { getUserProfile } from "@/api/system/user";
 import { updateUserProfile } from "@/api/system/user";
 
@@ -88,13 +88,15 @@ const form = ref(null);
 
 function getUser() {
   getUserProfile().then((response) => {
-    user.value = response.data;
+    console.log(response);
+    user.value = response.data.user;
   });
 }
 function submit(ref) {
   form.value.validate().then((res) => {
     updateUserProfile(user.value).then((response) => {
-      proxy.$modal.msgSuccess("修改成功");
+      proxy.$modal.msgSuccess("修改成功,重新登录后生效!");
+      proxy.$tab.reLaunch("pages/mine/index");
     });
   });
 }

+ 1 - 1
src/pages/mine/info/index.vue

@@ -32,7 +32,7 @@ const postGroup = ref("");
 
 function getUser() {
   getUserProfile().then((response) => {
-    user.value = response.data;
+    user.value = response.data.user;
     roleGroup.value = response.roleGroup;
     postGroup.value = response.postGroup;
   });

+ 1 - 1
src/static/scss/global.scss

@@ -68,7 +68,7 @@
   
   
   .menu-list {
-    margin: 15px 15px;
+    margin: 0.625rem 0.625rem;
   
     .menu-item-box {
       width: 100%;

+ 2 - 0
src/utils/request.js

@@ -51,8 +51,10 @@ const request = (config) => {
           reject("无效的会话,或者会话已过期,请重新登录。");
         } else if (code === 500 || res.statusCode === 500) {
           if (res.data.msg.indexOf(":") !== -1) {
+            modal.msg(res.data.msg.split(":")[1]);
             reject(res.data.msg.split(":")[1]);
           } else {
+            modal.msg(res.data.msg);
             reject(res.data.msg);
           }
         } else if (code !== 200 && code !== "0") {

+ 8 - 2
src/utils/upload.js

@@ -43,8 +43,14 @@ const upload = (config) => {
             }
           });
           reject("无效的会话,或者会话已过期,请重新登录。");
-        } else if (code === 500) {
-          reject("500");
+        } else if (code === 500 || res.statusCode === 500) {
+          if (res.data.msg.indexOf(":") !== -1) {
+            modal.msg(res.data.msg.split(":")[1]);
+            reject(res.data.msg.split(":")[1]);
+          } else {
+            modal.msg(res.data.msg);
+            reject(res.data.msg);
+          }
         } else if (code !== 200 && code !== "0") {
           reject(code);
         }