diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/public/config/project.config.json b/public/config/project.config.json
index ca10ddf..e9d9632 100644
--- a/public/config/project.config.json
+++ b/public/config/project.config.json
@@ -2,7 +2,7 @@
"title": "后台管理系统",
"subtitle": "",
"theme":"blue",
- "baseUrl": "http://192.168.8.101:11410/",
+ "baseUrl": "http://111.198.10.15:11410/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"provinceCode":"360000",
diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue
index e17a8ee..7c358e2 100644
--- a/src/components/Hamburger/index.vue
+++ b/src/components/Hamburger/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -21,23 +20,25 @@
isActive: {
type: Boolean,
default: false
- },
- toggleClick: {
- type: Function,
- default: null
+ }
+ },
+ methods: {
+ toggleClick() {
+ this.$emit('toggleClick')
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 9602d75..0478029 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 009ebab..44315c7 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -24,17 +24,17 @@
class="nest-menu"
/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/request.js b/src/utils/request.js
index c88ea76..02dcee1 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -33,6 +33,7 @@
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
+ // 如果是文件
if (res instanceof Blob) {
return response
} else if (res.code !== 200) {
@@ -67,7 +68,7 @@
},
error => {
// 如果是下载文件返回的错误
- if (error.response.data instanceof Blob) {
+ if (error.response && error.response.data instanceof Blob) {
// 将blob强制转换为JSON
var reader = new FileReader()
reader.onload = e => {
@@ -79,7 +80,7 @@
duration: 3000
})
}
- } else {
+ } else if (error.response && error.response.data) {
console.log('错误:' + error.response.data.message) // for debug
// Message.error(error.response.data.message)
Message({
@@ -88,6 +89,13 @@
type: 'error',
duration: 3000
})
+ } else if (error.message) {
+ Message({
+ showClose: true,
+ message: error.message,
+ type: 'error',
+ duration: 3000
+ })
}
return Promise.reject(error)
diff --git a/src/views/login/index_2.vue b/src/views/login/index_2.vue
index 4e3fee6..28945e8 100644
--- a/src/views/login/index_2.vue
+++ b/src/views/login/index_2.vue
@@ -51,7 +51,7 @@
-
![]()
+
@@ -143,8 +143,8 @@
this.loginForm.kaptcha = this.$refs.kaptcha.kaptcha
console.log(this.loginForm.kaptcha)
},
- handleLogin() { // 点击登录按钮
-
+ // 点击登录按钮
+ handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
diff --git a/src/views/system/dept/editDept.vue b/src/views/system/dept/editDept.vue
index 462004a..203d542 100644
--- a/src/views/system/dept/editDept.vue
+++ b/src/views/system/dept/editDept.vue
@@ -16,8 +16,7 @@
-
-
+
@@ -58,8 +57,8 @@