Commit e13c63a6 by liang ce

全局spaning

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