Skip to content

Commit

Permalink
errorCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyEver committed Jan 8, 2019
1 parent daba147 commit c6e8120
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugin/axios/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Message } from 'element-ui'
import util from '@/libs/util'

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

0 comments on commit c6e8120

Please sign in to comment.