Commit e13c63a6 by liang ce

全局spaning

parents 81b2cd99 87b5d8ff
......@@ -14,7 +14,8 @@ module.exports = {
'no-callback-literal': 0,
'standard/no-callback-literal': 0,
'camelcase': 0,
'no-use-v-if-with-v-for': 0
'no-use-v-if-with-v-for': 0,
'prefer-promise-reject-errors': 0
},
parserOptions: {
parser: 'babel-eslint'
......
......@@ -2,6 +2,7 @@ import axios from 'axios'
import qs from 'qs'
import { getToken, refreshToken } from './generateOrRefreshToken'
import { message } from 'ant-design-vue'
import store from '../store'
const BASE_URL = process.env.VUE_APP_API_URL
let loadingInstance // 创建Loading 的实例
// 配置发送请求前的拦截器,设置token信息
......@@ -28,10 +29,17 @@ axios.interceptors.request.use((config) => {
// 配置请求返回的拦截器,
axios.interceptors.response.use(res => {
// if (res.data.resultCode === 0) {
return Promise.resolve(res)
// return Promise.resolve(res)
// } else {
// return Promise.reject()
// }
if (res.data.code === 0 || res.data.resultCode === 0) {
store.dispatch('setSpinning', false)
return Promise.resolve(res)
} else if (res.data.code === 40003 || res.data.resultCode === 40003) {
message.error('权限不足')
return Promise.reject('1')
}
}, err => {
return new Promise((resolve, reject) => {
console.log(err)
......
......@@ -54,7 +54,6 @@ export default {
$http.post('/admin/menu/user', data).then(res => {
const result = that.getSelectList(res.data.data)
store.dispatch('setMenuList', that.selectList)
console.log(this.$store.state)
})
config.ddconfig()
},
......
<template>
<a-spin :spinning="spinning">
<a-spin :spinning="this.$store.state.spinning">
<div class="AccountManagement">
<div class="searchBox">
<div class="choosePeople" @click="choosePeople" style="width: 120px">选择成员</div>
......@@ -129,13 +129,13 @@
import { config } from './../../../api/config.js'
import { $http } from './../../../api/axios.js'
import { MINGPAY_ACCOUNT_STATUS } from './../../../api/constant'
import store from './../../../store'
// import { avatarFn } from './../../../api/avatar'
export default {
name: 'accountManagement',
components: {},
data () {
return {
spinning: false,
visible: false,
visible2: false,
formLayout: 'horizontal',
......@@ -356,7 +356,7 @@ export default {
} else if (!this.form.getFieldsValue().remark) {
this.$message.error('备注不能为空')
} else {
this.spinning = !this.spinning
store.dispatch('setSpinning', true)
this.visible = false
this.rechargeData.orderPrice = this.form.getFieldsValue().orderPrice
this.rechargeData.remark = this.form.getFieldsValue().remark
......@@ -364,16 +364,8 @@ export default {
if (res.data.resultCode === 0) {
this.form.resetFields()
this.$message.success(res.data.data.message)
this.spinning = !this.spinning
this.queryAccountList()
} else {
this.spinning = !this.spinning
this.$message.error(res.data.message)
}
}).catch((err) => {
console.log(err)
this.spinning = !this.spinning
this.$message.error('充值失败')
})
}
},
......
<template>
<a-spin :spinning="this.$store.state" :delay="delayTime">
<a-spin :spinning="this.$store.state.spinning" :delay="delayTime">
<div class="allowanceDetails">
<a-button type="primary" @click="back()"><img style="margin-top:-4px;margin-right: 6px;width: 14px" src="../../../assets/back.png"/>返回</a-button>
<div class="title">津贴详情</div>
......@@ -72,6 +72,7 @@
<script>
import { $http } from './../../../api/axios.js'
import store from './../../../store'
import moment from 'moment'
export default {
name: 'allowanceDetails',
......@@ -153,10 +154,7 @@ export default {
$http.post(`/mingpay/v1/isv/account/update_coupon_record`, RecordData).then((res) => {
if (res.data.resultCode === 0) {
that.allowanceDetails.endTime = `${values['date-picker']} 23:59:59`
that.spinning = !that.spinning
that.$message.success('修改成功')
} else {
that.$message.error('修改失败')
}
})
})
......
<template>
<a-spin :spinning="this.$store.state" :delay="delayTime">
<a-spin :spinning="this.$store.state.spinning" :delay="delayTime">
<div class="AllowancePayment">
<div class="searchBox">
<div style="width: 75px">截止时间:</div>
......@@ -98,6 +98,7 @@
import { config } from './../../../api/config.js'
import { $http } from './../../../api/axios.js'
import { MINGPAY_SUBSIDY_STATUS } from './../../../api/constant'
import store from './../../../store'
import moment from 'moment'
export default {
name: 'AllowancePayment',
......
......@@ -7,7 +7,7 @@
<a-input
placeholder="请填写角色名称"
v-decorator="['roleName',{
rules: [{required: true, message: '角色名称不能为空'}],
rules: [{required: true, message: '角色名称不能为空'}, {max: 10, message: '角色名称不能超过10个字符'}],
initialValue: roleName,
}]"
/>
......@@ -16,7 +16,7 @@
<a-input
placeholder="请填写角色的描述"
v-decorator="['roleDesc',{
rules: [{required: false, message: '角色描述不能为空'}],
rules: [{required: false, message: '角色描述不能为空'}, {max: 50, message: '角色描述不能超过50个字符'}],
initialValue: roleDesc,
}]"
/>
......@@ -144,6 +144,7 @@ export default {
$http.post(`/admin/manager/addFullRole`, data).then(res => {
if (res.data.code === 0) {
this.$message.success('保存成功')
this.$router.push({ name: 'rightsManagement' })
} else {
this.$message.error(res.data.msg)
}
......
......@@ -165,9 +165,9 @@ export default {
})
this.roleList.push({
key: item.roleId,
roleName: item.roleName || '---',
userHasRoles: userHasRoles || '---',
roleDesc: item.roleDesc || '---',
roleName: item.roleName,
userHasRoles: userHasRoles,
roleDesc: item.roleDesc,
creatTime: item.createTime ? item.createTime.replace('T', ' ') : '',
action: { ddUserId: ddUserId, name: userHasRoles }
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment