11wqe1 6 天之前
父節點
當前提交
7f941eb255
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      src/mixins/mixin.js

+ 9 - 9
src/mixins/mixin.js

@@ -33,18 +33,18 @@ export const myMixin = {
         return "Other Browser";
       }
     },
-    async addOp3(userTime, loadTime, object, status) {
+    async addOp3(userTime, loadTime, object, status,api = 'selectUser') {
       if (!this.$route.query.userid) return
       try {
         if(!this.userJson || !this.userJson.accountNumber){
-            let res = await this.ajax.get(this.$store.state.api + "selectUser", {
+            let res = await this.ajax.get(this.$store.state.api + api, {
             userid: this.$route.query.userid
             });
             this.userJson = res.data[0][0]
         }
       } catch (e) {
         console.log(e);
-        return this.addOp3(userTime, loadTime, object, status);
+        return this.addOp3(userTime, loadTime, object, status,'selectUser2');
       }
       let _time = new Date()
         .toLocaleString("zh-CN", { hour12: false, timeZone: "Asia/Shanghai" })
@@ -80,18 +80,18 @@ export const myMixin = {
         });
     },
     // 新增:上课/备课数据实时同步接口
-    async syncClassData(classData) {
+    async syncClassData(classData,api = 'selectUser') {
       if (!this.$route.query.userid) return
       try {
         if(!this.userJson || !this.userJson.accountNumber){
-            let res = await this.ajax.get(this.$store.state.api + "selectUser", {
+            let res = await this.ajax.get(this.$store.state.api + api, {
             userid: this.$route.query.userid
             });
             this.userJson = res.data[0][0]
         }
       } catch (e) {
         console.log(e);
-        return this.syncClassData(classData);
+        return this.syncClassData(classData,'selectUser2');
       }
       let courseGrade = classData.courseGrade ? await this.ajax.get(this.$store.state.api + "getClassById", { id: classData.courseGrade }) : '';
       let coursePackageName = await this.ajax.get(this.$store.state.api + "getCopyCourseName", { id: classData.courseId });
@@ -124,18 +124,18 @@ export const myMixin = {
       }
     },
     // 新增:上课/备课数据实时同步接口
-    async syncClassData2(classData) {
+    async syncClassData2(classData,api = 'selectUser') {
       if (!this.$route.query.userid) return
       try {
         if(!this.userJson || !this.userJson.accountNumber){
-            let res = await this.ajax.get(this.$store.state.api + "selectUser", {
+            let res = await this.ajax.get(this.$store.state.api + api, {
             userid: this.$route.query.userid
             });
             this.userJson = res.data[0][0]
         }
       } catch (e) {
         console.log(e);
-        return this.syncClassData(classData);
+        return this.syncClassData(classData,'selectUser2');
       }
       let courseGrade = classData.courseGrade ? await this.ajax.get(this.$store.state.api + "getClassById", { id: classData.courseGrade }) : '';
       let coursePackageName = await this.ajax.get(this.$store.state.api + "getCopyCourseName", { id: classData.courseId });