bzkf3 2 gadi atpakaļ
vecāks
revīzija
df5033fb15

+ 190 - 0
public/pending.html

@@ -0,0 +1,190 @@
+<!DOCTYPE html>
+<html lang="zh-hans">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>跳转中</title>
+  <style>
+    * {
+      margin: 0;
+      padding: 0;
+    }
+
+    .container {
+      width: 100vw;
+      height: 100vh;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+
+    .loading {
+      display: block;
+      position: relative;
+      width: 6px;
+      height: 10px;
+
+      animation: rectangle infinite 1s ease-in-out -0.2s;
+
+      background-color: #409EFF;
+    }
+
+    .loading:before,
+    .loading:after {
+      position: absolute;
+      width: 6px;
+      height: 10px;
+      content: "";
+      background-color: #409EFF;
+    }
+
+    .loading:before {
+      left: -14px;
+
+      animation: rectangle infinite 1s ease-in-out -0.4s;
+    }
+
+    .loading:after {
+      right: -14px;
+
+      animation: rectangle infinite 1s ease-in-out;
+    }
+
+    @keyframes rectangle {
+
+      0%,
+      80%,
+      100% {
+        height: 20px;
+        box-shadow: 0 0 #409EFF;
+      }
+
+      40% {
+        height: 30px;
+        box-shadow: 0 -20px #409EFF;
+      }
+    }
+
+  </style>
+  <link rel="stylesheet" href="./utils/message.css">
+  <script src="./utils/message.js"></script>
+  <script src="./utils/axios.min.js"></script>
+</head>
+
+<body>
+  <div class="container">
+    <div class="loading"></div>
+  </div>
+  <script src="./config.js"></script>
+  <script>
+    const _request = axios.create({
+      baseURL: window.GLOBAL_CONFIG.api,
+      timeout: 60 * 1000,
+      headers: {
+        'Content-Type': 'application/x-www-form-urlencoded',
+      },
+      method: 'post'
+    })
+
+    function hrefTo(url) {
+      setTimeout(() => {
+        location.replace(url)
+      }, 1000)
+    }
+  </script>
+  <script>
+    const userInfo = localStorage.getItem('userInfo')
+
+    const SearchMap = new URLSearchParams(location.search)
+    const from = SearchMap.get('from')
+    //  bind | login
+    const type = SearchMap.get('type')
+    const gaeatoken = SearchMap.get('gaeatoken')
+    switch (type) {
+      case 'bind': {
+        _request({
+          url: `/openapi/oauth/${from}/index.php`,
+          data: {
+            type: 'bind',
+            token: userInfo.token,
+            gaeatoken
+          }
+        }).then(res => {
+          if (res.code === '1') {
+            Message.success('绑定成功')
+            hrefTo(`${window.location.origin}/#/personal/setting/${userInfo.user_id}`)
+          } else {
+            confirm(res.msg)
+          }
+        })
+        break;
+      }
+      case 'unbind': {
+        _request({
+          url: `/openapi/oauth/${from}/index.php`,
+          data: {
+            type: 'unbind',
+            token: userInfo.token,
+          }
+        }).then(res => {
+          if (res.code === '1') {
+            Message.success('解绑成功')
+            hrefTo(`${window.location.origin}/#/personal/setting/${userInfo.user_id}`)
+          } else {
+            confirm(res.msg)
+          }
+        })
+        break;
+      }
+      // 登录
+      case 'login': {
+        _request({
+          url: `/openapi/oauth/${from}/index.php`,
+          data: {
+            type: 'user2local',
+            gaeatoken,
+          }
+        }).then(response => {
+          const res = response.data
+          if (res.code === '1') {
+            const userInfo = res.data
+            localStorage.removeItem('userInfo')
+            localStorage.setItem('userInfo', JSON.stringify(userInfo))
+            hrefTo(SearchMap.get('redirect'))
+          } else {
+            confirm(res.msg)
+          }
+        })
+        break;
+      }
+      case 'loginback': {
+        _request({
+          url: `/openapi/oauth/${from}/index.php`,
+          data: {
+            type: 'user2local',
+            gaeatoken,
+          }
+        }).then(response => {
+          const res = response.data
+          if (res.code === '1') {
+            const userInfo = res.data
+            localStorage.removeItem('userInfo')
+            localStorage.setItem('userInfo', JSON.stringify(userInfo))
+            hrefTo(`${window.location.origin}/manage/`)
+          } else {
+            confirm(res.msg)
+          }
+        })
+        break;
+      }
+      default: {
+        alert('错误的方式访问页面')
+        break;
+      }
+    }
+  </script>
+</body>
+
+</html>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 0
public/utils/axios.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
public/utils/message.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
public/utils/message.js


+ 83 - 5
src/pages/personal/components/main/setting.vue

@@ -8,11 +8,13 @@
           <div class="pwd" @click="modifyPwd">修改密码</div>
         </div>
         <div class="formContent" v-loading="loading">
-          <el-form :model="formline" ref="formline" :rules="rules" size="large" label-position="top" class="demo-ruleForm">
+          <el-form :model="formline" ref="formline" :rules="rules" size="large" label-position="top"
+            class="demo-ruleForm">
             <div class="must">
               <div class="label">头像</div>
               <div class="uploadDiv">
-                <el-upload class="mainUpload" action="" accept=".png, .jpg, .jpeg" :auto-upload="false" list-type="picture-card" :on-change="handleMainChange" :file-list="fileList">
+                <el-upload class="mainUpload" action="" accept=".png, .jpg, .jpeg" :auto-upload="false"
+                  list-type="picture-card" :on-change="handleMainChange" :file-list="fileList">
                   <el-icon size="38" color="#9d9ab9" v-if="fileList.length==0">
                     <Picture />
                   </el-icon>
@@ -27,8 +29,10 @@
               <el-input v-model="formline.user_phone" />
             </el-form-item>
             <el-form-item label="任教学科" prop="subject_id">
-              <el-select v-model="activeSubject" placeholder=" " size="large" @change="initSubject" value-key="subject_id">
-                <el-option v-for="item in subjectData" :key="item.subject_id" :label="item.subject_name" :value="item" />
+              <el-select v-model="activeSubject" placeholder=" " size="large" @change="initSubject"
+                value-key="subject_id">
+                <el-option v-for="item in subjectData" :key="item.subject_id" :label="item.subject_name"
+                  :value="item" />
               </el-select>
             </el-form-item>
             <!-- <el-form-item label="学校" prop="sm_id">
@@ -59,6 +63,37 @@
             </el-form-item>
           </el-form>
         </div>
+
+
+        <!--  -->
+        <el-divider></el-divider>
+        <div class="header">
+          <div class="title">账号绑定</div>
+        </div>
+        <div class="formContent" v-loading="loading">
+          <el-form label-position="top" size="large">
+            <el-form-item label="绑定浙里办账号">
+              <div class="w-full flex justify-between">
+                <el-input disabled class="flex-auto" v-model="zhbdform.ue_jlb_account"></el-input>
+                <el-button @click="handleBindingClick('zlb','bind')" type="primary" class="ml-2 flex-none">绑定
+                </el-button>
+                <el-button @click="handleBindingClick('zlb','unbind')" type="primary" class="ml-2 flex-none">解绑
+                </el-button>
+              </div>
+            </el-form-item>
+
+            <el-form-item label="绑定教育E家账号">
+              <div class="w-full flex justify-between">
+                <el-input disabled class="flex-auto" v-model="zhbdform.ue_jyej_account"></el-input>
+                <el-button @click="handleBindingClick('jyej','bind')" type="primary" class="ml-2 flex-none">绑定
+                </el-button>
+                <el-button @click="handleBindingClick('jyej','unbind')" type="primary" class="ml-2 flex-none">解绑
+                </el-button>
+              </div>
+            </el-form-item>
+          </el-form>
+
+        </div>
       </div>
     </div>
   </div>
@@ -118,9 +153,25 @@ export default {
       mainFileData: ["png", "jpg", "jpeg"],
       isRead: true,
       commitLoading: false,
+      zhbdform: {
+        ue_jlb_account: undefined,
+        ue_jyej_account: undefined
+      },
     };
   },
   methods: {
+    handleBindingClick(from, type) {
+      switch (type) {
+        case 'bind':
+          location.replace(`https://jyyj.zjjxedu.gov.cn:86/edu-manager/login?redirectTo=${window.GLOBAL_CONFIG.web_pc}/pending.html?from=${from}&type=${type}`)
+          break;
+        case 'unbind':
+          location.replace(`${window.GLOBAL_CONFIG.web_pc}/pending.html?from=${from}&type=${type}`)
+          break;
+        default:
+          break;
+      }
+    },
     goBack() {
       this.$router.go(-1);
     },
@@ -170,6 +221,10 @@ export default {
             ue_zyzsjs: this.userInfo.ext.ue_zyzsjs,
             ue_zym: this.userInfo.ext.ue_zym,
           }
+          this.zhbdform = {
+            ue_jlb_account: this.userInfo?.ext?.ue_jlb_account,
+            ue_jyej_account: this.userInfo?.ext?.ue_jyej_account,
+          }
           this.subjectData.map((item) => {
             if (item.subject_id == this.formline.subject_id) {
               this.activeSubject = item;
@@ -260,6 +315,7 @@ export default {
   background-image: url("@/assets/img/zhjy/xq_bg.png");
   background-repeat: no-repeat;
 }
+
 .main {
   width: 1400px;
   margin: 0 auto;
@@ -270,9 +326,11 @@ export default {
   border-radius: 10px;
   box-shadow: 0px 10px 24px 0px rgba(161, 153, 168, 0.18);
 }
+
 .header {
   display: flex;
   justify-content: space-between;
+
   .title {
     font-size: 18px;
     font-family: PingFangSC, PingFangSC-Regular;
@@ -280,6 +338,7 @@ export default {
     text-align: center;
     color: #050026;
   }
+
   .pwd {
     font-size: 16px;
     font-family: PingFangSC, PingFangSC-Regular;
@@ -290,15 +349,18 @@ export default {
     cursor: pointer;
   }
 }
+
 .formContent {
   width: 575px;
   margin: auto;
+
   .el-form-item::v-deep {
     &.is-required {
       .el-form-item__label {
         &::before {
           display: none;
         }
+
         &::after {
           content: "*";
           color: #f35421;
@@ -306,17 +368,21 @@ export default {
         }
       }
     }
+
     .el-form-item__label {
       color: #949494;
       font-size: 14px;
       position: relative;
     }
+
     .el-form-item__content {
       .el-select {
         width: 100%;
       }
+
       .el-input {
         width: 100%;
+
         .el-input__wrapper {
           width: 100%;
           box-shadow: none;
@@ -324,6 +390,7 @@ export default {
           border-radius: 6px;
         }
       }
+
       .el-textarea {
         .el-textarea__inner {
           box-shadow: none;
@@ -332,6 +399,7 @@ export default {
           // color: #d0d0d0;
         }
       }
+
       // .el-checkbox.read {
       //   .el-checkbox__inner {
       //     border-radius: 50%;
@@ -342,40 +410,49 @@ export default {
       }
     }
   }
+
   .must {
     display: flex;
     align-items: center;
     margin-bottom: 22px;
+
     .label {
       color: #949494;
       font-size: 14px;
       margin-right: 15px;
+
       &::after {
         content: "*";
         color: #f35421;
         margin-left: 4px;
       }
     }
+
     .uploadDiv::v-deep {
       flex: 1;
+
       .el-upload--picture-card {
         width: 96px;
         height: 96px;
         border-radius: 50%;
+
         img {
           width: 100%;
           height: 100%;
           border-radius: 50%;
         }
       }
+
       .el-upload-list--picture-card .el-upload-list__item {
         display: none;
       }
     }
   }
+
   .btnDiv {
     text-align: center;
     width: 100%;
+
     .el-button {
       background: #f4f4f4;
       border: none;
@@ -384,6 +461,7 @@ export default {
       color: #41387f;
       font-family: PingFangSC, PingFangSC-Semibold;
     }
+
     .el-button--primary {
       background: #00a3ff;
       margin-right: 80px;
@@ -391,4 +469,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 35 - 2
src/pages/personal/components/sz/index.vue

@@ -7,11 +7,13 @@
         <div class="pwd" @click="modifyPwd()">修改密码</div>
       </div>
       <div class="formContent" v-loading="loading">
-        <el-form :model="formline" ref="formline" :rules="rules" size="large" label-position="top" class="demo-ruleForm" v-if="!loading">
+        <el-form :model="formline" ref="formline" :rules="rules" size="large" label-position="top" class="demo-ruleForm"
+          v-if="!loading">
           <div class="must">
             <div class="label">头像</div>
             <div class="uploadDiv">
-              <el-upload class="mainUpload" action="" accept=".png, .jpg, .jpeg" :auto-upload="false" list-type="picture-card" :on-change="handleMainChange" :file-list="fileList">
+              <el-upload class="mainUpload" action="" accept=".png, .jpg, .jpeg" :auto-upload="false"
+                list-type="picture-card" :on-change="handleMainChange" :file-list="fileList">
                 <el-icon size="38" color="#9d9ab9" v-if="fileList.length==0">
                   <Picture />
                 </el-icon>
@@ -40,6 +42,7 @@
               <el-option v-for="item in schoolData" :key="item.sm_name" :label="item.sm_name" :value="item.sm_name" />
             </el-select>
           </el-form-item>
+
           <el-form-item>
             <el-checkbox class="read" v-model="isRead" label="已阅读并同意《课程上传协议》" size="large" />
           </el-form-item>
@@ -51,6 +54,7 @@
           </el-form-item>
         </el-form>
       </div>
+
     </div>
   </div>
 </template>
@@ -236,33 +240,40 @@ export default {
   display: flex;
   align-items: center;
   margin-bottom: 22px;
+
   .label {
     color: #949494;
     font-size: 14px;
     margin-right: 15px;
+
     &::after {
       content: "*";
       color: #f35421;
       margin-left: 4px;
     }
   }
+
   .uploadDiv::v-deep {
     flex: 1;
+
     .el-upload--picture-card {
       width: 96px;
       height: 96px;
       border-radius: 50%;
+
       img {
         width: 100%;
         height: 100%;
         border-radius: 50%;
       }
     }
+
     .el-upload-list--picture-card .el-upload-list__item {
       display: none;
     }
   }
 }
+
 .content {
   width: 100%;
   min-width: 1400px;
@@ -270,6 +281,7 @@ export default {
   background-image: url("@/assets/img/zhjy/xq_bg.png");
   background-repeat: no-repeat;
 }
+
 .main {
   width: 1400px;
   margin: 0 auto;
@@ -280,9 +292,11 @@ export default {
   border-radius: 10px;
   box-shadow: 0px 10px 24px 0px rgba(161, 153, 168, 0.18);
 }
+
 .header {
   display: flex;
   justify-content: space-between;
+
   .title {
     font-size: 18px;
     font-family: PingFangSC, PingFangSC-Regular;
@@ -290,6 +304,7 @@ export default {
     text-align: center;
     color: #050026;
   }
+
   .pwd {
     font-size: 16px;
     font-family: PingFangSC, PingFangSC-Regular;
@@ -303,12 +318,14 @@ export default {
 .formContent {
   width: 575px;
   margin: auto;
+
   .el-form-item::v-deep {
     &.is-required {
       .el-form-item__label {
         &::before {
           display: none;
         }
+
         &::after {
           content: "*";
           color: #f35421;
@@ -316,17 +333,21 @@ export default {
         }
       }
     }
+
     .el-form-item__label {
       color: #949494;
       font-size: 14px;
       position: relative;
     }
+
     .el-form-item__content {
       .el-select {
         width: 100%;
       }
+
       .el-input {
         width: 100%;
+
         .el-input__wrapper {
           width: 100%;
           box-shadow: none;
@@ -334,6 +355,7 @@ export default {
           border-radius: 6px;
         }
       }
+
       .el-textarea {
         .el-textarea__inner {
           box-shadow: none;
@@ -342,6 +364,7 @@ export default {
           // color: #d0d0d0;
         }
       }
+
       // .el-checkbox.read {
       //   .el-checkbox__inner {
       //     border-radius: 50%;
@@ -352,40 +375,49 @@ export default {
       }
     }
   }
+
   .must {
     display: flex;
     align-items: center;
     margin-bottom: 22px;
+
     .label {
       color: #949494;
       font-size: 14px;
       margin-right: 15px;
+
       &::after {
         content: "*";
         color: #f35421;
         margin-left: 4px;
       }
     }
+
     .uploadDiv::v-deep {
       flex: 1;
+
       .el-upload--picture-card {
         width: 96px;
         height: 96px;
         border-radius: 50%;
+
         img {
           width: 100%;
           height: 100%;
           border-radius: 50%;
         }
       }
+
       .el-upload-list--picture-card .el-upload-list__item {
         display: none;
       }
     }
   }
+
   .btnDiv {
     text-align: center;
     width: 100%;
+
     .el-button {
       background: #f4f4f4;
       border: none;
@@ -394,6 +426,7 @@ export default {
       color: #41387f;
       font-family: PingFangSC, PingFangSC-Semibold;
     }
+
     .el-button--primary {
       background: #00a3ff;
       margin-right: 80px;