Browse Source

更新参数

lex-xin 3 years ago
parent
commit
beb77c79b3
3 changed files with 19 additions and 7 deletions
  1. 7 5
      src/App.vue
  2. 10 0
      src/api/app.js
  3. 2 2
      src/views/visitManager/visitList.vue

+ 7 - 5
src/App.vue

@@ -12,7 +12,7 @@
 </template>
 
 <script>
-import { queryUserInfo } from "@/api/app";
+import { queryTeacherInfo } from "@/api/app";
 export default {
   name: "app",
   async created() {
@@ -24,20 +24,22 @@ export default {
       } else {
         Authorization = decodeURI(Authorization)
       }
-      if (Authorization) {
+      if (Authorization && Authorization != 'null') {
         localStorage.setItem("Authorization", Authorization);
         localStorage.setItem("userInfo", Authorization);
       }
       const auth = localStorage.getItem("Authorization");
       const userInfo = localStorage.getItem("userInfo");
       if (userInfo || auth) {
-        await queryUserInfo().then((res) => {
+        await queryTeacherInfo().then((res) => {
           const result = res.data || null;
-          const tenantId = result.tenantId || 0;
+          const tenantId = result.data.tenantId || 0;
           sessionStorage.setItem("tenantId", tenantId);
         });
       }
-    } catch(e) {}
+    } catch(e) {
+      console.log(e)
+    }
   },
   async mounted() {
     if(document.querySelector('#m_loading')) {

+ 10 - 0
src/api/app.js

@@ -191,6 +191,15 @@ const queryUserInfo = (data) => {
   })
 }
 
+// 获取用户基本信息
+const queryTeacherInfo = (data) => {
+  return axios({
+    url: api + '/teacher/queryUserInfo',
+    method: 'get',
+    params: data
+  })
+}
+
 // 获取老师评价和学生评价
 const getStuAndTeaReview = (data) => {
   return axios({
@@ -228,6 +237,7 @@ export {
   teacherCourseMinutes,
   tenantEntryActivitesList,
   queryUserInfo,
+  queryTeacherInfo,
   createOrder,
   queryByOrderNo,
   queryByOrderNoAuth,

+ 2 - 2
src/views/visitManager/visitList.vue

@@ -214,8 +214,8 @@ export default {
       params.type = this.value1 == "全部" ? null : this.value1;
       params.purpose = this.value2 == "全部" ? null : this.value2;
       if(this.formatStartTime && this.formatEndTime) {
-        params.startTime = dayjs(this.formatStartTime).format("YYYY-MM-DD")
-        params.endTime = dayjs(this.formatEndTime).format("YYYY-MM-DD")
+        params.startTime = dayjs(new Date(this.formatStartTime)).format("YYYY-MM-DD")
+        params.endTime = dayjs(new Date(this.formatEndTime)).format("YYYY-MM-DD")
       } else {
         params.startTime = null
         params.endTime = null