节假日添加同步
This commit is contained in:
parent
5ec2d573b7
commit
961e882a89
|
|
@ -97,11 +97,8 @@ const responseInterceptor = <T = unknown>(response: AxiosResponse<ApiResponse<T>
|
|||
switch (data.code) {
|
||||
case 1:
|
||||
// 跳转到注册页
|
||||
router.push('/user/register')
|
||||
if (!data.msg) {
|
||||
data.msg = '未知的错误!'
|
||||
}
|
||||
break
|
||||
window.location.href = '/user/register'
|
||||
throw new Error(data.msg || '未知的错误!')
|
||||
case -100:
|
||||
// 退出登录
|
||||
data.msg = 'token过期!'
|
||||
|
|
@ -109,15 +106,15 @@ const responseInterceptor = <T = unknown>(response: AxiosResponse<ApiResponse<T>
|
|||
removeStorage('userInfo')
|
||||
removeStorage('menusInfo')
|
||||
removeStorage('permissionsInfo')
|
||||
router.push({ name: 'Login' })
|
||||
break
|
||||
window.location.href = '/user/login'
|
||||
throw new Error(data.msg)
|
||||
case -101:
|
||||
data.msg = 'token错误!'
|
||||
removeStorage('token')
|
||||
router.push({ name: 'Login' })
|
||||
break
|
||||
window.location.href = '/user/login'
|
||||
throw new Error(data.msg)
|
||||
default:
|
||||
break;
|
||||
throw new Error(data.msg || '操作失败!')
|
||||
}
|
||||
|
||||
// 其他业务失败:弹错误提示并拒绝Promise
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
<el-button type="primary" @click="handleSearch" v-auth="'contractVariety_addHoliday'"
|
||||
:loading="loading">搜索</el-button>
|
||||
<el-button @click="handleReset" :loading="loading">重置</el-button>
|
||||
<el-button type="primary" :loading="syncLoading" @click="handleSyncRiskControl()" v-auth="'riskControl_editRiskControlSetting'">
|
||||
同步
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="search-right">
|
||||
|
|
@ -56,6 +59,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||
import { usePageLoading } from '@/composables/useLoading'
|
||||
import Table from '@/components/common/Table.vue'
|
||||
import Form from '@/components/common/Form.vue'
|
||||
import { syncRiskControlApi } from '@/api/modules/risk'
|
||||
|
||||
defineOptions({
|
||||
name: 'Holidays'
|
||||
|
|
@ -213,6 +217,16 @@ const getList = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
// 同步风控模板
|
||||
const syncLoading = ref(false)
|
||||
const handleSyncRiskControl = async () => {
|
||||
syncLoading.value = true
|
||||
try {
|
||||
await syncRiskControlApi()
|
||||
} finally {
|
||||
syncLoading.value = false
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @description: 搜索
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue