lsc 1 year ago
parent
commit
72e02b434a

+ 22 - 0
dist/cocoai.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>CocoAI</title>
+    <style>
+        *{
+            margin: 0;
+            padding: 0;
+        }
+        body,html{
+            height: 100%;
+            width: 100%;
+            overflow: hidden;
+        }
+    </style>
+</head>
+<body>
+    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" src="https://cloud.cocorobo.cn/#/cocoai" frameborder="0" style="width: 100%;height: 100%;box-sizing: border-box;"></iframe>
+</body>
+</html>

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 1 - 1
dist/report.html


+ 1 - 0
dist/static/css/chunk-3f221275.a423aeaf.css

@@ -0,0 +1 @@
+.loginBox[data-v-66aac3e8]{position:relative;width:100vw;height:100vh;overflow:hidden}.loginBox>iframe[data-v-66aac3e8]{width:100%;height:100%;border:0}

+ 0 - 0
dist/static/css/chunk-7d027967.7f5e6538.css → dist/static/css/chunk-4548fd47.7f5e6538.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.7dca3f4c.js


+ 1 - 0
dist/static/js/chunk-3f221275.85febc54.js

@@ -0,0 +1 @@
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3f221275"],{"2fe9":function(e,t,r){"use strict";var i=r("35d8"),o=r.n(i);o.a},"35d8":function(e,t,r){},"89ef":function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"loginBox"},[r("iframe",{attrs:{allow:"camera *; microphone *;display-capture;midi;encrypted-media;",src:e.iframe,frameborder:"0"}})])},o=[],c=(r("99af"),r("5530")),n=r("2f62"),a={data:function(){return{redirect:void 0,timer:null,iframe:"https://cloud.cocorobo.cn/aigpt/"}},computed:Object(c["a"])({},Object(n["c"])(["userinfo"])),watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:{},beforeDestroy:function(){clearInterval(this.timer),this.timer=null},mounted:function(){this.iframe="https://cloud.cocorobo.cn/aigpt/?userid=".concat(this.userinfo.userid,"&oid=").concat(this.userinfo.organizeid,"&org=").concat(this.userinfo.org,"&role=").concat(this.userinfo.role)}},s=a,u=(r("2fe9"),r("2877")),d=Object(u["a"])(s,i,o,!1,null,"66aac3e8",null);t["default"]=d.exports}}]);

+ 1 - 1
dist/static/js/chunk-7d027967.7d60579c.js → dist/static/js/chunk-4548fd47.fde750ba.js

@@ -1 +1 @@
-(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d027967"],{"6605e":function(e,t,r){},"9ed6":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"loginBox"},[r("iframe",{attrs:{src:"//edu.cocorobo.cn/course/login?type=2",frameborder:"0"}})])}],c=(r("96cf"),r("1da1")),o=r("5530"),u=r("2f62"),a={data:function(){return{redirect:void 0,timer:null}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:Object(o["a"])(Object(o["a"])({},Object(u["b"])({login:"user/login"})),{},{handleLogin:function(){this.$router.push({path:this.redirect||"/"})},getLogin:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.login();case 2:r=t.sent,r&&e.$router.push({path:e.redirect||"/"});case 4:case"end":return t.stop()}}),t)})))()}}),beforeDestroy:function(){clearInterval(this.timer),this.timer=null},mounted:function(){var e=this;this.getLogin(),this.timer=setInterval((function(){e.getLogin()}),2e3)}},s=a,l=(r("b792"),r("2877")),d=Object(l["a"])(s,n,i,!1,null,"4dc8186e",null);t["default"]=d.exports},b792:function(e,t,r){"use strict";var n=r("6605e"),i=r.n(n);i.a}}]);
+(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4548fd47"],{"6605e":function(e,t,r){},"9ed6":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"loginBox"},[r("iframe",{attrs:{src:"//edu.cocorobo.cn/course/login?type=2",frameborder:"0"}})])}],c=(r("96cf"),r("1da1")),o=r("5530"),u=r("2f62"),a={data:function(){return{redirect:void 0,timer:null}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},methods:Object(o["a"])(Object(o["a"])({},Object(u["b"])({login:"user/login"})),{},{handleLogin:function(){this.$router.push({path:this.redirect||"/"})},getLogin:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.login();case 2:r=t.sent,r&&e.$router.push({path:e.redirect||"/"});case 4:case"end":return t.stop()}}),t)})))()}}),beforeDestroy:function(){clearInterval(this.timer),this.timer=null},mounted:function(){var e=this;this.getLogin(),this.timer=setInterval((function(){e.getLogin()}),2e3)}},s=a,l=(r("b792"),r("2877")),d=Object(l["a"])(s,n,i,!1,null,"4dc8186e",null);t["default"]=d.exports},b792:function(e,t,r){"use strict";var n=r("6605e"),i=r.n(n);i.a}}]);

+ 22 - 0
public/cocoai.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>CocoAI</title>
+    <style>
+        *{
+            margin: 0;
+            padding: 0;
+        }
+        body,html{
+            height: 100%;
+            width: 100%;
+            overflow: hidden;
+        }
+    </style>
+</head>
+<body>
+    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" src="https://cloud.cocorobo.cn/#/cocoai" frameborder="0" style="width: 100%;height: 100%;box-sizing: border-box;"></iframe>
+</body>
+</html>

+ 64 - 61
src/router/router.config.js

@@ -2,65 +2,68 @@
  * 基础路由
  * @type { *[] }
  */
-export const constantRouterMap = [{
-        path: '/',
-        redirect: '/home'
-    },
-    {
-        path: '/login',
-        component: () =>
-            import ('@/views/login/index'),
-        meta: {
-            title: '登录',
-            keepAlive: false
-        }
-    },
-    {
-        path: '/course',
-        component: () =>
-            import ('@/views/course/index'),
-        meta: {
-            title: '课程',
-            keepAlive: false
-        }
-    },
-    {
-        path: '/',
-        component: () =>
-            import ('@/views/layouts'),
-        meta: { title: '课程中心', keepAlive: false },
-        children: [{
-                path: 'home',
-                name: 'home',
-                component: () =>
-                    import ('@/views/home/index'),
-                meta: { title: '课程中心', keepAlive: false }
-            },
-            {
-                path: 'test',
-                name: 'Test',
-                component: () =>
-                    import ('@/views/test/index'),
-                meta: { title: '评测中心', keepAlive: false }
-            }
-        ]
-    },
-    {
-        path: '/courseDetail',
-        component: () =>
-            import ('@/views/courseDetail/index'),
-        meta: {
-            title: '课程详情',
-            keepAlive: false
-        }
-    },
-    {
-        path: '/testDetail',
-        component: () =>
-            import ('@/views/testDetail/index'),
-        meta: {
-            title: '填写问卷',
-            keepAlive: false
-        }
+export const constantRouterMap = [
+  {
+    path: '/',
+    redirect: '/home'
+  },
+  {
+    path: '/login',
+    component: () => import('@/views/login/index'),
+    meta: {
+      title: '登录',
+      keepAlive: false
     }
-]
+  },
+  {
+    path: '/course',
+    component: () => import('@/views/course/index'),
+    meta: {
+      title: '课程',
+      keepAlive: false
+    }
+  },
+  {
+    path: '/',
+    component: () => import('@/views/layouts'),
+    meta: { title: '课程中心', keepAlive: false },
+    children: [
+      {
+        path: 'home',
+        name: 'home',
+        component: () => import('@/views/home/index'),
+        meta: { title: '课程中心', keepAlive: false }
+      },
+      {
+        path: 'test',
+        name: 'Test',
+        component: () => import('@/views/test/index'),
+        meta: { title: '评测中心', keepAlive: false }
+      }
+    ]
+  },
+  {
+    path: '/courseDetail',
+    component: () => import('@/views/courseDetail/index'),
+    meta: {
+      title: '课程详情',
+      keepAlive: false
+    }
+  },
+  {
+    path: '/testDetail',
+    component: () => import('@/views/testDetail/index'),
+    meta: {
+      title: '填写问卷',
+      keepAlive: false
+    }
+  },
+  {
+    path: '/cocoai',
+    component: () => import('@/views/aigpt/index'),
+    meta: {
+      title: 'CocoAI',
+      keepAlive: false
+    }
+  }
+]

+ 72 - 0
src/views/aigpt/index.vue

@@ -0,0 +1,72 @@
+<template>
+  <div class="loginBox">
+    <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="iframe" frameborder="0"></iframe>
+    <!-- <button @click="handleLogin">登录</button> -->
+  </div>
+</template>
+
+<script>
+// import { mapActions } from 'vuex'
+import { mapGetters } from 'vuex'
+export default {
+  data() {
+    return {
+      redirect: undefined,
+      timer: null,
+      iframe: 'https://cloud.cocorobo.cn/aigpt/'
+    }
+  },
+  computed: {
+    ...mapGetters(['userinfo'])
+  },
+  watch: {
+    $route: {
+      handler: function(route) {
+        this.redirect = route.query && route.query.redirect
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    // ...mapActions({
+    //   login: 'user/login'
+    // }),
+    // handleLogin() {
+    //   this.$router.push({ path: this.redirect || '/' })
+    // },
+    // async getLogin() {
+    //   const userid = await this.login()
+    //   if (userid) {
+    //     this.$router.push({ path: this.redirect || '/' })
+    //   }
+    //   // eduGet().then(res => {})
+    // }
+  },
+  beforeDestroy() {
+    clearInterval(this.timer)
+    this.timer = null
+  },
+  mounted() {
+    // this.getLogin()
+    // this.timer = setInterval(() => {
+    //   this.getLogin()
+    // }, 2000)
+    this.iframe = `https://cloud.cocorobo.cn/aigpt/?userid=${this.userinfo.userid}&oid=${this.userinfo.organizeid}&org=${this.userinfo.org}&role=${this.userinfo.role}`
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.loginBox {
+  position: relative;
+  width: 100vw;
+  height: 100vh;
+  overflow: hidden;
+
+  > iframe {
+    width: 100%;
+    height: 100%;
+    border: 0;
+  }
+}
+</style>

Some files were not shown because too many files changed in this diff