chao 1 år sedan
förälder
incheckning
39498b74d8

+ 0 - 1
dist/assets/Details-REEnO_H7.js

@@ -1 +0,0 @@
-import{u as m,r as i,o as p,a as r,b as a,c as t,w as o,d as c,e as u,t as b,f,g as h,C as v,h as k,P as y,i as g,j as C}from"./index-lC4xi-VP.js";const x={class:"iframDiv"},w={__name:"Details",setup(N){const{query:n,params:s}=m();console.log(n,s);const e=i("");return p(()=>{e.value=s.title}),(V,B)=>{const l=r("el-breadcrumb-item"),_=r("el-breadcrumb"),d=r("el-page-header");return a(),t(d,null,{breadcrumb:o(()=>[c(_,{separator:"/"},{default:o(()=>[c(l,{to:{path:"/"}},{default:o(()=>[u(" 首页 ")]),_:1}),c(l,null,{default:o(()=>[u(b(f(s).title),1)]),_:1})]),_:1})]),default:o(()=>[h("div",x,[e.value=="课程列表"?(a(),t(v,{key:0})):e.value=="资源中心"?(a(),t(k,{key:1})):e.value=="实践中心"?(a(),t(y,{key:2})):e.value=="其他课程资源"?(a(),t(g,{key:3})):C("",!0)])]),_:1})}}};export{w as default};

+ 1 - 0
dist/assets/Details-YY2PlziF.js

@@ -0,0 +1 @@
+import{u as m,r as i,o as p,a as l,b as a,c as b,d as t,w as s,F as f,H as h,e as n,t as k,f as v,g,h as r,i as y,C,j as x,P as B,k as N}from"./index-SfdkMMjM.js";const V={class:"iframDiv"},P={__name:"Details",setup(D){const{query:u,params:o}=m();console.log(u,o);const e=i("");return p(()=>{e.value=o.title}),(w,F)=>{const c=l("el-breadcrumb-item"),_=l("el-breadcrumb"),d=l("el-page-header");return a(),b(f,null,[t(h),t(d,null,{breadcrumb:s(()=>[t(_,{separator:"/"},{default:s(()=>[t(c,{to:{path:"/"}},{default:s(()=>[n(" 首页 ")]),_:1}),t(c,null,{default:s(()=>[n(k(v(o).title),1)]),_:1})]),_:1})]),default:s(()=>[g("div",V,[e.value=="课程列表"?(a(),r(C,{key:0})):e.value=="资源中心"?(a(),r(x,{key:1})):e.value=="实践中心"?(a(),r(B,{key:2})):e.value=="其他课程资源"?(a(),r(N,{key:3})):y("",!0)])]),_:1})],64)}}};export{P as default};

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/assets/admin-mac4OOXE.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/assets/index-SfdkMMjM.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/assets/index-eY5uiTid.css


+ 2 - 2
dist/index.html

@@ -8,8 +8,8 @@
     <script>
       document.domain = "cocorobo.cn"
     </script>
-    <script type="module" crossorigin src="./assets/index-lC4xi-VP.js"></script>
-    <link rel="stylesheet" crossorigin href="./assets/index-VWnmQOXB.css">
+    <script type="module" crossorigin src="./assets/index-SfdkMMjM.js"></script>
+    <link rel="stylesheet" crossorigin href="./assets/index-eY5uiTid.css">
   </head>
   <body>
     <div id="app"></div>

+ 20 - 23
src/App.vue

@@ -11,7 +11,7 @@ const route = useRoute()
 const store = userInfoStore()
 const CurrentRole = userCurrentRole()
 const name = ref('')
-const isShow = ref(false)
+const isShow = ref(true)
 onMounted(() => {
   // 通过 grant_code 获取登录信息
   let isGrantCode = getUrlParam(window.parent.location.href, 'grant_code')
@@ -23,18 +23,21 @@ onMounted(() => {
     }
     axios.post('//cloud.cocorobo.cn/api/getAccessToken', JSON.stringify(params)).then(res => {
       // console.log(res)
-      let accessTokenParams = {
-        accessToken: res.data.data.accessToken
-      }
-      axios.post('//cloud.cocorobo.cn/api/getUserInfo', JSON.stringify(accessTokenParams)).then(r => {
-        // console.log(r, r.data.code, r.data.data)
-        if (r.data.code == 0) {
-          // store.user = r.data.data
-          name.value = r.data.data.userName
-          userInfo(r.data.data)
-        } else {
+      if (res.data.code == 0) {
+        let accessTokenParams = {
+          accessToken: res.data.data.accessToken
         }
-      })
+        axios.post('//cloud.cocorobo.cn/api/getUserInfo', JSON.stringify(accessTokenParams)).then(r => {
+          // console.log(r, r.data.code, r.data.data)
+          if (r.data.code == 0) {
+            // store.user = r.data.data
+            name.value = r.data.data.userName
+            userInfo(r.data.data)
+          }
+        })
+      } else {
+        linkLogin()
+      }
     })
   } else {
     linkLogin()
@@ -60,10 +63,10 @@ const userInfo = (data) => {
   // parentagency - 家长代办
 
   let userIdentity = 1
-  if (data.currentRole == "edupersonnel" ||data.currentRole == "areaAdministrator" || data.currentRole == "userAdministrator" || data.currentRole == "securityAuditor" || data.currentRole == "schoolAdministrator" || data.currentRole == "schoolSecurityAuditor" || data.currentRole == "teacher") {
+  if (data.currentRole == "edupersonnel" || data.currentRole == "areaAdministrator" || data.currentRole == "userAdministrator" || data.currentRole == "securityAuditor" || data.currentRole == "schoolAdministrator" || data.currentRole == "schoolSecurityAuditor" || data.currentRole == "teacher") {
     isShow.value = true
     CurrentRole.currentRole == data.currentRole
-    userIdentity = 0
+    userIdentity = 1
     let userGrand = ""
     if (data.childList && data.childList.length > 0) {
       userGrand = data.childList[0].gradeName + data.childList[0].className
@@ -76,20 +79,14 @@ const userInfo = (data) => {
     axios.defaults.withCredentials = true;
     axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(res => {
       // console.log(res, '222222222222')
-
       if (res.data && res.data[0][0].active == 1) {
-        let obj = res.data[0][0]
-        obj.userName = name
-        store.user = obj
+        store.user = US.userInfo
       } else {
         if (data.telephoneNumber) {
           top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg", [data.userName, data.telephoneNumber + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.schoolName, data.telephoneNumber, userGrand, userIdentity, data.userId], function (r) {
             // console.log('rrrrr', r)
             axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
-              let obj = d.data[0][0]
-              obj.userName = name
-              store.user = obj
-
+              store.user = US.userInfo
             })
           }, [], { "type": "POST", "withCredentials": true });
         } else {
@@ -144,7 +141,7 @@ const getUrlParam = (urlStr, urlKey) => {
 
 <template>
   <!-- <keep-alive> -->
-  <div v-if="isShow">
+  <div v-if="isShow" style="height: 100%;">
     <router-view></router-view>
   </div>
   <!-- </keep-alive> -->

+ 7 - 6
src/components/header/headerRight.vue

@@ -6,7 +6,8 @@
         <div v-if="isLogin" class="loginAdmin">
             <div v-if="admin">
                 <img src="" alt="">
-                <router-link to="/admin"><span>管理后台</span></router-link>
+                <!-- <span>管理后台</span> -->
+                <router-link to="" @click="adminClick()"><span>管理后台</span></router-link>
             </div>
             <div>
                 <img src="" alt="">
@@ -44,12 +45,12 @@ const linkLogin = () => {
     top.location.href = `http://szedutest.changyan.cn/thirdauth/oauth2/authorize?service=initService&scope=all&response_type=code&app_id=94c720f0634b4bad890dc9223de01166&redirect_uri=https://cloud.cocorobo.cn/testapi`
 }
 
-const studentLogin = () => {
-    console.log('学生登录')
+const adminClick = () => {
+    console.log('admin')
+    top.U.MD.D.I.openApplication('evaluate') 
 }
 
 const goBack=()=>{
-    
     top.location.href = "https://zy.szedu.cn/ai/"
 }
 
@@ -57,8 +58,8 @@ watchEffect(() => {
     // console.log(user, 2222222222)
     if (JSON.stringify(user.user) != "{}") {
         isLogin.value = true
-        userName.value = user.user.userName
-        if (CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
+        userName.value = user.user.username
+        if (CurrentRole.currentRole == "edupersonnel" || CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
             admin.value = true
         }
     }

+ 3 - 3
src/components/main/courseSelect.vue

@@ -277,8 +277,8 @@ const getImageUrl = (url) => {
 }
 
 const openCourseDetail = (id) => {
-  console.log(user.user.identity)
-  top.U.MD.D.I.openInApplication("studyDetail", id, 2, user.user.identity); //这个是打开指定的课程接口
+  console.log(user.user.type)
+  top.U.MD.D.I.openInApplication("studyDetail", id, 2, user.user.type); //这个是打开指定的课程接口
 }
 const updateCourse = id => {
   top.U.MD.D.I.openInApplication('openCourseUpdate', id)
@@ -295,7 +295,7 @@ const updateReduction = () => {
 
 watchEffect(() => {
   if (JSON.stringify(user.user) != "{}") {
-    if (CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
+    if (CurrentRole.currentRole == "edupersonnel" || CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
       isupdateCourse.value = true
     }
   }

+ 1 - 0
src/components/main/other.vue

@@ -42,6 +42,7 @@ onMounted(() => {
 })
 
 const openApplication = (type) => {
+  console.log(type,Identity)
   if(type == "study"){
     if(Identity.value == 1){
       top.U.MD.D.I.openApplication('studentStudy')

+ 2 - 0
src/views/Details.vue

@@ -1,4 +1,5 @@
 <template>
+    <Header></Header>
     <el-page-header>
         <template #breadcrumb>
             <el-breadcrumb separator="/">
@@ -23,6 +24,7 @@ import CourseSelect from '@/components/main/courseSelect.vue'
 import resource from '@/components/main/resource.vue';
 import Practice from '@/components/main/Practice.vue';
 import other from '@/components/main/other.vue';
+import Header from './header.vue';
 import { useRoute } from 'vue-router';  //1.先在需要跳转的页面引入useRouter
 const { query, params } = useRoute()
 console.log(query, params)

+ 2 - 0
src/views/iframeRoute.vue

@@ -1,4 +1,5 @@
 <template>
+    <Header></Header>
     <el-page-header>
         <template #breadcrumb>
             <el-breadcrumb separator="/">
@@ -20,6 +21,7 @@
 import { ref, onMounted } from 'vue';
 import { useRoute } from 'vue-router';  //1.先在需要跳转的页面引入useRouter
 import main from './main.vue';
+import Header from './header.vue';
 const { query, params } = useRoute()
 
 const iframeList = [

+ 1 - 1
src/views/main.vue

@@ -31,7 +31,7 @@ watchEffect(() => {
   // console.log('111111111111',CurrentRole, user.user)
   if (JSON.stringify(user.user) != "{}") {
     isLogin.value = true
-    if (CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
+    if (CurrentRole.currentRole == "edupersonnel" || CurrentRole.currentRole == "areaAdministrator" || CurrentRole.currentRole == "userAdministrator" || CurrentRole.currentRole == "securityAuditor" || CurrentRole.currentRole == "schoolAdministrator" || CurrentRole.currentRole == "schoolSecurityAuditor" || CurrentRole.currentRole == "teacher" || user.user.identity != 1) {
       isupdateCourse.value = true
     }
   }

Vissa filer visades inte eftersom för många filer har ändrats