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