diff --git a/teaching_integration_platform_template/src/api/configuration.ts b/teaching_integration_platform_template/src/api/configuration.ts index bfcdfab..4eb9fb6 100644 --- a/teaching_integration_platform_template/src/api/configuration.ts +++ b/teaching_integration_platform_template/src/api/configuration.ts @@ -8,22 +8,24 @@ enum Api { } // 提示批量处理 const initOptions = { text: '加载中', success: '成功', error: '失败' } -function proxrequest(request, options: any = initOptions) { +export function proxrequest(request, options: Partial = initOptions) { + return async (...arg) => { if (!options) return request(...arg) const loadingInstance = ElLoading.service({ text: options.text }) - + let result; try { - await request(...arg) + result = await request(...arg) ElMessage.success(options.success) } catch (error) { + result = error ElMessage.error(options.error) } finally { loadingInstance.close() } - return request + return result } } diff --git a/teaching_integration_platform_template/src/store/module/user.ts b/teaching_integration_platform_template/src/store/module/user.ts index a22d5a1..55aa1d9 100644 --- a/teaching_integration_platform_template/src/store/module/user.ts +++ b/teaching_integration_platform_template/src/store/module/user.ts @@ -5,6 +5,7 @@ const userStore = defineStore('userStore', () => { const userInfo = reactive({}) const isLogin = ref(false) const token = ref('') + const verifyToken = () => { } userGetInfoService(token.value).then(res => { // @ts-ignore @@ -16,7 +17,8 @@ const userStore = defineStore('userStore', () => { return { token, userInfo, - isLogin + isLogin, + verifyToken } }) export default userStore diff --git a/teaching_integration_platform_template/src/views/course/index.vue b/teaching_integration_platform_template/src/views/course/index.vue index a8baeb5..63a661e 100644 --- a/teaching_integration_platform_template/src/views/course/index.vue +++ b/teaching_integration_platform_template/src/views/course/index.vue @@ -2,17 +2,8 @@
- +
- +
- + + +
- + + +
-
+
二层 三层 @@ -65,32 +52,17 @@
- +
-
+
{{ item.name }}
-
+
{{ item.name }}
@@ -98,24 +70,14 @@ Role
-
+
{{ item.name }}
-
+
{{ item.name }}
@@ -130,7 +92,8 @@
- 《Vues 设计与实现》这本书的简介: 《Vues 设计与实现》是一本深入剖析 + {{ Route.query.name }}这个课程的简介:{{ learn.description }} +
@@ -184,7 +147,7 @@