首页登录39后台

This commit is contained in:
宋伟佳
2021-06-16 13:39:28 +08:00
parent 9495265b47
commit 448dab48dc
7 changed files with 141 additions and 11 deletions
+8 -5
View File
@@ -89,7 +89,8 @@ export default {
if (_this) {
_this[loading] = true
}
_axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => {
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + 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'
@@ -131,7 +132,8 @@ export default {
if (_this) {
_this[loading] = true
}
_axios.post(api() + url + '?' + new Date().getTime(), param).then(res => {
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + 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'
@@ -170,7 +172,8 @@ export default {
if (_this) {
_this[loading] = true
}
_axios.post(api() + url + '?' + new Date().getTime(), _formData).then(res => {
const prefix = config.prefix || '/api/'
_axios.post(prefix + '/' + url + '?' + new Date().getTime(), _formData).then(res => {
if (_this && loading) { _this[loading] = false }
thenFun.call(this, res.data)
}).catch(err => {
@@ -202,8 +205,8 @@ export default {
if (_this) {
_this[loading] = true
}
_axios.get(api() + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => {
const prefix = config.prefix || '/api/'
_axios.get(prefix + '/' + url + '?_t=' + new Date().getTime(), { params: param, cancelToken: config.cancelToken }).then(res => {
if (_this && loading) { _this[loading] = false }
// 返回data对象
if (res.ok !== undefined) {