|
@@ -4,7 +4,9 @@ import axios from "axios";
|
|
|
var qs = require('qs')
|
|
|
import bus from '../../components/common/bus'
|
|
|
import apiConfig from '@/config/index.js'
|
|
|
+import getConfig from '../../config/dev.js'
|
|
|
// import {Decimal} from './decimal.js';
|
|
|
+let config = getConfig()
|
|
|
var Decimal = require('decimal')
|
|
|
let moment = require('moment')
|
|
|
let common = {
|
|
@@ -263,38 +265,64 @@ let common = {
|
|
|
if (!obj.disableLoading) {
|
|
|
loading.close()
|
|
|
}
|
|
|
- if (response.data.code === 1 ||response.data.code == '1') {
|
|
|
- bus.$message.success(response.data.data.message)
|
|
|
- loading.close()
|
|
|
- success(response.data.data)
|
|
|
- return response
|
|
|
- // if (response.code === 1 ||response.code == '1') {
|
|
|
- // bus.$message.success(response.data.message)
|
|
|
- // loading.close()
|
|
|
- // success(response.data)
|
|
|
- // return response
|
|
|
- } else {
|
|
|
- if (obj.printMsg) {
|
|
|
- if (response.message) {
|
|
|
- if (eval(apiConfig.ENV_CONFIG) == 'dev' || eval(apiConfig.ENV_CONFIG) == 'test') {
|
|
|
- bus.$message({
|
|
|
- message: response.message,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ if (process.env.VUE_APP_ENV == 'development' || process.env.VUE_APP_ENV == 'devs') {
|
|
|
+ if (response.code === 1 || response.code == '1') {
|
|
|
+ bus.$message.success(response.data.message)
|
|
|
+ loading.close()
|
|
|
+ success(response.data)
|
|
|
+ return response
|
|
|
+ } else {
|
|
|
+ if (obj.printMsg) {
|
|
|
+ if (response.message) {
|
|
|
+ if (eval(apiConfig.ENV_CONFIG) == 'dev' || eval(apiConfig.ENV_CONFIG) == 'test') {
|
|
|
+ bus.$message({
|
|
|
+ message: response.message,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ bus.$notify.error(response.message.substring(0, 100))
|
|
|
+ }
|
|
|
+ if (typeof error === 'function') {
|
|
|
+ error.call(example, response.message)
|
|
|
+ }
|
|
|
} else {
|
|
|
- bus.$notify.error(response.message.substring(0, 100))
|
|
|
- }
|
|
|
- if (typeof error === 'function') {
|
|
|
- error.call(example, response.message)
|
|
|
+ bus.$notify.error('接口请求失败')
|
|
|
+ if (typeof error === 'function') {
|
|
|
+ error.call(example, '错误信息')
|
|
|
+ }
|
|
|
}
|
|
|
- } else {
|
|
|
- bus.$notify.error('接口请求失败')
|
|
|
- if (typeof error === 'function') {
|
|
|
- error.call(example, '错误信息')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (response.data.code === 1 || response.data.code == '1') {
|
|
|
+ bus.$message.success(response.data.message)
|
|
|
+ loading.close()
|
|
|
+ success(response.data.data)
|
|
|
+ return response
|
|
|
+ } else {
|
|
|
+ if (obj.printMsg) {
|
|
|
+ if (response.message) {
|
|
|
+ if (eval(apiConfig.ENV_CONFIG) == 'dev' || eval(apiConfig.ENV_CONFIG) == 'test') {
|
|
|
+ bus.$message({
|
|
|
+ message: response.message,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ bus.$notify.error(response.message.substring(0, 100))
|
|
|
+ }
|
|
|
+ if (typeof error === 'function') {
|
|
|
+ error.call(example, response.message)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ bus.$notify.error('接口请求失败')
|
|
|
+ if (typeof error === 'function') {
|
|
|
+ error.call(example, '错误信息')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
.catch(function (msgE) {
|
|
|
if (obj.printMsg) {
|