同步学生
This commit is contained in:
@@ -25,9 +25,10 @@ export function listStudent(query) {
|
||||
})
|
||||
}
|
||||
// 新同步学生信息
|
||||
export function syncStudentInfo() {
|
||||
export function synchronousStudent(query) {
|
||||
return request({
|
||||
url: '/syncdata/synchronousStudent',
|
||||
method: 'post'
|
||||
method: 'post',
|
||||
params:query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStudent, syncStudentInfo } from '@/api/stuCQS/synchronous-data/sync-stu'
|
||||
import { listStudent, synchronousStudent } from '@/api/stuCQS/synchronous-data/sync-stu'
|
||||
import { listGrade } from '@/api/stuCQS/basedata/grade'
|
||||
|
||||
export default {
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
this.loading = true
|
||||
try {
|
||||
this.$modal.msgSuccess('正在同步')
|
||||
const res = await syncStudentInfo(this.queryParams)
|
||||
const res = await synchronousStudent(this.queryParams)
|
||||
// 增加接口返回值校验,避免res.msg不存在导致的二次报错
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
@@ -168,8 +168,10 @@ export default {
|
||||
//this.getList() // 仅接口正常返回时刷新列表
|
||||
} catch (error) {
|
||||
// 捕获接口报错,提示用户并打印错误日志(便于排查)
|
||||
this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
//this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
//console.error('同步数据报错:', error)
|
||||
this.getList()
|
||||
} finally {
|
||||
// 无论成功/失败,最终都会执行这里,重置加载状态
|
||||
this.loading = false
|
||||
|
||||
@@ -155,8 +155,10 @@ export default {
|
||||
//this.getList() // 仅接口正常返回时刷新列表
|
||||
} catch (error) {
|
||||
// 捕获接口报错,提示用户并打印错误日志(便于排查)
|
||||
this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
//this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
//console.error('同步数据报错:', error)
|
||||
this.getList()
|
||||
} finally {
|
||||
// 无论成功/失败,最终都会执行这里,重置加载状态
|
||||
this.loading = false
|
||||
|
||||
Reference in New Issue
Block a user