Procházet zdrojové kódy

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin před 3 roky
rodič
revize
96251e23a8

+ 2 - 2
TEAMModelOS/ClientApp/src/api/http.js

@@ -16,7 +16,7 @@ axios.defaults.baseURL = ''
 axios.interceptors.request.use(
     async (config) => {
 
-        // 呼叫API先偵測是否超過小時,有則回到登入頁
+        // 呼叫API先偵測是否超過小時,有則回到登入頁
         let webEndTime = localStorage.getItem('webEndTime')
         let access_token = localStorage.getItem('access_token')
         if (isProduction && access_token && webEndTime) {
@@ -107,7 +107,7 @@ axios.interceptors.response.use(
 
 /**检测token是否快过期 */
 function checkToken() {
-    if (!localStorage.getItem('expires_in') || localStorage.getItem('expires_in') == undefined) return false
+    if (!localStorage.getItem('expires_in')) return false
 
     var nowTime = new Date();
     var offset = nowTime.getTimezoneOffset() / 60

+ 1 - 1
TEAMModelOS/ClientApp/src/common/UploadModal.vue

@@ -1,7 +1,7 @@
 <template>
     <Modal v-model="uploadStatus" :ok-text="textLoading ? $t('updModal.uploading') : isComplete ? $t('updModal.complete'):$t('updModal.comfirmUpd')" :cancel-text="$t('updModal.cancelUpd')" :title="$t('teachContent.btnUpload')" class="upload-modal dark-iview-modal" width="900" :mask-closable="false" :closable="false" @on-ok="modalOk" @on-cancel="modalCancel" :loading="modalLoading">
         <div class="upload-file-box">
-            <ResBelong @tag-change="getResTags" v-show="routerScope == 'school'" showLabel class="upd-to-pd" :pdId="pdId"></ResBelong>
+            <ResBelong v-if="$store.state.userInfo.hasSchool" @tag-change="getResTags" v-show="routerScope == 'school'" showLabel class="upd-to-pd" :pdId="pdId"></ResBelong>
             <Upload type="drag" action="" :show-upload-list="false" multiple :before-upload="customUpload" class="upload-wrap" :disabled="textLoading">
                 <Icon class="upload-icon" custom="iconfont icon-upload" v-show="!uploadedList.length" />
                 <p class="upload-text" :style="{marginTop: uploadedList.length ? '25px':'0px'}">

+ 11 - 1
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -708,7 +708,7 @@ export default {
                         res.tmdinfos.forEach(item => {
                             item.type = 'TMID'
                         })
-                        res.tmdinfos.sort((a,b)=>{
+                        res.tmdinfos.sort((a, b) => {
                             return slist.tmids.indexOf(a.id) - slist.tmids.indexOf(b.id)
                         })
                         this.$set(this.courseListShow[this.curCusIndex].schedule[this.curClassIndex], 'allStu', res.stus.concat(res.tmdinfos))
@@ -1245,6 +1245,16 @@ export default {
                     }).then(
                         res => {
                             if (!res.error) {
+                                //删除原始数据
+                                let cusId = this.courseListShow[this.curCusIndex].id
+                                let originIndex = this.courseList.findIndex(item => {
+                                    return item.id == cusId
+                                })
+                                if (originIndex > -1) {
+                                    this.courseList.splice(originIndex, 1)
+                                }
+
+                                // 删除列表数据
                                 let index = this.curCusIndex
                                 this.curCusIndex = 0
                                 this.courseListShow.splice(index, 1)

+ 12 - 10
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -1303,17 +1303,19 @@ export default {
         })
     },
     created() {
-        this.$store.dispatch('user/getSchoolProfile').then(
-            (res) => {
-                if (res) {
-                    this.schoolBase = res.school_base
-                    if (this.schoolBase.period.length) this.filterPeriod = this.schoolBase.period[0].id
+        if (this.$store.state.userInfo.hasSchool) {
+            this.$store.dispatch('user/getSchoolProfile').then(
+                (res) => {
+                    if (res) {
+                        this.schoolBase = res.school_base
+                        if (this.schoolBase && this.schoolBase.period && this.schoolBase.period.length) this.filterPeriod = this.schoolBase.period[0].id
+                    }
+                },
+                (err) => {
+                    this.$Message.error('API error!')
                 }
-            },
-            (err) => {
-                this.$Message.error('API error!')
-            }
-        )
+            )
+        }
         Date.prototype.toLocaleString = function () {
             return this.getFullYear() + '/' + (this.getMonth() + 1) + '/' + this.getDate()
         }