Browse Source

Merge branch 'feat/loginDiversion' into louise

osbert 3 years ago
parent
commit
f179f358a3
41 changed files with 1045 additions and 261 deletions
  1. 2 1
      HiTeachCC/ClientApp/package.json
  2. 1 1
      HiTeachCC/ClientApp/public/index.html
  3. 131 0
      HiTeachCC/ClientApp/src/api/coreApi.js
  4. 17 0
      HiTeachCC/ClientApp/src/api/ies5Api.js
  5. 35 34
      HiTeachCC/ClientApp/src/api/index.js
  6. 3 2
      HiTeachCC/ClientApp/src/assets/css/style.css
  7. 115 10
      HiTeachCC/ClientApp/src/assets/css/style.less
  8. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_cn.svg
  9. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_cn_sel.svg
  10. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_en.svg
  11. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_en_sel.svg
  12. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_tw.svg
  13. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/lang_tw_sel.svg
  14. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/pw_enter.svg
  15. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/pw_invisibility.svg
  16. 1 0
      HiTeachCC/ClientApp/src/assets/icons/svg/pw_visibility.svg
  17. BIN
      HiTeachCC/ClientApp/src/assets/img/login/APivHm7.jpeg
  18. BIN
      HiTeachCC/ClientApp/src/assets/img/login/MUJI03.jpg
  19. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/auth_dingtalk.svg
  20. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/auth_facebook.svg
  21. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/auth_google.svg
  22. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/auth_wechat.svg
  23. BIN
      HiTeachCC/ClientApp/src/assets/img/login/bg_alpha.png
  24. BIN
      HiTeachCC/ClientApp/src/assets/img/login/bg_default.png
  25. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/hbk_tmd.svg
  26. 1 0
      HiTeachCC/ClientApp/src/assets/img/login/htc_cc.svg
  27. BIN
      HiTeachCC/ClientApp/src/assets/img/login/qrcodeImg.png
  28. BIN
      HiTeachCC/ClientApp/src/assets/img/login/title_cn.png
  29. BIN
      HiTeachCC/ClientApp/src/assets/img/login/title_tw_en.png
  30. 19 10
      HiTeachCC/ClientApp/src/components/Common/CommonFooter.vue
  31. 50 43
      HiTeachCC/ClientApp/src/components/Common/CommonHeader.vue
  32. 6 3
      HiTeachCC/ClientApp/src/filter/http.js
  33. 19 2
      HiTeachCC/ClientApp/src/locale/lang/en-US/index.js
  34. 19 2
      HiTeachCC/ClientApp/src/locale/lang/zh-CN/index.js
  35. 19 2
      HiTeachCC/ClientApp/src/locale/lang/zh-TW/index.js
  36. 2 0
      HiTeachCC/ClientApp/src/main.js
  37. 111 0
      HiTeachCC/ClientApp/src/utils/jsFn.js
  38. 53 0
      HiTeachCC/ClientApp/src/utils/profile.js
  39. 4 2
      HiTeachCC/ClientApp/src/views/Board.vue
  40. 410 140
      HiTeachCC/ClientApp/src/views/Login.vue
  41. 14 9
      HiTeachCC/ClientApp/src/views/SvgIcon.vue

+ 2 - 1
HiTeachCC/ClientApp/package.json

@@ -22,6 +22,7 @@
     "bcryptjs": "^2.4.3",
     "core-js": "^3.4.0",
     "echarts": "^4.4.0",
+    "event-source-polyfill": "^1.0.25",
     "html2canvas": "^1.0.0-rc.7",
     "iview": "^3.5.3",
     "jwt-decode": "^2.2.0",
@@ -30,7 +31,7 @@
     "mqtt": "^3.0.0",
     "paper": "^0.12.3",
     "pdfjs-dist": "^2.3.200",
-    "qrcodejs2": "0.0.2",
+    "qr-code-styling": "^1.6.0-rc.1",
     "quasar": "^1.3.0",
     "raziel-flex": "^1.0.4",
     "screenfull": "^5.0.0",

+ 1 - 1
HiTeachCC/ClientApp/public/index.html

@@ -7,7 +7,7 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title>hiteachcloud</title>
     <script type="text/javascript" id="MathJax-script" async
-            src="http://lib.baomitu.com/mathjax/3.1.2/es5/tex-mml-svg.min.js">
+            src="https://lib.baomitu.com/mathjax/3.1.2/es5/tex-mml-svg.min.js">
         window.MathJax.Hub.Config({
             tex2jax: {
                 inlineMath: [["$", "$"], ["\\(", "\\)"]],

+ 131 - 0
HiTeachCC/ClientApp/src/api/coreApi.js

@@ -0,0 +1,131 @@
+import { post } from '@/filter/http'
+import { jsFn } from '@/utils/jsFn'
+import profile from '@/utils/profile'
+const serverLocation = jsFn.isCN() ? 'cn' : 'global'
+var clientID = profile.clientID[serverLocation]
+var apiUrl = profile.apiUrl[serverLocation]
+export default {
+    // 取得快速登入CODE
+    getCode: function(idToken, isTicket) {
+        return new Promise((resolve, reject) => {
+            let nonceStr = jsFn.getUUID()
+            let type = isTicket ? 'ticket' : 'code'
+            let data = {
+                grant_type: type,
+                client_id: clientID,
+                nonce: nonceStr,
+                id_token: idToken
+            }
+            post(apiUrl + '/oauth2/login', data).then(res => {
+                if (res.error) {
+                    reject(new Error(res))
+                } else {
+                    resolve(res[type])
+                }
+            }, err => {
+                reject(err)
+            })
+        })
+    },
+    // 登入驗證
+    login: function(item) {
+        return new Promise((resolve, reject) => {
+            let nonceStr = jsFn.getUUID()
+            // 開頭有0要去0
+            let re = /^[0-9]+$/
+            if (re.test(item.id) && item.id.toString().indexOf(0) === 0) {
+                item.id = item.id.substr(1)
+            }
+            let data = {
+                client_id: clientID,
+                grant_type: 'account',
+                account: item.id,
+                password: item.pass,
+                nonce: nonceStr
+            }
+            post(apiUrl + '/oauth2/login', data).then(res => {
+                if (res.error) {
+                    reject(new Error(res))
+                } else {
+                    let tData = jsFn.jwtDecode(res.id_token)
+                    if (nonceStr === tData.nonce) {
+                        resolve(res)
+                    } else {
+                        let result = {
+                            error: 10001,
+                            message: '錯誤登入'
+                        }
+                        reject(result)
+                    }
+                }
+            }, err => {
+                reject(err)
+            })
+        })
+    },
+    // 社群登入
+    authLogin: function(idToken, item) {
+        return new Promise((resolve, reject) => {
+            let nonceStr = jsFn.getUUID()
+            let data = {
+                client_id: clientID,
+                nonce: nonceStr,
+                grant_type: item.grant_type,
+                open_code: item.open_code,
+                redirect_uri: item.redirect_uri
+            }
+            if (!jsFn.isEmpty(idToken)) data.id_token = idToken
+            post(apiUrl + '/oauth2/login', data).then(res => {
+                if (res.error) {
+                    reject(new Error(res))
+                } else {
+                    let tData = jsFn.jwtDecode(res.id_token)
+                    if (nonceStr === tData.nonce) {
+                        resolve(res)
+                    } else {
+                        let result = {
+                            error: 10001,
+                            message: '錯誤登入'
+                        }
+                        reject(result)
+                    }
+                }
+            }, err => {
+                reject(err)
+            })
+        })
+    },
+    // 快速登入
+    codeLogin: function(code) {
+        return new Promise((resolve, reject) => {
+            if (!jsFn.isEmpty(sessionStorage.getItem('clientId'))) { clientID = sessionStorage.getItem('clientId') }
+            let data = {
+                client_id: clientID,
+                grant_type: 'authorization_code',
+                code: code
+            }
+            post(apiUrl + '/oauth2/token', data).then(res => {
+                if (res.error) {
+                    reject(res)
+                } else {
+                    resolve(res)
+                }
+            }, err => {
+                reject(err)
+            })
+        })
+    },
+    logout: function(data) {
+        return new Promise((resolve, reject) => {
+            post(apiUrl + '/oauth2/logout', data).then(res => {
+                if (res.error) {
+                    reject(res)
+                } else {
+                    resolve(true)
+                }
+            }, err => {
+                reject(err)
+            })
+        })
+    }
+}

+ 17 - 0
HiTeachCC/ClientApp/src/api/ies5Api.js

@@ -0,0 +1,17 @@
+import { post } from '@/filter/http'
+import { jsFn } from '@/utils/jsFn'
+import profile from '@/utils/profile'
+const serverLocation = jsFn.isCN() ? 'cn' : 'global'
+var apiUrl = profile.ies5Api[serverLocation]
+export default {
+    // 取得快速登入CODE
+    getUserBlob: function() {
+        return new Promise((resolve, reject) => {
+            post(apiUrl + '/hiteachcc/get-teacher-info').then(res => {
+                resolve(res)
+            }, err => {
+                reject(err)
+            })
+        })
+    }
+}

+ 35 - 34
HiTeachCC/ClientApp/src/api/index.js

@@ -1,4 +1,6 @@
 import { fetch, post } from '@/filter/http'
+import coreApi from './coreApi'
+import ies5Api from './ies5Api'
 export default {
   //TW获取token
   getLoginInfo: function (data) {
@@ -22,43 +24,42 @@ export default {
   //上传文件
   uploadBase64: function (data) {
       return post('/common/import/upload-base64', data);
-    },
+  },
   //获取上传blob后文件
-    getIdtoken: function (data) {
-        return post('/common/login/tmd-login',data)
-    },
-    //传输blob的URL,得到解析
-    FileAnalysis: function (data) {
-        return post('/common/import/parse-doc',data)
-    },
+  getIdtoken: function (data) {
+      return post('/common/login/tmd-login',data)
+  },
+  //传输blob的URL,得到解析
+  FileAnalysis: function (data) {
+      return post('/common/import/parse-doc',data)
+  },
   //获取连接访问JSON
-    fileJson: function (url) {
-        return fetch(url)
-    },
+  fileJson: function (url) {
+      return fetch(url)
+  },
   //IM相关
-    //根据用户信息创建教室
-    createapi: function (data) {
-        return post('https://api2.teammodel.cn/channel/create',data)
-    },
-    //加入教室
-    joinclass: function (data) {
-        return post('https://api2.teammodel.cn/channel/join',data)
-    },
-    //发送消息
-    tomessage: function (url,data) {
-        return post(url,data)
-    },
+  //根据用户信息创建教室
+  createapi: function (data) {
+      return post('https://api2.teammodel.cn/channel/create',data)
+  },
+  //加入教室
+  joinclass: function (data) {
+      return post('https://api2.teammodel.cn/channel/join',data)
+  },
+  //发送消息
+  tomessage: function (url,data) {
+      return post(url,data)
+  },
 
 
-    //OAuth整合ID
-    authorize: function (data) {
-        return post('https://api2.teammodel.cn/oauth2/token',data)
-    },
-    //blobauth
-    blobauthFile: function () {
-        return post('/common/login/blob-auth')
-    }
+  //OAuth整合ID
+  authorize: function (data) {
+      return post('https://api2.teammodel.cn/oauth2/token',data)
+  },
+  //blobauth
+  blobauthFile: function () {
+      return post('/common/login/blob-auth')
+  },
+  coreApi,
+  ies5Api
 }
-
-
-

+ 3 - 2
HiTeachCC/ClientApp/src/assets/css/style.css

@@ -1,5 +1,6 @@
 .head > .logo {
-  font-size: 20px;
+  width: 210px;
+  /* font-size: 20px; */
   line-height: 2.5rem;
 }
 .footer {
@@ -25,7 +26,7 @@
   position: fixed;
   width: 100%;
   height: 100%;
-  background: url('../img/loginBg1.jpg') no-repeat 0 0;
+  background: url('../img/login/bg_default.png') no-repeat 0 0;
   background-size: 100% 100%;
 }
 .login-box {

+ 115 - 10
HiTeachCC/ClientApp/src/assets/css/style.less

@@ -2,10 +2,24 @@
 //common
 .head {
   > .logo {
-    font-size: 20px;
+    width: 210px;
+    // font-size: 20px;
     //font-weight: bold;
     line-height: 2.5rem;
   }
+  .langBtns {
+    height: 32px;
+    display: flex;
+    width: 130px;
+    justify-content: space-around;
+    align-items: center;
+    li {
+      display: flex;align-content: center;justify-content: center;cursor: pointer;
+      .icon{
+        width: 25px;height:25px;
+      }
+    }
+  }
 }
 
 .footer {
@@ -32,21 +46,112 @@
   position: fixed;
   width: 100%;
   height: 100%;
-  background: url('../img/loginBg1.jpg') no-repeat 0 0;
+  // background: url('../img/login/bg_default.png') no-repeat 0 0;
   background-size: 100% 100%;
+  transition: all 1s;
 }
 
 //login
 .login-box {
-  position: fixed;
-  top: 47%;
-  left: 50%;
-  margin: -300px 0 0 -300px;
-  //transform: translate(-50%, -50%);
-  width: 600px;
-  min-height: 600px;
   padding: 50px 30px 80px;
-  border-radius: 5px;
+  display: flex;
+  width: 50%;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  height: 100%;
+  justify-content: center;
+  &-cont{
+    width: 100%;
+    max-width: 680px;
+    text-align: left;
+    .titleImg {
+      width: 100%;
+      display: block;
+      margin-bottom: 50px;
+    }
+    .subTitle{
+      padding-left:20px;
+    }
+    .loginLayer{
+      width: 100%;
+      display: flex;
+      align-content: center;
+      align-items: center;
+      .formDiv{
+        display: flex;
+        flex-direction: column;
+        align-items: flex-start;
+        padding-left: 20px;
+        width: 60%;
+      }
+      .line{
+        height: 70px;
+        border: 1px solid #ebebeb;
+        margin: 0 2% 0 4%;
+      }
+      .qrcodeDiv {
+        display: -webkit-flex;
+        display: flex;
+        -webkit-align-items: center;
+        align-items: center;
+        -webkit-justify-content: center;
+        justify-content: center;
+        .qrcode canvas{
+          border-radius: 10px;
+        }
+        .expired{
+          position: absolute;
+          background-color: #ffffffde;
+          width: 120px;
+          height: 120px;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          .ivu-icon{
+            cursor: pointer;
+          }
+        }
+      }
+    }
+    .authLayer {
+      padding-left: 20px;
+      .link {
+        font-size: 12px;
+        text-align: right;
+        width:100%;
+        max-width:388px;
+        color: #333;
+        color: rgb(76 185 223);
+        span {
+          text-decoration: underline;
+          cursor: pointer;
+        }
+      }
+      .title{
+        font-size: 12px;
+        margin-bottom: 6px;
+      }
+      .auths{
+        display: flex;
+        align-items: center;
+        width: 100%;
+        max-width:388px;
+        .auth{
+          width: 100%;
+          max-width: 190px;
+          cursor: pointer;
+          &:first-child{
+            margin-right: 10px;
+          }
+          img{
+            width: 100%;
+            display: block;
+          }
+        }
+      }
+    }
+  }
   h2 {
     font-size: 44px;
     margin-bottom: 10px;

File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_cn.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_cn_sel.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_en.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_en_sel.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_tw.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/lang_tw_sel.svg


+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/pw_enter.svg

@@ -0,0 +1 @@
+<svg id="圖層_1" data-name="圖層 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#afb7bc;}</style></defs><path class="cls-1" d="M2.41184,13.40478H18.1821l-6.88978,6.88978a1.42307,1.42307,0,0,0,0,2.00481,1.406,1.406,0,0,0,1.99069,0l9.304-9.304a1.406,1.406,0,0,0,0-1.9907l-9.304-9.304a1.40763,1.40763,0,1,0-1.99069,1.9907L18.1821,10.5811H2.41184a1.41184,1.41184,0,0,0,0,2.82368Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/pw_invisibility.svg


+ 1 - 0
HiTeachCC/ClientApp/src/assets/icons/svg/pw_visibility.svg

@@ -0,0 +1 @@
+<svg id="圖層_1" data-name="圖層 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#afb7bc;}</style></defs><path class="cls-1" d="M12,4.5A11.82682,11.82682,0,0,0,1,12a11.81667,11.81667,0,0,0,22,0A11.82682,11.82682,0,0,0,12,4.5ZM12,17a5,5,0,1,1,5-5A5.00182,5.00182,0,0,1,12,17Zm0-8a3,3,0,1,0,3,3A2.996,2.996,0,0,0,12,9Z"/></svg>

BIN
HiTeachCC/ClientApp/src/assets/img/login/APivHm7.jpeg


BIN
HiTeachCC/ClientApp/src/assets/img/login/MUJI03.jpg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/auth_dingtalk.svg


+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/auth_facebook.svg

@@ -0,0 +1 @@
+<svg id="圖層_1" data-name="圖層 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 48"><defs><style>.cls-1{fill:#1878f3;}.cls-2{fill:#fafafa;}</style></defs><rect class="cls-1" x="1.75" y="1.49999" width="188.5" height="45.00003" rx="6"/><path class="cls-2" d="M97.875,20.25V18.01758c0-1.00781.22266-1.51758,1.78711-1.51758H101.625V12.75H98.34961c-4.01367,0-5.3379,1.83984-5.3379,4.998V20.25H90.375V24h2.63671V35.25H97.875V24h3.30469l.44531-3.75Z"/></svg>

File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/auth_google.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/auth_wechat.svg


BIN
HiTeachCC/ClientApp/src/assets/img/login/bg_alpha.png


BIN
HiTeachCC/ClientApp/src/assets/img/login/bg_default.png


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/hbk_tmd.svg


File diff suppressed because it is too large
+ 1 - 0
HiTeachCC/ClientApp/src/assets/img/login/htc_cc.svg


BIN
HiTeachCC/ClientApp/src/assets/img/login/qrcodeImg.png


BIN
HiTeachCC/ClientApp/src/assets/img/login/title_cn.png


BIN
HiTeachCC/ClientApp/src/assets/img/login/title_tw_en.png


+ 19 - 10
HiTeachCC/ClientApp/src/components/Common/CommonFooter.vue

@@ -1,21 +1,30 @@
 <template>
     <div class="footer colorF">
         <div style="width:90%;margin:0 auto; padding:20px 0;text-align:center">
-            <span style="color:#939393;">Copyright © 1999 - 2019 醍摩豆(成都)信息技术有限公司 版权所有</span>
-            <a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;height:20px;line-height:20px;">
-                <span style="height:20px;line-height:20px;margin: 0px 5px 0px 15px; color:#939393;">蜀ICP备18027363号-1</span>
-            </a>
-            <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=51010402000615" style="text-decoration:none;height:20px;line-height:20px;">
-                <img src="../../assets/img/beian.png" style="" />
-                <span style="height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">川公网安备 51010402000615号</span>
-            </a>
+            <span style="color:#939393;font-size: 12px;">{{$t('copyright')}}</span>
+            <span v-if="$jsFn.isCN()">
+                <a target="_blank" href="https://beian.miit.gov.cn" style="text-decoration:none;height:20px;line-height:20px;">
+                    <span style="height:20px;line-height:20px;margin: 0px 5px 0px 15px; color:#939393;">蜀ICP备18027363号-1</span>
+                </a>
+                <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=51010402000615" style="text-decoration:none;height:20px;line-height:20px;">
+                    <img src="../../assets/img/beian.png" style="" />
+                    <span style="height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">川公网安备 51010402000615号</span>
+                </a>
+            </span>
         </div>
     </div>
 </template>
 <script>
-    export default {
-        name: ""
+export default {
+    name: '',
+    data() {
+        return {
+            visible: false,
+            LanguageShow: true,
+            isDevelopment: process.env.NODE_ENV === 'development'
+        }
     }
+}
 </script>
 
 <style scoped>

+ 50 - 43
HiTeachCC/ClientApp/src/components/Common/CommonHeader.vue

@@ -1,56 +1,63 @@
 <template>
-  <div class="head colorF pad10">
-      <h2 class="fl logo" v-if="LanguageShow">{{$t('login.loginBox.headertitle')}}</h2>
-    <ul class="fr" v-if="LanguageShow">
-      <li>
-        <Dropdown trigger="click" @on-click="changeLang">
-          <a href="javascript:void(0)">
-            {{$t('login.currentLang')}}
-            <Icon type="ios-arrow-down"></Icon>
-          </a>
-          <DropdownMenu slot="list">
-            <DropdownItem name="zh-CN">中文简体</DropdownItem>
-            <DropdownItem name="zh-TW">中文繁體</DropdownItem>
-            <DropdownItem name="EN-US">English</DropdownItem>
-          </DropdownMenu>
-        </Dropdown>
+  <div class="head colorF pad20" style="    position: fixed;">
+    <!-- <h2 class="fl logo" v-if="LanguageShow">{{$t('login.loginBox.headertitle')}}</h2> -->
+    <img class="fl logo" v-if="LanguageShow" src="@/assets/img/login/htc_cc.svg" style="margin-right: 50px;" />
+    <ul class="langBtns">
+      <li @click="changeLang('zh-TW')">
+        <svg-icon class="icon" :icon-class="$i18n.locale === 'zh-TW' ? 'lang_tw_sel' : 'lang_tw'" />
+      </li>
+      <li @click="changeLang('zh-CN')">
+        <svg-icon class="icon" :icon-class="$i18n.locale === 'zh-CN' ? 'lang_cn_sel' : 'lang_cn'" />
+      </li>
+      <li @click="changeLang('EN-US')">
+        <svg-icon class="icon" :icon-class="$i18n.locale === 'EN-US' ? 'lang_en_sel' : 'lang_en'" />
       </li>
     </ul>
   </div>
 </template>
 
 <script>
-    export default {
-      name: "",
-      data () {
-        return {
-            visible: false,
-            LanguageShow:true,
+import profile from '@/utils/profile'
+export default {
+  name: '',
+  data() {
+    return {
+      visible: false,
+      LanguageShow: true,
+      isDevelopment: process.env.NODE_ENV === 'development'
+    }
+  },
+  created() {
+    this.languagebtn()
+  },
+  methods: {
+    changeLang(name) { // 切换语言
+      // 先判斷是否要更換網頁
+      let rcStr = window.location.hostname.indexOf('-rc') > 0 ? '-rc' : ''
+      if (!this.isDevelopment && name === 'zh-CN' && !this.$jsFn.isCN()) {
+        window.location.href = profile.domainUrl['cn' + rcStr]
+      } else if (!this.isDevelopment && this.$jsFn.isCN()) {
+        window.location.href = profile.domainUrl['global' + rcStr]
+      } else {
+        this.$i18n.locale = name
+        localStorage.setItem('local', name)
+        if (name === 'zh-CN') {
+          this.$Message.success('已切换成中文简体')
+        } else if (name === 'zh-TW') {
+          this.$Message.success('已切換成中文簡體')
+        } else {
+          this.$Message.success('Switched to English')
         }
-        },
-        created() {
-            this.languagebtn()
-        },
-      methods: {
-        changeLang(name){//切换语言
-          this.$i18n.locale=name;
-          localStorage.setItem('local', name);
-          if(name==='zh-CN'){
-            this.$Message.success('已切换成中文简体');
-          }else if(name==='zh-TW'){
-            this.$Message.success('已切換成中文簡體');
-          }else{
-            this.$Message.success('Switched to English');
-          }
-          },
-          languagebtn() {
-              let routers = this.$route.path
-              if (routers === '/moblielogin') {
-                  this.LanguageShow=false
-              }
-          }
+      }
+    },
+    languagebtn() {
+      let routers = this.$route.path
+      if (routers === '/moblielogin') {
+          this.LanguageShow = false
       }
     }
+  }
+}
 </script>
 
 <style scoped>

File diff suppressed because it is too large
+ 6 - 3
HiTeachCC/ClientApp/src/filter/http.js


+ 19 - 2
HiTeachCC/ClientApp/src/locale/lang/en-US/index.js

@@ -81,9 +81,14 @@ export default {
     loginBox:{
       title: 'HiTeach CC',
       intro:'HiTeachCloud Cloud Cloud classroom is an online education system for teachers and students to learn knowledge. Here is the introduction. ',
-      loginWord: 'Login with TMID',
+      loginWord: 'TEAM Model Account',
       StudentEntrance: 'student/participant  join the classroom',
-      headertitle: 'HiTeach CC'
+      headertitle: 'HiTeach CC',
+      authLoginTitle: 'more options',
+      loginId: 'Email / Phone / ID',
+      password: 'password',
+      regist: 'Register',
+      forgotPW: 'Forgot password?'
     },
     footer:{
       create:'CREATE TMID'
@@ -120,5 +125,17 @@ export default {
     term: "Choose to focus on the school year",
     term: "Please select your academic year",
     compare: "Choose data comparison"
+  },
+  copyright: 'Copyright © 2021 HABOOK Group TEAM Model',
+  error: {
+    required : 'Required',
+    format:{
+      default: 'Wrong Format'
+    }
+  },
+  remind: {
+    title: 'Remind',
+    content: 'The current browser is not Google Chrome, for your better physical examination, it is recommended to use Google Chrome to experience!',
+    toDownload: 'Download'
   }
 }

+ 19 - 2
HiTeachCC/ClientApp/src/locale/lang/zh-CN/index.js

@@ -80,9 +80,14 @@ export default {
     loginBox:{
       title:'HiTeach CC',
       intro:'无硬件要求,无任何安装HiTeach的设备均可与一体机电子白板互动教学',
-      loginWord: '使用醍摩豆账号登录',
+      loginWord: '醍摩豆账号登录',
       StudentEntrance: '学生/参与者 加入课堂',
-      headertitle:'HiTeach CC'
+      headertitle:'HiTeach CC',
+      authLoginTitle: '或下列方式登入',
+      loginId: '邮箱 / 手机号 / ID',
+      password: '密码',
+      regist: '免费注册',
+      forgotPW: '忘记密码'
     },
     footer:{
       create:'创建醍摩豆账号'
@@ -90,5 +95,17 @@ export default {
   },
   create:{
     createWord:'开启教室'
+  },
+  copyright: 'Copyright © 1999 - 2019 醍摩豆(成都)信息技术有限公司 版权所有',
+  error: {
+    required : '不能为空',
+    format:{
+      default: '格式错误'
+    }
+  },
+  remind: {
+    title: '提醒',
+    content: '当前浏览器不是谷歌浏览器,为了您更好的体检,建议使用谷歌浏览器体验! ',
+    toDownload: '去下载'
   }
 }

+ 19 - 2
HiTeachCC/ClientApp/src/locale/lang/zh-TW/index.js

@@ -81,9 +81,14 @@ export default {
     loginBox:{
       title: 'HiTeach CC',
       intro:'無硬體要求,無任何安裝HiTeach的設備均可與一體機電子白板互動教學',
-      loginWord: '使用醍摩豆帳號登入',
+      loginWord: '醍摩豆帳號登入',
       StudentEntrance: '學生/參與者 加入教室',
-      headertitle: 'HiTeach CC'
+      headertitle: 'HiTeach CC',
+      authLoginTitle: '或下列方式登入',
+      loginId: 'Email / 手機帳號 / 用戶編號',
+      password: '密碼',
+      regist: '免費註冊',
+      forgotPW: '忘記密碼'
     },
     footer:{
       create:'創建醍摩豆帳號'
@@ -120,5 +125,17 @@ export default {
     term: "選擇關注學年期",
     term: "請選擇學年期",
     compare:"選擇數據對比"
+  },
+  copyright: 'Copyright © 1999 - 2019 網奕資訊科技 版權所有',
+  error: {
+    required : '不能為空',
+    format:{
+      default: '格式錯誤'
+    }
+  },
+  remind: {
+    title: '提醒',
+    content: '當前瀏覽器不是谷歌瀏覽器,為了您更好的體檢,建議使用谷歌瀏覽器體驗!',
+    toDownload: '去下載'
   }
 }

+ 2 - 0
HiTeachCC/ClientApp/src/main.js

@@ -30,6 +30,7 @@ import 'vant/lib/index.css';
 import moment from 'moment'//ʱ��ת��
 import mqttconnect from './plugin/mqttconnect.js' // MQTT���ӷ���
 import draggable from 'vuedraggable'    //�϶����
+import {jsFn} from '@/utils/jsFn.js'
 
 
 import './assets/icons';
@@ -50,6 +51,7 @@ Object.defineProperty(Vue.prototype, '$mqtt', { value: mqtt });
 Vue.prototype.common = commons
 Vue.prototype.$echarts = echarts
 Vue.prototype.$api = apiTools
+Vue.prototype.$jsFn = jsFn
 //Vue.prototype.$jwtDecode = jwtDecode
 Vue.use(Button);
 

+ 111 - 0
HiTeachCC/ClientApp/src/utils/jsFn.js

@@ -0,0 +1,111 @@
+import jwt from 'jwt-decode'
+
+// clinet端的 機體資訊
+var u = navigator.userAgent
+
+/*
+* 檢查是否為大陸站
+*/
+function isCN() {
+    let hostname = window.location.hostname
+    return hostname.substr(hostname.length - 3) === '.cn'
+}
+/**
+ * 是否為MAIL
+ */
+function isEmail(val) {
+  let emailRule = /^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z]+$/
+  return val.search(emailRule) !== -1
+}
+
+/*
+* 取得UUID
+*/
+function getUUID() {
+  var d = Date.now()
+  if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
+    d += performance.now()
+  }
+  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+    var r = (d + Math.random() * 16) % 16 | 0
+    d = Math.floor(d / 16)
+      return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
+  })
+}
+
+  /*
+  * val: 任意值
+  * return  預設為正常,不對才會輸出False
+  */
+function isEmpty(val) {
+  if (val === '' || val === undefined || val === null || val === false || val === '' || val === 'null') {
+      return true
+  } else {
+      return false
+  }
+}
+
+/**
+ * JWT 解碼
+ */
+function jwtDecode(val) {
+  return jwt(val)
+}
+
+/**
+ * android终端
+ */
+function isAndroid() {
+  return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1
+}
+
+/**
+ * ios终端
+ */
+ function isiOS() {
+  return !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
+}
+
+/**
+ * 純數字驗證
+ */
+ function isDigit(s) {
+  var patrn = /^[0-9]+$/
+  if (!patrn.test(s)) return false
+  return true
+}
+
+/**
+ * 排序用
+ */
+function objKeySort(arys) {
+  // 先用Object内置类的keys方法获取要排序对象的属性名,再利用Array原型上的sort方法对获取的属性名进行排序,newkey是一个数组
+  var newkey = Object.keys(arys).sort()
+  var newObj = {} // 创建一个新的对象,用于存放排好序的键值对
+  for (var i = 0; i < newkey.length; i++) { // 遍历newkey数组
+      newObj[newkey[i]] = arys[newkey[i]]// 向新创建的对象中按照排好的顺序依次增加键值对
+  }
+  return newObj // 返回排好序的新对象
+}
+
+/*
+* 檢查是否為habookaclass
+*/
+function isHabookaclass() {
+  let domain = document.domain
+  return domain.indexOf('habookaclass') >= 0
+}
+
+// 將封裝的方法打包起來
+export const jsFn = {
+  isCN,
+  getUUID,
+  isEmpty,
+  jwtDecode,
+  isAndroid,
+  isiOS,
+  isDigit,
+  objKeySort,
+  isEmail,
+  isHabookaclass
+}

+ 53 - 0
HiTeachCC/ClientApp/src/utils/profile.js

@@ -0,0 +1,53 @@
+export default {
+    apiUrl: {
+        global: 'https://api2.teammodel.net',
+        cn: 'https://api2.teammodel.cn'
+    },
+    ies5Api: {
+        // global: 'https://www.teammodel.net',
+        // cn: 'https://www.teammodel.cn'
+        global: 'https://test.teammodel.net',
+        cn: 'https://test.teammodel.cn'
+    },
+    clientID: {
+        global: '118d2d4d-32a3-44c0-808a-792ca73d3706',
+        cn: '227082f4-8db0-4517-b281-93dba9428bc7'
+    },
+    domainUrl: {
+        global: 'https://hiteachcc.teammodel.net',
+        cn: 'https://hiteachcc.teammodel.cn',
+        globalrc: 'https://hiteachcc-rc.teammodel.net',
+        cnrc: 'https://hiteachcc-rc.teammodel.cn'
+    },
+    accountUrl: {
+        global: 'https://account.teammodel.net',
+        cn: 'https://account.teammodel.cn'
+    },
+    communityUrl: function(provider, redirectUri) {
+        let result
+        switch (provider) {
+            case 'facebook':
+                result = 'https://www.facebook.com/v7.0/dialog/oauth?scope=public_profile,email&redirect_uri=' + redirectUri + '&response_type=code&client_id=1382704845111595&display=popup&state=facebook'
+                break
+            case 'google':
+                result = 'https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email&redirect_uri=' + redirectUri + '&response_type=code&client_id=30604537950-2e6eojbqt5k1kjg43jdvdq6g3gp0eo33.apps.googleusercontent.com&display=popup&state=google'
+                break
+            case 'wechat':
+                result = 'https://open.weixin.qq.com/connect/qrconnect?appid=wxd88617b770d4a9f4&redirect_uri=' + redirectUri + '&response_type=code&scope=snsapi_login&state=wechat#wechat_redirect'
+                break
+            case 'ding':
+                result = 'https://oapi.dingtalk.com/connect/qrconnect?appid=dingwjrrgdgejvgx5pbm&response_type=code&scope=snsapi_login&state=ding&redirect_uri=' + redirectUri
+        }
+        return result
+    },
+    getApiUrl: function() {
+        if (process.env.NODE_ENV === 'development') {
+            return this.apiUrl.global
+        } else {
+            let hostname = window.location.hostname
+            let isCN = hostname.substr(hostname.length - 3) === '.cn'
+            let serverLocation = isCN ? 'cn' : 'global'
+            return this.apiUrl[serverLocation]
+        }
+    }
+}

+ 4 - 2
HiTeachCC/ClientApp/src/views/Board.vue

@@ -902,7 +902,8 @@ export default {
     },
     async uploadJsonData(JsonData, JsonfileName, localLinkName) {
       let blobinfo = JSON.parse(localStorage.getItem('blobConnect'))
-      this.blobinit = new Upblob(blobinfo.url, 'hiteachcc/' + blobinfo.id, blobinfo.sas)
+      // 調整BlobURL設定 Osbert
+      this.blobinit = new Upblob(blobinfo.url, '', blobinfo.sas_write)
       await this.blobinit.uploadJsonData(JsonData, 'temp', JsonfileName).then(res => {
         console.log(res, '上传JSON成功后的返回')
         localStorage.setItem(localLinkName, res.url)
@@ -917,7 +918,8 @@ export default {
       console.log(blobinfo, '连接信息')
       //var jwtUser = jwt_decode(idToken)
       //localStorage.setItem('blob', JSON.stringify(jwtUser))
-      this.blobinit = new Upblob(blobinfo.url, 'hiteachcc/' + blobinfo.id, blobinfo.sas)
+      // 調整BlobURL設定 Osbert
+      this.blobinit = new Upblob(blobinfo.url, '', blobinfo.sas_write)
       this.beginPdfshowLoading(0)
       //var blobinfo = JSON.parse(localStorage.getItem('blob'))
       console.log(blobinfo)

File diff suppressed because it is too large
+ 410 - 140
HiTeachCC/ClientApp/src/views/Login.vue


+ 14 - 9
HiTeachCC/ClientApp/src/views/SvgIcon.vue

@@ -1,5 +1,5 @@
 <template>
-  <svg :class="svgClass" aria-hidden="true">
+  <svg :class="svgClass" aria-hidden="true" @click="onClick">
     <use :xlink:href="iconName" />
   </svg>
 </template>
@@ -10,26 +10,31 @@ export default {
   props: {
     iconClass: {
       type: String,
-      required: true,
+      required: true
     },
     className: {
       type: String,
-      default: '',
-    },
+      default: ''
+    }
   },
   computed: {
     iconName() {
-      return `#icon-${this.iconClass}`;
+      return `#icon-${this.iconClass}`
     },
     svgClass() {
       if (this.className) {
-        return 'svg-icon ' + this.className;
+        return 'svg-icon ' + this.className
       } else {
-        return 'svg-icon';
+        return 'svg-icon'
       }
-    },
+    }
   },
-};
+  methods: {
+    onClick: function() {
+      this.$emit('on-click')
+    }
+  }
+}
 </script>
 
 <style>