This commit is contained in:
宋伟佳
2021-06-16 13:44:27 +08:00
parent 8beae2f334
commit fc66a89e5b
3 changed files with 6 additions and 17 deletions
+5 -8
View File
@@ -89,8 +89,7 @@ export default {
if (_this) {
_this[loading] = true
}
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + url + '?' + new Date().getTime(), _formData).then(res => {
_axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => {
if (_this && loading) { _this[loading] = false }
if (res.data.ok !== undefined && showTips) {
let type = res.data.ok ? 'success' : 'warning'
@@ -132,8 +131,7 @@ export default {
if (_this) {
_this[loading] = true
}
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + url + '?' + new Date().getTime(), param).then(res => {
_axios.post(api() + url + '?' + new Date().getTime(), param).then(res => {
if (_this && loading) { _this[loading] = false }
if (res.data.ok !== undefined && showTips) {
let type = res.data.ok ? 'success' : 'warning'
@@ -172,8 +170,7 @@ export default {
if (_this) {
_this[loading] = true
}
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + url + '?' + new Date().getTime(), _formData).then(res => {
_axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => {
if (_this && loading) { _this[loading] = false }
thenFun.call(this, res.data)
}).catch(err => {
@@ -205,8 +202,8 @@ export default {
if (_this) {
_this[loading] = true
}
const prefix = config.prefix || '/api/'
_axios.get(prefix + '/' + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => {
_axios.get(api() + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => {
if (_this && loading) { _this[loading] = false }
// 返回data对象
if (res.ok !== undefined) {