同步学生

This commit is contained in:
2026-03-03 11:52:14 +08:00
parent 2d5eec7c56
commit d81df84322
3 changed files with 11 additions and 6 deletions

View File

@@ -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
})
}

View File

@@ -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

View File

@@ -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