Browse Source

添加catch

zhouzhujun 3 months ago
parent
commit
b325d262f2
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/pages/index.vue

+ 4 - 2
src/pages/index.vue

@@ -81,6 +81,8 @@ export default {
 			} else {
 				Toast(res.msg)
 			}
+		}).catch(err => {
+			console.log(e)
 		})
 	},
 	methods: {
@@ -88,9 +90,9 @@ export default {
 			try {
 				let authArr = authStr.split(',')
 				authArr.forEach(item => {
-					 if(authMap[item]){
+					if (authMap[item]) {
 						this.role[authMap[item]] = true
-					 }
+					}
 				})
 			} catch (e) {
 				console.log(e)