errorCreate

Former-commit-id: b35c93c176a7ec70e8b4290268a5491f883fc47b [formerly b35c93c176a7ec70e8b4290268a5491f883fc47b [formerly b35c93c176a7ec70e8b4290268a5491f883fc47b [formerly b35c93c176a7ec70e8b4290268a5491f883fc47b [formerly 196a7a27ea7f0fdde4e8966725d2b8ce229f3728 [formerly f05a95ee522e9efe8b241252873f24cbc57e4d1d]]]]]
Former-commit-id: 7cd39c99fb0bfd89447ee658ea6c3ca045bc1557
Former-commit-id: 33d6b9f2400e904f5d8d6f31380fa60aabad5e36
Former-commit-id: e70d9fd06fb9e92f063090263fc99098641e5b45 [formerly 225cf77ec81a760f602f51d560699225fb89db8a]
Former-commit-id: 042d162a4a2b01f261d63f701cb8f73442aa65b3
Former-commit-id: c3963efcdbd2e20a5669954f2f889804dd16c4a4
Former-commit-id: 20b93289f1a0a06a695935836d1228f0f8f34d39
Former-commit-id: afa388bcb14587e2dba1957692e630418e36f37b
Former-commit-id: 975a97b34c1d4b017fbcdb918145c1ed551bd09e
This commit is contained in:
liyang
2019-01-08 14:51:07 +08:00
parent 635b59cc97
commit 6236d0e7c9

View File

@@ -4,7 +4,7 @@ import { Message } from 'element-ui'
import util from '@/libs/util' import util from '@/libs/util'
// 创建一个错误 // 创建一个错误
function errorCreat (msg) { function errorCreate (msg) {
const err = new Error(msg) const err = new Error(msg)
errorLog(err) errorLog(err)
throw err throw err
@@ -72,11 +72,11 @@ service.interceptors.response.use(
return dataAxios.data return dataAxios.data
case 'xxx': case 'xxx':
// [ 示例 ] 其它和后台约定的 code // [ 示例 ] 其它和后台约定的 code
errorCreat(`[ code: xxx ] ${dataAxios.msg}: ${response.config.url}`) errorCreate(`[ code: xxx ] ${dataAxios.msg}: ${response.config.url}`)
break break
default: default:
// 不是正确的 code // 不是正确的 code
errorCreat(`${dataAxios.msg}: ${response.config.url}`) errorCreate(`${dataAxios.msg}: ${response.config.url}`)
break break
} }
} }