guojy пре 1 година
родитељ
комит
f05c2db1f0

+ 1 - 0
build/webpack.dev.conf.js

@@ -39,6 +39,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     compress: true,
     host: HOST || config.dev.host,
     port: PORT || config.dev.port,
+    disableHostCheck: true,
     open: config.dev.autoOpenBrowser,
     overlay: config.dev.errorOverlay
       ? { warnings: false, errors: true }

+ 0 - 0
course/coursIndex.vue


+ 0 - 18
course/course.js

@@ -1,18 +0,0 @@
-  // 在线课程相关
-  const routes = [
-    {
-      path: '/courseHome',
-      name: 'courseHome',
-      component: () => import('@/view/course/home'),
-      label: '课程首页',
-      need_login: true,
-    },
-    {
-      path: '/courseLogin',
-      name: 'courseLogin',
-      component: () => import('@/view/course/user/login'),
-      label: '课程登录',
-      need_login: true,
-    },
-]
-export default routes

+ 0 - 89
course/course/home.vue

@@ -1,89 +0,0 @@
-<template>
-  <div class="page">
-    <div class="userInfo">
-      <van-row type="flex" justify="space-between" align="center">
-        <div class="user_tit">
-          <p>{{ user_info.name }}</p>
-          <span>ID:{{ user_info.wx_id }}</span>
-          <div class="user_leave">{{ user_info.isDearler?'经销商':'学员' }}</div>
-        </div>
-        <div class="userImage">
-          <userImage
-            class="about-me__avatar"
-            :img_url="user_info.img_url"
-            :user_name="user_info.name"
-            width="1.12rem"
-            height="1.12rem"
-          ></userImage>
-        </div>
-      </van-row>
-    </div>
-  </div>
-</template>
-
-<script>
-import Vue from "vue";
-import { Col, Row } from "vant";
-Vue.use(Col);
-Vue.use(Row);
-export default {
-  name: "",
-  components: {},
-  props: [],
-  data() {
-    return {
-      user_info: {
-        img_url: "",
-        wx_id: "wx15451154555",
-        name: "新人",
-        isDearler: true
-      }
-    };
-  },
-  created() {},
-  mounted() {},
-  methods: {},
-  computed: {}
-};
-</script>
-<style scoped lang="scss">
-.page {
-  box-sizing: border-box;
-  padding: 0.4rem 0 0;
-  background-color: #efefef;
-  .userInfo {
-    padding: 0.24rem 0.32rem;
-    // border: 1px solid #888;
-    border-radius: 0.2rem;
-    background: linear-gradient(
-      180deg,
-      #efefef 0%,
-      #ccc 40%,
-      #ccc 60%,
-      #efefef 100%
-    );
-    .user_tit {
-      p {
-        font-size: 0.32rem;
-        color: #000;
-        line-height: 2;
-        margin: 0;
-      }
-      span {
-        font-size: 0.24rem;
-        color: #888;
-        line-height: 1.4;
-        display: block;
-      }
-    }
-    .user_leave {
-        padding: 0 .1rem;
-        font-size: .23rem;
-        color: #888;
-        background-color: #fff;
-        line-height: 1.5;
-        border-radius: .2rem;
-    }
-  }
-}
-</style>

+ 0 - 715
course/course/user/login.vue

@@ -1,715 +0,0 @@
-<template>
-  <div class="login-box-parent" style="background:#fff;">
-    <div class="login-box" :class="{ input_focus: input_focus }">
-      <div class="flex-box-v" style="height: 100%;">
-        <div class="login-form-box flex-1" style="background-color:#FFF">
-          <div class="login-form-box-bg">
-            <!-- App背景 -->
-            <icon name="login_logo_bg" class="login_logo_bg"></icon>
-          </div>
-          <div style="height: 1rem;"></div>
-          <div class="login_logo">
-            <icon name="logo" class="app_logn"></icon>
-          </div>
-          <div class="setp1">
-            <van-cell-group style="margin-top:0.3rem;">
-              <van-field class="tel" left-icon="logo" label-class="hidden" label="" type="Number"
-                v-model="formData.username" placeholder="手机号" clearable style="color:#515151;caret-color:#26A2FF;"
-                name="手机号码" v-validate="'required|phone'">
-                <template slot="left-icon">
-                  <icon name="tel" class="login_tel"></icon>
-                </template>
-              </van-field>
-
-              <van-field class="psw" label-class="hidden" left-icon="logo" clearable type="password" v-model="formData.password" placeholder="密码" name="密码" v-validate="'required|alpha_dash|min:6'"  style="color:#515151;caret-color:#26A2FF;">
-                <template slot="left-icon">
-                  <icon name="pwd" class="login_pwd"></icon>
-                </template>
-              </van-field>
-
-            </van-cell-group>
-          </div>
-
-          <div style="padding:0 0.32rem">
-            <van-button class="login_button" color="#228bf8" size="large" :disabled="!next_btn_enable"
-              @click="sendLogin" type="info">登录</van-button>
-          </div>
-          <div style="padding:0.2rem 0.32rem 0.2rem;" class="reg_link_box">
-            <van-row>
-              <van-col span="12">
-                <div class="blue" @click="openUrl(1)">找回密码</div>
-              </van-col>
-              <!-- <van-col span="12" style="text-align: right;">
-                <div @click="openUrl(2)">注册免费试用</div>
-              </van-col> -->
-            </van-row>
-          </div>
-          <div style="text-align: center; padding:0 0.32rem;letter-spacing: 0.01rem"
-            v-if="(auths.length > 0&&isAndroid)||$isWx">
-            <van-divider>快捷登录</van-divider>
-            <div style="display: inline-block;" @click="doWeixinLogin">
-              <icon name="weixindenglu" style="width:1.2rem;"></icon>
-            </div>
-          </div>
-        </div>
-        <div class="footer flex-box-ce flex-center-center" v-if="!$isWx">
-          <van-checkbox icon-size="14px" v-model="isYsShow">登录即同意功道云</van-checkbox>
-          <span style="color:#28a2f1" @click="$router.push({ name: 'user_agreement' })">《服务协议》</span>
-          <span>&</span>
-          <span style="color:#28a2f1" @click="$router.push({ name: 'privacy_agreement' })">《隐私政策》</span>
-        </div>
-      </div>
-    </div>
-
-
-
-    <!-- 隐私条例 -->
-    <van-popup v-model="showYs" :close-on-click-overlay="false" class="popup-all">
-      <div style="position: relative;">
-        <div class="title">提示</div>
-        <div class="content">
-          使用本软件前请认真阅读我们的
-          <span style="color:#28a2f1" @click="$router.push({ name: 'user_agreement' })">《用户服务协议》</span>
-          和
-          <span style="color:#28a2f1" @click="$router.push({ name: 'privacy_agreement' })">《隐私协议》</span>
-          相关条款,您也可以稍后在应用设置里浏览查看。点击“同意使用”即表示您接受我们的服务协议和隐私政策,继续使用我们的软件。
-        </div>
-        <div class="footer2 flex-box-ce">
-          <div class="flex-1" @click="closeYs2">暂不使用</div>
-          <div class="flex-1" @click="closeYs">同意使用</div>
-        </div>
-      </div>
-    </van-popup>
-
-    <!-- 微信登录 -->
-    <van-popup v-model="isShowSelect" class="popup-all">
-      <div style="position: relative;">
-        <div style="position: absolute;top:16px;right:16px" @click="isShowSelect=false"><van-icon name="cross" /></div>
-        <div class="contentBox">
-          <div class="">欢迎使用功道云!</div>
-          <p>请选择以下进入方式,如已有登录账号<br />请先绑定账号再进入</p>
-        </div>
-        <div class="btns" style="padding-bottom: 16px;">
-          <div class="bdBtn" @click="$router.push({ name: 'bindingPhone', query: { secret: wo_token } })">绑定已有账号</div>
-          <div style="font-size: 0.28rem;color: #666" @click="wxLogin">创建新账号</div>
-        </div>
-      </div>
-    </van-popup>
-
-    <van-dialog v-model="isShowDialog" confirmButtonText="同意并继续" confirmButtonColor="#238cf9" @confirm="confirmDialog">
-      <div style="padding: 0.3rem;">
-        <div class="flex-box-ce" style="margin-bottom: 0.24rem;">
-          <div style="font-size: 0.4rem;font-weight: 700;" class="flex-1 black">服务协议和隐私政策</div>
-          <van-icon name="cross" @click="isShowDialog=false" class="fontColorC"
-            style="font-size: 0.3rem;position: relative;top: -0.1rem;right: -0.1rem;" />
-        </div>
-        <div class="fontColorC">
-          为了更好地保障你的合法权益,使用前请阅读并同意功道云<span style="color:#28a2f1"
-            @click="$router.push({ name: 'user_agreement' })">《服务协议》</span>&<span style="color:#28a2f1"
-            @click="$router.push({ name: 'privacy_agreement' })">《隐私政策》</span>
-        </div>
-      </div>
-    </van-dialog>
-  </div>
-</template>
-
-<script>
-  import {
-    setToken,
-    returnJSEncrypt
-  } from '@/utils/auth';
-  import axios from 'axios';
-  import qs from 'qs';
-  import Vue from 'vue';
-  import {
-    Divider
-  } from 'vant';
-  Vue.use(Divider);
-  export default {
-    name: 'login',
-    data() {
-      return {
-        input_focus: false,
-        next_btn_enable: false,
-        isAndroid: this.$getCache('isAndroid'),
-        formData: {
-          username: '',
-          password: ''
-        },
-        aweixin: null,
-        auths: [],
-
-        index: 0,
-        // 微信登录
-        isShowSelect: false,
-        // 隐私相关
-        isYsShow: false,
-        showYs: false,
-        wo_token: '',
-        isShowDialog: false,
-        // wo_token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOm51bGwsImlhdCI6MTY0MjI0MDQ3NywiZXhwIjoxNjQ0ODMyNDc3LCJuYmYiOjE2NDIyNDA0NzcsImp0aSI6ImtlZmVxZ09yMVZYWEVNZmwiLCJzdWIiOjgsInBydiI6IjAzMDBhNTQ5YWI4ZjcwMmNkYTgzMjMxYTQxMzMyZWNjYmRlOWRmOGYiLCJyb2xlIjoid2VjaGF0X29wZW5fdXNlciJ9.SRt2d8-J3FXQ0UFU27csIiGOJvOSxzQSoDMV-LpE3ZM' //微信登录token
-      };
-    },
-    created() {
-      let that = this;
-      document.body.addEventListener('blur', function(e) {
-        setTimeout(() => {
-          e.target.parentNode.parentNode.parentNode.classList.remove('field-focus');
-          that.input_focus = false;
-        }, 100);
-      }, true);
-      document.body.addEventListener('focus', function(e) {
-        e.target.parentNode.parentNode.parentNode.classList.add('field-focus');
-        setTimeout(() => {
-          that.input_focus = true;
-        }, 100);
-      }, true);
-      this.$store.commit('SET_USERINFO', {}); // 清空人员信息
-      this.$store.commit('SET_USERID', 0);
-      // alert(`$isWx${this.$isWx}`)
-      if (this.$isWx) {
-        this.doWeixinLogin();
-        return false
-      }
-      if (window.plus) {
-        this.hei = plus.navigator.getStatusbarHeight();
-        this.getServiceOauth();
-      }
-    },
-    mounted() {
-      this.$removeCache('account')
-    },
-    watch: {
-      formData: {
-        handler(val, oldVal) {
-          if (val.username != '' && val.password != '') {
-            this.next_btn_enable = true;
-          } else {
-            this.next_btn_enable = false;
-          }
-        },
-        deep: true
-      }
-    },
-    methods: {
-      confirmDialog() {
-        this.isShowDialog = true;
-        this.isYsShow = true
-      },
-      wxLogin() {
-        let pl = 'a';
-        if (window.plus) {
-          if (navigator.userAgent.indexOf('Android') > 0) {
-            pl = 'a';
-          } else {
-            pl = 'i';
-          }
-        }
-        axios({
-          method: 'post',
-          url: process.env.BASE_API + '/api/pro/wo/create',
-          headers: {
-            'Content-Type': 'application/x-www-form-urlencoded',
-            pl: pl,
-            'A-TOKEN': this.wo_token
-          }
-        }).then(res => {
-          if (res.data.code == 1) {
-            this.$setCache('account', res.data.data.account);
-            localStorage.setItem('a-token-temp', res.data.data.token); // 保存平台账号登录的token
-            this.registrationExperience(); //进入体验账号
-          } else {
-            this.$toast(res.data.msg);
-          }
-        });
-      },
-      openUrl(index) {
-        if (!this.isLogin()) {
-          return false
-        }
-        if (index == 1) {
-          this.$router.push({
-            name: 'forget_pwd'
-          });
-        } else {
-          this.$router.push({
-            name: 'reg'
-          });
-        }
-      },
-      openHome() {
-        setTimeout(() => {
-          window.location.href = window.location.href.split('#')[0];
-        }, 100);
-      },
-      isLogin() {
-        if (!this.isYsShow && process.env.NODE_ENV == 'production') {
-          this.isShowDialog = true;
-          return false;
-        } else {
-          return true;
-        }
-      },
-      // 判断是否获取微信登录认证
-      getServiceOauth() {
-        var that = this;
-        if (window.plus) {
-          plus.oauth.getServices(function(services) {
-            that.auths = services;
-            for (let i in services) {
-              if (services[i].id == 'weixin') {
-                that.aweixin = services[i];
-              }
-            }
-          });
-        }
-      },
-      doWeixinLogin() {
-        if (this.$isWx) {
-          if (this.isAndroid) {
-            window.open(process.env.VUE_APP_WXURL, '_blank');
-          } else {
-            window.location.href = process.env.VUE_APP_WXURL
-          }
-          return false
-        }
-        let that = this;
-        if (window.plus && this.isLogin()) {
-          if (this.aweixin == null) {
-            plus.nativeUI.alert('当前环境不支持微信登录');
-            return;
-          }
-          this.aweixin.authorize(
-            function(e) {
-              that.WeixinLogin(e.code);
-            },
-            function(e) {
-              if (e.code == '-1002') {
-                plus.nativeUI.alert('请先安装微信客户端');
-              }
-            }, {
-              scope: 'snsapi_userinfo',
-              state: 'authorize test',
-              appid: 'wx84f9a9b3ce29f450'
-            }
-          );
-        }
-      },
-      sendLogin() {
-        if (!this.isLogin()) {
-          return false
-        }
-        this.$validator.validate().then(result => {
-          if (!result) {
-            this.$notify({
-              type: 'danger',
-              message: this.$validator.errors.items[0].msg
-            });
-          } else {
-            this.$toast.loading({
-              mask: true,
-              message: '正在登录...'
-            });
-            this.$store.dispatch('login', {
-                tel: this.formData.username,
-                password: this.formData.password
-              }).then(res => {
-                if (res.code == 1) {
-                  localStorage.setItem('a-token-temp', res.data.token); // 保存平台账号登录的token
-                  this.openUrl2(res.data.account_site, res.data.invitation_wait_count);
-                } else {
-                  this.$toast.fail({
-                    message: res.msg,
-                    duration: 1000
-                  });
-                }
-              })
-              .finally(() => {
-                this.$toast.clear();
-              });
-          }
-        });
-      },
-      // 直接进入,跳过选择行业与公司,体验账户专用
-      registrationExperience() {
-        this.$router.replace({
-          name: 'create_company'
-        })
-      },
-      WeixinLogin(code) {
-        this.$toast.loading({
-          mask: true,
-          message: '正在登录...'
-        });
-        let pl = 'a';
-        if (window.plus) {
-          if (navigator.userAgent.indexOf('Android') > 0) {
-            pl = 'a';
-          } else {
-            pl = 'i';
-          }
-        }
-        let data = {
-          code: code,
-        };
-        axios({
-          method: 'post',
-          url: process.env.BASE_API + '/api/pro/wo/code',
-          data: qs.stringify({
-            data: returnJSEncrypt(data)
-          }),
-          headers: {
-            'Content-Type': 'application/x-www-form-urlencoded',
-            pl: pl
-          }
-        }).then(res => {
-          if (res.data.code == 1) {
-            this.wo_token = res.data.data.wo_token;
-            this.wxSelect();
-          } else {
-            this.$toast(res.data.msg);
-          }
-        });
-      },
-      wxSelect() {
-        let pl = 'a';
-        if (window.plus) {
-          if (navigator.userAgent.indexOf('Android') > 0) {
-            pl = 'a';
-          } else {
-            pl = 'i';
-          }
-        }
-        axios({
-          method: 'get',
-          url: process.env.BASE_API + '/api/pro/wo/oui',
-          headers: {
-            'Content-Type': 'application/x-www-form-urlencoded',
-            pl: pl,
-            'A-TOKEN': this.wo_token
-          }
-        }).then(res => {
-          if (res.data.code == 1) {
-            this.$setCache('account', res.data.data.account);
-            if (res.data.data.account_id !== 0) {
-              localStorage.setItem('a-token-temp', res.data.data.token); // 保存平台账号登录的token
-              // 已绑定平台账号
-              this.openUrl2(res.data.data.account_site, res.data.data.invitation_wait_count);
-            } else {
-              this.$router.replace({
-                name: 'regWx',
-                query: {
-                  wo_token: this.wo_token
-                }
-              });
-              // this.isShowSelect = true;
-            }
-          } else {
-            this.$toast(res.data.msg);
-          }
-        });
-      },
-      openUrl2(account_site, invitation_wait_count) {
-        if (account_site.length > 0) {
-          // 公司数量
-          if (invitation_wait_count > 0) {
-            this.$router.push({
-              name: 'registration_experience',
-              query: {
-                invite: 1,
-                iscompany: 1
-              }
-            }); // 选择行业
-          } else {
-            this.$router.push({
-              name: 'login_company_list'
-            }); // 选择企业
-          }
-        } else {
-          if (invitation_wait_count > 0) {
-            // 待邀请数量
-            this.$router.push({
-              name: 'registration_experience',
-              query: {
-                invite: 1
-              }
-            }); // 选择行业
-          } else {
-            this.registrationExperience(); //进入体验账号
-          }
-        }
-      },
-      // 关闭APP
-      closeYs2() {
-        this.isYsShow = false;
-        this.showYs = false;
-        if (window.plus) {
-          plus.runtime.quit();
-        }
-      },
-      // 关闭隐私
-      closeYs() {
-        localStorage.setItem('isYsShow', true);
-        this.isYsShow = true;
-        this.showYs = false;
-      },
-    }
-  };
-</script>
-
-<style rel="stylesheet/scss" lang="scss" scoped>
-  .contentBox {
-    text-align: center;
-    padding: 50px 0;
-
-    div {
-      font-size: 0.38rem;
-      color: #222;
-    }
-
-    p {
-      font-size: 0.28rem;
-      color: #666;
-    }
-  }
-
-  .bdBtn {
-    width: 80%;
-    padding: 10px;
-    border-radius: 25px;
-    background-image: linear-gradient(117deg, #04b3fb, #31d4ff);
-    color: #fff;
-    margin: 0 auto;
-    margin-bottom: 16px;
-  }
-
-  .popup-all {
-    border-radius: 0.15rem;
-    background: #fff;
-    width: 80%;
-    text-align: center;
-    font-size: 0.32rem;
-
-    .title {
-      padding: 0.2rem 0;
-    }
-
-    .content {
-      font-size: 0.28rem;
-      padding: 0 0.2rem;
-      padding-bottom: 0.2rem;
-      height: 3rem;
-      // overflow-y: scroll;
-    }
-
-    .footer2 div:nth-child(1) {
-      background-color: #ccc;
-      color: #333333;
-      padding: 0.24rem 0;
-      font-size: 0.28rem;
-    }
-
-    .footer2 div:nth-child(2) {
-      background-color: #1989fa;
-      color: #fff;
-      padding: 0.24rem 0;
-      font-size: 0.28rem;
-    }
-  }
-
-  .body_com {
-    background-color: #fff;
-    position: fixed;
-    top: 1rem;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    overflow: auto;
-    z-index: 2;
-  }
-
-  .login_button {
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius: 0.15rem;
-  }
-
-  .imgLsit img {
-    height: 100%;
-    width: 100%;
-    vertical-align: bottom;
-  }
-
-  .input_focus.login-box {
-    height: calc(100% - 0rem);
-  }
-
-  .login-box {
-    height: calc(100%);
-    position: relative;
-  }
-
-  .login-box-parent .van-field__icon .van-icon {
-    color: #4b0;
-  }
-
-  .login-form-box-bg {
-    position: absolute;
-    top: -0.4rem;
-    left: 0;
-    width: 100%;
-    height: 3.4rem;
-    color: #26a2ff;
-  }
-
-  .login_logo {
-    position: relative;
-    display: block;
-    margin: -1.45rem auto;
-    width: 3.6rem;
-    color: #fff;
-    margin-bottom: 0rem;
-    z-index: 1;
-  }
-
-  .setp1,
-  .setp2 {
-    padding-bottom: 0.5rem;
-  }
-
-  .login-box-parent .mint-cell.cell-last:before {
-    bottom: 0;
-  }
-
-  .login-box .van-cell[data-v-1a0d0fb5]:not(:last-child)::after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(0.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .login-form-box .tel {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .tel .login_tel {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.06rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  .login-box .login-form-box .psw {
-    font-size: 0.32rem;
-    margin-bottom: 0.16rem;
-    padding: 0.2rem 0.32rem;
-    line-height: 0.5rem;
-  }
-
-  .login-box .login-form-box .psw .login_pwd {
-    width: 0.37rem;
-    height: 0.37rem;
-    color: #b8b8b8;
-    margin-top: -0.05rem;
-    margin-left: -0.06rem;
-    padding-right: 0rem;
-    border-right: none;
-  }
-
-  /deep/ .login-box input {
-    font-size: 0.4rem !important;
-    color: #1c1c1c;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-webkit-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box input:-ms-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box ::-moz-input-placeholder {
-    font-size: 0.32rem;
-    color: #b8b8b8 !important;
-    letter-spacing: 0.005rem;
-  }
-
-  // .login-box .field-focus ::-webkit-input-placeholder{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box input:-ms-input-placeholder {
-  //    color:#238cf9 !important;
-  //  }
-  // .login-box .field-focus ::-moz-input-placeholder {
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_tel{
-  //   color:#238cf9 !important;
-  // }
-  // .login-box .field-focus .login_pwd {
-  //   color:#238cf9 !important;
-  // }
-  .login-box .van-hairline--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(0.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  .login-box .van-hairline-unset--top-bottom:after {
-    border: none;
-    border-bottom: 0.02rem #efefef solid;
-    transform: scaleY(0.5);
-    left: 0.32rem;
-    right: 0.32rem;
-  }
-
-  // /deep/ .login-box .field-focus:after {
-  //   border-bottom: 0.02rem #238cf9 solid !important;
-  // }
-  .login-box .van-row {
-    margin-top: 0.08rem;
-    font-size: 0.28rem;
-  }
-
-  .login-box .van-row .van-col:not(:last-child) {
-    color: #9e9da3;
-  }
-
-  .login-box .van-row .van-col {
-    color: #28a2f1;
-    letter-spacing: 0.005rem;
-  }
-
-  .login-box .login_button {
-    height: 1rem;
-    line-height: 0.8rem;
-    border-radius: 0.04rem;
-  }
-
-  .footer {
-    font-size: 0.28rem;
-    line-height: 1rem;
-    text-align: center;
-    letter-spacing: 0.005rem;
-    margin-bottom: 0.5rem;
-  }
-
-  .footer a {
-    color: #1989fa;
-  }
-</style>

+ 0 - 0
course/login.vue


+ 19 - 0
src/api/courseLogin.js

@@ -0,0 +1,19 @@
+
+import axiosKc from '@/utils/axiosKc'
+import axios from '@/utils/axios'
+import {returnJSEncrypt} from '@/utils/auth'
+// export function get_site_info() {
+//     return axiosUser('get', '/api/pro/site/info')
+//   }
+  
+//   export function get_account_info() {
+//     return axiosKc('post', '/api/pro/account/info')
+//   }
+  
+//   export function get_dept_tree() {
+//     return axiosKc('get', '/api/pro/department/tree', '', 'v2')
+//   }
+  
+//   export function getUserInfo() {
+//     return axiosKc('get', '/api/pro/employee/detail')
+//   }

+ 287 - 0
src/course/courseManage/create.vue

@@ -0,0 +1,287 @@
+<!-- 角色创建/修改 -->
+
+<template>
+  <div class="pjc">
+    <h3>{{ title }}</h3>
+    <el-form v-model="courseDeail" label-width="110px">
+      <el-form-item label="课程名称:">
+        <el-input v-model.trim="role.roleName"></el-input>
+      </el-form-item>
+      <el-form-item label="预览图:"> </el-form-item>
+      <el-form-item label="价格:">
+        <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+      </el-form-item>
+      <el-form-item label="是否上架:">
+        <el-switch
+          v-model="value"
+          active-color="#13ce66"
+          inactive-color="#ff4949"
+        >
+        </el-switch>
+      </el-form-item>
+      <el-form-item label="课程介绍:">
+        <el-input
+          type="textarea"
+          :rows="2"
+          placeholder="请输入内容"
+          v-model="textarea"
+        >
+        </el-input>
+      </el-form-item>
+      <el-form-item label>
+        <el-button @click="iffirm">{{ alterCreate }}</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+export default {
+  name: "roleCreate",
+  data() {
+    return {
+      title: "",
+      alterCreate: "确认",
+      operate: [
+        {
+          code: 1,
+          name: "默认权限",
+        },
+        {
+          code: 2,
+          name: "角色管理-全部",
+        },
+        {
+          code: 3,
+          name: "用户管理-全部",
+        },
+        {
+          code: 4,
+          name: "组件管理-全部",
+        },
+        {
+          code: 5,
+          name: "布局管理-全部",
+        },
+        {
+          code: 6,
+          name: "项目管理-全部",
+        },
+      ],
+      ui: [
+        {
+          code: 1,
+          name: "默认权限",
+        },
+        {
+          code: 2,
+          name: "角色管理-全部",
+        },
+        {
+          code: 3,
+          name: "用户管理-全部",
+        },
+        {
+          code: 4,
+          name: "组件管理-全部",
+        },
+        {
+          code: 5,
+          name: "布局管理-全部",
+        },
+        {
+          code: 6,
+          name: "项目管理-全部",
+        },
+      ],
+      route: [
+        {
+          code: "1",
+          name: "默认权限",
+        },
+        {
+          code: "2",
+          name: "角色管理-全部",
+        },
+        {
+          code: "3",
+          name: "用户管理-全部",
+        },
+        {
+          code: "4",
+          name: "组件管理-全部",
+        },
+        {
+          code: "5",
+          name: "布局管理-全部",
+        },
+        {
+          code: "6",
+          name: "项目管理-全部",
+        },
+      ],
+      courseDeail: {
+        id: 0,
+        name: "",
+      },
+      roleShift: "",
+    };
+  },
+  computed: {},
+  methods: {
+    //字符串转换成数组并传值给role
+    toRole(res) {
+      let roleShift = res;
+      //全局方法中的字符串转化成数组并去除空格
+      roleShift.operateSetting = this.$globalf.stringToArr(
+        roleShift.operateSetting
+      );
+      roleShift.uiSetting = this.$globalf.stringToArr(roleShift.uiSetting);
+      roleShift.routeSetting = this.$globalf.stringToArr(
+        roleShift.routeSetting
+      );
+      this.role = roleShift;
+    },
+    //数组转换成字符串
+    toRoleShift(res) {
+      let roleShift = JSON.parse(JSON.stringify(res));
+      //全局方法中的数组转化成字符串并去除空格
+      roleShift.operateSetting = this.$globalf.arrToString(
+        roleShift.operateSetting
+      );
+      roleShift.uiSetting = this.$globalf.arrToString(roleShift.uiSetting);
+      roleShift.routeSetting = this.$globalf.arrToString(
+        roleShift.routeSetting
+      );
+      return roleShift;
+    },
+    //保存修改
+    iffirm() {
+      if (
+        !this.role.roleName == "" &&
+        !this.role.operateSetting.length == 0 &&
+        !this.role.routeSetting.length == 0 &&
+        !this.role.uiSetting.length == 0
+      ) {
+        this.$confirm("确定保存当前页面信息?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(() => {
+            if (this.$route.params.id) {
+              this.saveAlter();
+            } else {
+              this.saveCreate();
+            }
+          })
+          .catch(() => {
+            this.$message({
+              type: "info",
+              message: "已取消",
+            });
+          });
+      } else {
+        this.$message({
+          type: "warning",
+          message: "用户信息未填写完整!",
+        });
+      }
+    },
+    //修改角色保存post
+    saveAlter() {
+      this.$api.role
+        .saveOne(this.$route.params.id, this.toRoleShift(this.role))
+        .then((res) => {
+          if (res.data.code == 200) {
+            this.$message({
+              type: "success",
+              message: res.data.message,
+            });
+            setTimeout(() => {
+              this.$router.push("/index/role");
+            }, 10);
+          } else {
+            this.$message({
+              type: "warning",
+              message: res.data.message,
+            });
+          }
+        });
+    },
+    //新建角色保存post
+    saveCreate() {
+      this.$api.role
+        .create(this.toRoleShift(this.role))
+        .then((res) => {
+          if (res.data.code == 200) {
+            this.$message({
+              type: "success",
+              message: res.data.message,
+            });
+            setTimeout(() => {
+              this.$router.push("/index/role");
+            }, 10);
+          } else {
+            this.$message({
+              type: "warning",
+              message: res.data.message,
+            });
+          }
+        })
+        .catch((error) => {});
+    },
+    //判断新建/修改
+    judge() {
+      if (this.$route.params.id == undefined) {
+        this.title = "创建新角色";
+        this.alterCreate = "确认新建";
+      } else {
+        this.title = "修改角色信息";
+        this.alterCreate = "确认修改";
+      }
+      // this.getOneAccount();
+      // this.getOpAuthority();
+    },
+    //获取单个角色信息
+    getOneAccount() {
+      this.$api.role
+        .getOne(this.$route.params.id)
+        .then((res) => {
+          this.toRole(res.data.result);
+        })
+        .catch((error) => {});
+    },
+  },
+  created() {
+    this.judge();
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.pjc {
+  width: 550px;
+  height: auto;
+  margin: 0 auto;
+  margin-top: 30px;
+  h3 {
+    color: #000;
+    text-align: center;
+    margin: 30px 0;
+  }
+  form {
+    legend {
+      font-size: 20px;
+      color: #000;
+      line-height: 30px;
+      font-weight: bold;
+      margin-bottom: 22px;
+    }
+    .el-form-item {
+      .el-select {
+        width: 380px;
+      }
+    }
+  }
+}
+</style>

+ 128 - 0
src/course/courseManage/home.vue

@@ -0,0 +1,128 @@
+<template>
+  <div class="page">
+    <el-header height="">
+      <el-button type="primary" size="default" @click="" plain
+        >+ 添加课程</el-button
+      >
+    </el-header>
+    <el-container class="course_data">
+      <el-table :data="courseList" border stripe highlight-current-row>
+        <el-table-column prop="name" label="课程名称" align="center">
+        </el-table-column>
+        <el-table-column label="价格" align="center">
+          <template slot-scope="scope"> ¥{{ scope.row.price }} </template>
+        </el-table-column>
+        <el-table-column label="课程名称" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.isRaking ? "是" : "否" }}
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" label="操作" width="250" align="center">
+          <template slot-scope="scope">
+            <el-button size="mini" @click="courseEdit(scope.row,scope.$index)"
+              >编辑</el-button
+            >
+            <el-button
+              size="mini"
+              type="danger"
+              @click="courseDel(scope.row,scope.$index)"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="proness">
+        <el-pagination
+          background
+          layout="prev, pager, next"
+          @prev-click="prevPage()"
+          @next-click="nextPage()"
+          @current-change="curPageChange()"
+          :current-page.sync="page.cur"
+          :page-size="page.size"
+          :total="page.total"
+          :hide-on-single-page="false"
+        >
+        </el-pagination>
+      </div>
+    </el-container>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "",
+  components: {},
+  props: [],
+  data() {
+    return {
+      page:{
+        total:1000,
+        size:10,
+        cur:1
+      },
+      courseList: [
+        {
+          id: 123455,
+          name: "课程精讲1",
+          price: 598,
+          isRaking: true,
+        },
+        {
+          id: 123453,
+          name: "课程精讲2",
+          price: 698,
+          isRaking: true,
+        },
+        {
+          id: 123452,
+          name: "课程精讲3",
+          price: 798,
+          isRaking: false,
+        },
+        {
+          id: 123451,
+          name: "课程精讲4",
+          price: 898,
+          isRaking: true,
+        },
+      ],
+    };
+  },
+  created() {},
+  methods: {
+    prevPage(){
+      console.log(this.page)
+    },
+    nextPage(){
+      console.log(this.page)
+    },
+    curPageChange(){
+      console.log(this.page)
+    },
+    courseEdit(row) {
+      console.log(row);
+    },
+    courseDel(row) {
+      console.log(row);
+    },
+  },
+  computed: {},
+};
+</script>
+<style scoped lang="scss">
+.page {
+  padding: 15px;
+  background-color: #fff;
+  border-radius: 5px;
+  .course_data {
+    margin-top: 25px;
+    display: block;
+    .proness {
+      margin-top: 20px;
+      display: flex;
+      justify-content: center;
+    }
+  }
+}
+</style>

+ 24 - 0
src/course/dealerManage/home.vue

@@ -0,0 +1,24 @@
+<template>
+<div>
+    dealerManage
+</div>
+</template>
+
+<script>
+export default {
+  name: '',
+  components: {},
+    props: [],
+  data () {
+    return {
+    }
+  },
+  created () { },
+  mounted () { },
+  methods: { },
+  computed: {}
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 47 - 0
src/course/home.vue

@@ -0,0 +1,47 @@
+<template>
+  <div>
+    <div>
+      <div class="flex-box">
+        <div class="flex-1" style="margin-right: 10px;">
+          <div style="background-color: #fff;padding:20px;margin-bottom: 10px;" class="br-5 ">
+            <div class="flex-box-ce">
+                <div style="margin-right: 10px;">
+                  <userImage :id="course_account_info.id" :img_url="course_account_info.img_url" :user_name="course_account_info.name" width="50px" height="50px"></userImage>
+                </div>
+                <div class="flex-1">
+                  <div class="flex-box-ce" style="margin-bottom: 6px;font-size: 14px;color: #666;font-weight: 700;">
+                    <div style="font-size: 16px;font-weight: 700;padding-right:15px;" class="black">你好,{{ course_account_info.name }}</div>
+                  </div>
+                </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+</div>
+</template>
+
+<script>
+import { mapGetters, mapState } from 'vuex';
+export default {
+  name: '',
+  components: {},
+    props: [],
+  data () {
+    return {
+    }
+  },
+  created () { },
+  mounted () { },
+  methods: {
+   },
+  computed: {
+    ...mapGetters(['course_account_info'])
+  }
+}
+</script>
+<style scoped lang='scss'>
+.page{
+  background-color: #FFF;
+}
+</style>

+ 500 - 0
src/course/index.vue

@@ -0,0 +1,500 @@
+<template>
+  <div class="box-all" v-loading="loading">
+    <el-header>
+      <div class="flex-box" style="height: 60px;box-shadow: 0 1px 4px rgba(0,21,41,.08);">
+        <div  @click="homeUrl" class="logo-box flex-box flex-center-center">
+          <img v-if="course_account_info.logo_url"  :src="course_account_info.logo_url" class="logo"/>
+          <img v-else src="static/images/logo3.png" class="logo" />
+        </div>
+        <div class="flex-1 flex-box-ce" style="padding: 0 20px;" v-if="course_account_info.name">
+          <div class="left-menu">
+            <p>{{ course_account_info.name }}</p>
+          </div>
+          <div class="flex-1"></div>
+          <div class="right-menu">
+            <!-- 切换公司或退出账号 -->
+            <el-dropdown @command="logOut">
+              <span class="el-dropdown-link" style="cursor: pointer;">
+                <userImage class="user_img"  width="40px" height="40px" fontSize="14" :user_name="course_account_info.name" :img_url="course_account_info.img_url"></userImage>
+              </span>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item  v-for="(group, index) in userConcent" :key="index"  :command="group">
+                  <span v-if="group.id == 2" class="red"><i class="el-icon-warning" style="margin-right: 10px;"></i>{{ group.name }}</span>
+                </el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </div>
+        </div>
+      </div>
+    </el-header>
+    <el-container class="main">
+      <div class="main-left">
+        <div class="flex-box-v flex-center-center">
+          <template v-for="(item, index) in menuArr">
+            <div
+              class="flex-box-v menu-item"
+              v-if="item.show"
+              :class="{
+                'menu-active': menuIndex == item.index,
+                [item.class]: item.class,
+              }"
+              @click="openUrl(item)"
+            >
+              <svg-icon :icon-class="item.icon" class="svgIcon"></svg-icon>
+              <span style="margin-top: 5px">{{ item.name }}</span>
+            </div>
+          </template>
+        </div>
+      </div>
+      <el-main class="main-content">
+        <router-view />
+      </el-main>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import { mapGetters, mapState } from 'vuex';
+export default {
+  name: "",
+  components: {},
+  props: [],
+  data() {
+    return {
+      loading: false,
+      isLog:false,
+      menuIndex:1,
+      menuArr:[
+        {
+          icon:'#icon-shouye',
+          index:1,
+          name:'课程首页',
+          path:'/course',
+          show:true
+        },
+        {
+          icon:'#icon-kecheng',
+          index:2,
+          name:'课程管理',
+          path:'/course/courseManage',
+          show:true
+        },
+        {
+          icon:'#icon-xiaoshoujingxiaoshang',
+          index:3,
+          name:'经销商管理',
+          path:'/course/dealerManage',
+          show:true
+        },
+        {
+          icon:'#icon-tongji1',
+          index:4,
+          name:'统计',
+          path:'/course/statistics',
+          show:true
+        },
+        {
+          icon:'#icon-shezhi-xianxing',
+          index:5,
+          name:'管理员设置',
+          path:'/course/adminSetting',
+          show:true
+        },
+      ],
+      userConcent: [
+        { id: 2,name: '退出账号'},
+      ],
+    };
+  },
+  watch:{
+    $route(to, from) {
+      var str = to.path;
+      this.menuArr.some((item, index) => {
+          if (item.path == str) {
+            this.menuIndex =item.index;
+            this.$setCache('course_path',item.index);
+            return true;
+          }
+      });
+    },
+  },
+  created() {
+    if(this.$route.path!='/course'){
+      this.menuIndex =this.$getCache('course_path')!=1? this.$getCache('course_path'):1;
+    }
+  },
+  methods: {
+    getToken(){
+      let url = '/mkt/demo/token/wo/'
+      let wxId = '11770'
+      this.$axiosKc('get',`${url}${wxId}`).then((res)=>{
+        console.log(res)
+      })
+    },
+    logOut() {
+      this.$store.dispatch('CourseLogOut');
+    },
+    homeUrl(){
+      this.getToken()
+      // this.$router.push({ path: '/course' });
+    },
+    openUrl(item){
+      if(this.menuIndex==item.index||this.isLog){
+        return false;
+      }
+      this.isLog=true;
+      if(item){
+        this.menuIndex=item.index;
+        this.$setCache('course_path',item.index);
+        this.$router.push({ path: item.path });
+      }else{
+        this.$setCache('course_path',1);
+        this.$router.push({ path: '/course' });
+      }
+      setTimeout(()=>{
+        this.isLog=false
+      },1000);
+    },
+  },
+  computed: {
+    ...mapGetters(['course_account_info'])
+  },
+};
+</script>
+<style scoped="scoped" lang="scss">
+  .el-header-p{
+    font-size: 18px;
+    font-weight: 600;
+    line-height: 60px;
+    color: #000;
+  }
+  .icon-item{
+    margin-right: 30px;
+    cursor: pointer;
+  }
+  .icon-item:hover{
+    color: #409eff;
+  }
+ .count_max{
+   border: 1px solid #005bea;
+   border-radius: 5px;
+   padding:4px 10px;
+   color: #005bea;
+   cursor: pointer;
+ }
+
+ .menu-item{
+   width: 90px;
+   color: #ccc;
+   text-align: center;
+   padding: 10px 0;
+   cursor: pointer;
+   position: relative;
+   border-left: 3px solid #191a23;
+   transition: border-color .3s,background-color .3s,color .3s;
+ }
+ .svgIcon {
+   font-size: 16px;
+   margin: 0 auto;
+ }
+ .menu-item:hover{
+    background-color: #393b4b;
+  }
+ .menu-active{
+   background-color: #393b4b;
+   border-left: 5px solid #005bea;
+   color: #fff;
+ }
+.announDetails {
+  ::v-deep img {
+    width: 100%;
+  }
+}
+.updateNotice ::v-deep .el-dialog {
+  border-radius: 10px;
+  .el-dialog__header {
+    padding: 13px 20px;
+    text-align: center;
+    background-color: #3193fc;
+    border-radius: 8px 8px 0 0;
+    .el-dialog__title {
+      font-size: 16px;
+      color: #fff;
+    }
+    .el-icon-close {
+      color: #fff;
+    }
+  }
+  .el-dialog__body {
+    padding: 20px 20px 30px 20px;
+  }
+  .el-dialog__footer {
+    .dialog-footer {
+      .is-round {
+        padding: 10px 19px;
+        border-radius: 15px;
+      }
+    }
+  }
+}
+.navigation {
+  position: fixed;
+  right: 20px;
+  bottom: 100px;
+  z-index: 999;
+}
+.navigationBox {
+  background-color: #409eff;
+  color: #fff;
+  font-size: 12px;
+  margin-top: 20px;
+  text-align: center;
+}
+.navigationItem {
+  padding: 6px;
+  cursor: pointer;
+}
+.navigationItem:hover {
+  background-color: #005bea;
+}
+.money {
+  line-height: 32px;
+  text-align: center;
+  height: 32px;
+  color: #ff9600;
+  width: 88px;
+  background: #ffffff;
+  border: 1px solid #ff9600;
+  opacity: 1;
+  border-radius: 3px;
+  cursor: pointer;
+  margin-left: 20px;
+}
+.money2 {
+  line-height: 32px;
+  text-align: center;
+  height: 32px;
+  color: #409eff;
+  width: 120px;
+  background: #ffffff;
+  border: 1px solid #409eff;
+  opacity: 1;
+  border-radius: 3px;
+  cursor: pointer;
+  margin: 0 20px;
+  padding-left: 10px;
+}
+.innerVisible p {
+  text-align: center;
+}
+.megData div:nth-child(1) {
+  background-image: linear-gradient(to bottom, #5e6e9b 0%, #232d48 100%);
+  text-align: center;
+  color: #e1bf66;
+  border-top-left-radius: 25px;
+  border-bottom-left-radius: 25px;
+  line-height: 35px;
+  height: 35px;
+  padding: 0 10px;
+}
+.megData div:nth-child(2) {
+  background-image: linear-gradient(to bottom, #ffeab2 0%, #e1bf66 100%);
+  text-align: center;
+  color: #232d48;
+  border-top-right-radius: 25px;
+  border-bottom-right-radius: 25px;
+  line-height: 35px;
+  height: 35px;
+  padding: 0 10px;
+}
+.jx {
+  width: 140px;
+  color: #fff;
+  border-radius: 3px;
+  text-align: left;
+  box-shadow: 1px 1px 0px 0px #ccc;
+  height: 45px;
+  font-size: 16px;
+  padding-left: 36px;
+  line-height: 45px;
+  cursor: pointer;
+  font-weight: 600;
+  // border: 1px solid #409EFF;
+  border-radius: 5px;
+  background-image: linear-gradient(117deg, #00c6fb 0%, #005bea 100%);
+  margin: 0 auto;
+  margin-bottom: 10px;
+}
+.PCtutorials {
+  height: 38px;
+  width: 38px;
+  display: inline-block;
+  border-radius: 50%;
+  text-align: center;
+  font-size: 18px;
+  line-height: 38px;
+  -webkit-transition: all 0.3s;
+  -moz-transition: all 0.3s;
+  -ms-transition: all 0.3s;
+  -o-transition: all 0.3s;
+  transition: all 0.3s;
+  background-color: #409eff;
+  color: #fff;
+}
+.PCtutorials:hover {
+  box-shadow: 0 0 3px #ccc;
+}
+
+.routerActive {
+  background-color: #199afb !important;
+}
+
+.active {
+  color: #409eff;
+  background-color: rgba(38, 162, 255, 0.1);
+}
+.left-menu{
+  p{
+    font-size: 18px;
+    color: #000;
+    line-height: 60px;
+    font-weight: 600;
+  }
+}
+.right-menu {
+  float: right;
+  height: 100%;
+  display: flex;
+  align-items: center;
+
+  &:focus {
+    outline: none;
+  }
+
+  .right-menu-item {
+    display: inline-block;
+    margin: 0 8px;
+  }
+
+  .screenfull {
+    height: 20px;
+  }
+
+  .international {
+    vertical-align: top;
+  }
+
+  .theme-switch {
+    vertical-align: 15px;
+  }
+
+  .avatar-container {
+    height: 60px;
+    margin-right: 30px;
+
+    .avatar-wrapper {
+      cursor: pointer;
+      margin-top: 5px;
+      position: relative;
+
+      .user-avatar {
+        width: 40px;
+        height: 40px;
+        border-radius: 10px;
+      }
+
+      .el-icon-caret-bottom {
+        position: absolute;
+        right: -20px;
+        top: 25px;
+        font-size: 12px;
+      }
+    }
+  }
+}
+
+.el-menu-vertical-demo:not(.el-menu--collapse) {
+  width: 180px;
+}
+.el-header {
+  background-color: #fff;
+  padding: 0 !important;
+  border-bottom: 1px solid #f1f1f1;
+  min-width: 1100px;
+}
+.el-menu {
+  overflow: hidden;
+  border: none;
+}
+.con_nav_left {
+  background: #fff;
+  overflow-y: scroll;
+}
+.box-all {
+  height: 100%;
+  overflow: hidden;
+}
+.el-main {
+  background-color: #f0f4fa;
+  height: calc(100vh - 60px);
+  overflow-y: scroll;
+  padding: 10px;
+  min-width: 1100px;
+}
+// .el-main::-webkit-scrollbar {
+//   width: 8px;
+//   background-color: #fff;
+// }
+// .el-main::-webkit-scrollbar-thumb {
+//   background-color: #;
+// }
+.logo-box {
+  cursor: pointer;
+  width: 90px;
+  border-bottom: 1px solid #101117;
+  background: #191a23;
+}
+.logo-box .logo {
+  width: 30px;
+  height: 30px;
+  margin-right: 5px;
+  border-radius: 6px;
+}
+.logo-box div {
+  font-size: 16px;
+  font-weight: 600;
+}
+.wn {
+  height: 26px;
+  width: 26px;
+  margin-right: 12px;
+  cursor: pointer;
+}
+.hea-right {
+  padding: 0 20px;
+}
+.upgrade {
+  margin-left: 10px;
+  margin-right: 10px;
+}
+/deep/ .el-menu-item {
+  padding-right: 10px !important;
+}
+/deep/ .el-menu-item.is-active {
+  color: #409eff;
+  background-color: #ecf5ff;
+}
+/deep/ .el-submenu .el-menu-item {
+  min-width: 180px;
+  box-sizing: border-box;
+}
+.main-left {
+  background: #191a23;
+  -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
+  box-shadow: 2px 0 6px rgba(0,21,41,.35);
+  .flex-center-center{
+    // margin-top: 60px;
+  }
+
+}
+</style>

+ 24 - 0
src/course/setting/home.vue

@@ -0,0 +1,24 @@
+<template>
+<div>
+    setting
+</div>
+</template>
+
+<script>
+export default {
+  name: '',
+  components: {},
+    props: [],
+  data () {
+    return {
+    }
+  },
+  created () { },
+  mounted () { },
+  methods: { },
+  computed: {}
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 24 - 0
src/course/statistics/home.vue

@@ -0,0 +1,24 @@
+<template>
+<div>
+    statistics
+</div>
+</template>
+
+<script>
+export default {
+  name: '',
+  components: {},
+    props: [],
+  data () {
+    return {
+    }
+  },
+  created () { },
+  mounted () { },
+  methods: { },
+  computed: {}
+}
+</script>
+<style scoped lang='scss'>
+
+</style>

+ 531 - 0
src/course/user/login.vue

@@ -0,0 +1,531 @@
+<template>
+  <div class="login-container">
+    <div class="flex-box">
+      <div class="login-left flex-1" style="background-image: url(static/images/login-left.png);">
+        <div class="left-content">
+          <div class="logo" style="text-align: center;margin-bottom: 2%;"><img src="static/images/logo.png" /></div>
+          <el-carousel indicator-position="outside" :interval="5000">
+            <el-carousel-item style="text-align: center;font-size: 26px;color: #fff;">
+              <div style="margin-bottom: 2.2%;letter-spacing: 3px;">
+                管理执行难,就用功道云
+                <br />
+                功到自然成
+              </div>
+              <div class="flex-box-v flex-center-center" style="width: 76%;margin: 0 auto;"><img src="static/images/login1.png" style="width: 100%;" /></div>
+            </el-carousel-item>
+            <el-carousel-item style="text-align: center;font-size: 26px;color: #fff;">
+              <div style="margin-bottom: 6.5%;letter-spacing: 3px;">
+                积分赋能
+                <br />
+                成就员工价值
+              </div>
+              <div class="flex-box-v flex-center-center" style="width: 76%;margin: 0 auto;"><img src="static/images/login2.png" style="width: 100%;" /></div>
+            </el-carousel-item>
+          </el-carousel>
+          <div style="text-align: center;color: #fff;margin-top: 3%;letter-spacing: 2px;">
+            <div style="font-size: 18px;">100000+用户都选择功道云</div>
+            <img src="static/images/loginBot.png" style="width: 80%;margin: 2% 0;" />
+            <div style="font-size: 14px;">如需帮助,请拨打咨询热线:400-6877-880</div>
+          </div>
+        </div>
+      </div>
+      <div class="login-right flex-2" style="position: relative;">
+        <div class="login_input">
+          <div class="third-login-box">
+            <p class="third-account">微信扫码登录</p>
+             <div class="account-login">
+                 <a data-href="/thirdlogin/wechat.do?appId=1006" class="wechat-login" @click="openWx" style="background-image: url(static/images/wechat1.png);"></a>
+             </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <el-dialog title="微信登录" :visible.sync="isShowWxLogin" append-to-body width="500px">
+      <div>
+        <iframe :src="wxUrl" width="100%" height="400" frameborder="0"></iframe>
+        <!-- <div class="flex-box"><div @click="isShowWxLogin=false" style="color: rgb(0, 110, 255);width: 200px;text-align: center;margin: 0 auto;cursor: pointer;font-size: 16px;">账号登录 <i class="el-icon-right"></i></div></div> -->
+      </div>
+    </el-dialog>
+
+    <pastDue></pastDue>
+  </div>
+</template>
+
+<script>
+import pastDue from '@/components/pastDue.vue';
+import QRCode from 'qrcodejs2';
+import { setToken, getUser, getPasw, setUser, setPasw } from '@/utils/auth';
+import { constants } from 'fs';
+import { timestamps } from '@/utils/index';
+import { validateTel } from '@/utils/validate';
+export default {
+  data() {
+    const validatePassword = (rule, value, callback) => {
+      if (value.length < 5) {
+        callback(new Error('密码长度应至少在6位或以上'));
+      } else {
+        callback();
+      }
+    };
+    return {
+      checked: true,
+      login_icon_show: false,
+      login_type: false,
+      dialogVisible: false,
+      site_list: [],
+      loginForm: {
+        tel: '',
+        password: ''
+      },
+      loginRules: {
+        tel: [{ required: true, validator: validateTel }],
+        password: [{ required: true, validator: validatePassword }]
+      },
+      passwordType: 'password',
+      loading: false,
+      code_loading: false,
+      code_overdue: false,
+      login_code: '',
+      login_disabled: true,
+      token: '',
+      isShowWxLogin:false,
+      // wxUrl:process.env.BASE_API+'/wechat/auth/web?ct=1',
+      wxUrl:'https://oa.g107.com/wechat/auth/web?ct=1',
+
+      invite_list:{site:{}},//体验公司列表
+      isShowInvite:false,
+    };
+  },
+  components: { QRCode, pastDue },
+  methods: {
+    send(type) {
+      this.$axios('post', '/api/pro/invite/bind', { sn: this.invite_list.sn, type: type }).then(res => {
+          if(type == 2){
+            this.isShowInvite=false;
+            if (this.site_list !== null && this.site_list.length == 0) {
+              //无企业--情况
+              this.$router.push({ name: 'tySelect' });//无企业进入体验账号
+            } else if (this.site_list.length == 1) {  //但企业
+              this.loginBySite(this.site_list[0].site.id);
+            } else {  //多企业
+              this.dialogVisible = true;
+            }
+          }else{
+            this.loginBySite(this.invite_list.site.id);
+          }
+
+      });
+    },
+    openWx(){
+      this.isShowWxLogin=true;
+    },
+    loginBySite(sid) {
+      this.$axios('post', '/api/pro/employee-login', { site_id: sid }).then(res => {
+        if (res.data.code == 1) {
+          setToken(res.data.data.token);
+          this.$router.push({ path: '/' });
+        }
+      });
+    },
+    showPwd() {
+      if (this.passwordType === 'password') {
+        this.passwordType = 'text';
+      } else {
+        this.passwordType = 'password';
+      }
+    },
+    // 获取邀请详情
+    get_invite() {
+      this.$axios('get', '/api/pro/invite/waiting').then(res => {
+          let list=res.data.data;
+          if(list.length>0){
+            this.invite_list = list[0];
+            this.isShowInvite=true;
+          }
+      });
+    },
+    // 姓名登录
+    handleLogin() {
+      this.$refs.loginForm.validate(valid => {
+        if (valid) {
+          this.loading = true;
+          this.$store.dispatch('LoginByUsername', this.loginForm).then(ret => {
+            if (this.checked) {
+              // 转成DB5并保持在Cookies
+              let user = window.btoa(this.random(5) + this.loginForm.tel + this.random(5));
+              let password = window.btoa(this.random(5) + this.loginForm.password);
+              setUser(user);
+              setPasw(password);
+            }
+            this.site_list = ret.data.account_site;
+            if(ret.data.invitation_wait_count){ //有邀请通知
+              this.get_invite()
+              return false
+            }
+            if (this.site_list !== null && this.site_list.length == 0) {
+              //无企业--情况
+              this.$router.replace({ name: 'tySelect' });//无企业进入体验账号
+            } else if (this.site_list.length == 1) {  //但企业
+              this.loginBySite(this.site_list[0].site.id);
+            } else {  //多企业
+              this.dialogVisible = true;
+            }
+
+        }).finally(err => {
+          this.loading = false;
+        });
+        } else {
+          return false;
+        }
+      });
+    },
+
+    random(num) {
+      let name = [];
+      for (let i = 0; i < num; i++) {
+        name.push(Math.floor(Math.random() * 10));
+      }
+      return name.join('');
+    },
+    switchbtn() {
+      this.login_icon_show = !this.login_icon_show;
+      this.$setCache('login_code', '1');
+      this.login_code = this.$getCache('login_code');
+    },
+    get_code() {
+      this.code_loading = true;
+      this.code_overdue = false;
+      this.$axiosUser('post', '/api/pro/generate/qrcode').then(res => {
+        this.token = res.data.data.token;
+        this.$nextTick(() => {
+          this.qrcode();
+        });
+        this.get_code_info();
+      }).finally(() => {
+          this.code_loading = false;
+      });
+    },
+    get_code_info() {
+      this.$axiosUser('get', '/api/pro/scan/info', { params: { token: this.token } })
+        .then(res => {
+          if (res.data.code == 1) {
+            switch (res.data.data.code) {
+              case 400:
+                this.code_overdue = true;
+                this.$message.error(res.data.data.code_remark);
+                break;
+              case 1200:
+                setTimeout(() => {
+                  this.get_code_info();
+                }, 600);
+                break;
+              case 1201:
+                this.code_overdue = true;
+                break;
+              case 1202:
+                setTimeout(() => {
+                  this.get_code_info();
+                }, 600);
+                break;
+              case 1203:
+                setTimeout(() => {
+                  this.get_code_info();
+                }, 600);
+                break;
+              case 1204:
+                this.code_overdue = true;
+                break;
+              default:
+                alert('');
+            }
+          }
+        })
+        .finally(() => {
+          this.code_loading = false;
+        });
+    },
+
+    //  生成二维码
+    qrcode() {
+      let code = this.$serverdomain + '/#/login_token?' + this.token;
+      let qrcode = new QRCode('qrcode', {
+        width: 200,
+        height: 200, // 高度
+        text: code // 二维码内容
+        // render: 'canvas' ,   // 设置渲染方式(有两种方式 table和canvas,默认是canvas)
+        // background: '#f0f',   // 背景色
+        // foreground: '#ff0'    // 前景色
+      });
+    },
+    clearData() {
+      const newNav = this.$getCache('newNav');
+      const initImg = this.$getCache('initImg');
+      const noticeId = this.$getCache('noticeId');
+      localStorage.clear();
+      sessionStorage.clear();
+      if (newNav) {
+        this.$setCache('newNav', true);
+      }
+      if (initImg) {
+        this.$setCache('initImg', true);
+      }
+      if (noticeId) {
+        this.$setCache('noticeId', noticeId);
+      }
+    }
+  },
+  watch: {
+    login_code(val) {
+      if (val == '1') {
+        this.get_code();
+      }
+    },
+    loginForm: {
+      handler(newV, oldV) {
+        if (newV.tel != '' && newV.tel != '') {
+          this.login_disabled = false;
+        } else {
+          this.login_disabled = true;
+        }
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+  created() {
+    this.clearData(); //进入登录界面,清除本地缓存,主要是避免用户意外清除cookies后造成本地缓存依然存在,重新登陆后显示上次的缓存,或特殊情况本地缓存未清空又登录别的账号。
+    var lett = this;
+    document.onkeydown = function(e) {
+      var key = window.event.keyCode;
+      if (key == 13) {
+        lett.handleLogin();
+      }
+    };
+    document.title = '功道云-积分系统用户登录';
+    this.$setCache('login_code', '0');
+  },
+  mounted() {
+    if (getUser()) {
+      let getuser = window.atob(getUser());
+      this.loginForm.tel = getuser.substr(5, 11);
+    }
+    if (getPasw()) {
+      let getpasw = window.atob(getPasw());
+      this.loginForm.password = getpasw.slice(5);
+    }
+  },
+  destroyed() {
+    this.$setCache('login_code', '0');
+  }
+};
+</script>
+
+<style rel="stylesheet/css" type="text/css" scoped>
+.third-login-box {
+  position: absolute;
+  top: 400px;
+  left: 0;
+  right: 0;
+}
+.third-account {
+    text-align: center;
+    margin-bottom: 15px;
+    color: #999999;
+}
+.account-login {
+    text-align: center;
+}
+.wechat-login{
+    width: 100px;
+    height: 100px;
+    background-color: #dddddd;
+    background-repeat: no-repeat;
+    background-position: center;
+    border-radius: 50%;
+    cursor: pointer;
+}
+.wechat-login:hover{
+    background-color: #67c23a;
+}
+.account-login a {
+    display: inline-block;
+}
+
+
+
+@media screen and (min-width: 1601px) {
+  .left-content {
+    height: 800px;
+    position: relative;
+    top: 50%;
+    margin-top: -400px;
+  }
+  /deep/ .el-carousel__container {
+    position: relative;
+    height: 460px;
+  }
+}
+/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度*/
+@media screen and (max-width: 1600px) {
+  .left-content {
+    height: 680px;
+    position: relative;
+    top: 50%;
+    margin-top: -340px;
+  }
+  /deep/ .el-carousel__container {
+    position: relative;
+    height: 330px;
+  }
+}
+.login-left {
+  min-width: 500px;
+  min-height: 700px;
+  height: 100vh;
+  /* background: url('/static/images/login-left.png') no-repeat; */
+  background-repeat: no-repeat;
+  background-size: 100% 100%;
+  position: relative;
+  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/static/images/login-left.png', sizingMethod='scale');
+  -ms-behavior: url('/static/images/login-left.png');
+  behavior: url('/static/images/login-left.png');
+}
+/deep/ .el-carousel__indicators--outside {
+  text-align: center;
+  position: static;
+  -webkit-transform: none;
+  transform: none;
+  /* margin-top: 20px; */
+}
+/deep/ .el-carousel__button {
+  height: 8px;
+  width: 8px;
+  border-radius: 100%;
+  background-color: #fff;
+}
+/deep/ .is-active .el-carousel__button {
+  width: 30px;
+  border-radius: 5px;
+  background-color: #fff;
+}
+
+
+
+
+
+.login_input {
+  position: relative;
+  text-align: center;
+  width: 508px;
+  height: 376px;
+  background: #fff;
+  /* overflow: hidden; */
+  top: 0;
+  margin: 0 auto 0 auto;
+}
+.login-form {
+  width: 380px;
+  margin: 0 auto;
+  /* margin-top: 75px; */
+}
+
+.login-form /deep/ input:-webkit-autofill {
+  -webkit-box-shadow: 0 0 0 1000px white inset !important;
+}
+
+.title-container {
+  font-size: 22px;
+  font-weight: bold;
+  padding: 30px 0;
+  text-align: left;
+}
+
+.title-container img {
+  margin-top: 38px;
+  width: 100%;
+  height: auto;
+}
+
+.login-form .login_tel {
+  display: block;
+  margin-bottom: 24px;
+  border: none;
+  border-bottom: 1px solid #c0c4cc;
+}
+
+.login-form .login_tel .label {
+  display: inline-block;
+  text-align: left;
+  width: 12%;
+  font-size: 18px;
+  color: #303133;
+  line-height: 26px;
+  padding: 0;
+  margin: 12px 0;
+  float: left;
+}
+
+.login-form .login_tel .input_tel {
+  display: inline-block;
+  width: 88%;
+  margin: 12px auto;
+  height: 24px;
+  line-height: 24px;
+  border-left: 1px #efefef solid;
+  float: right;
+}
+
+.login-form .login_tel .input_tel /deep/ input {
+  padding: 0 0% 0 4%;
+  margin: 0;
+  font-size: 18px;
+  height: 24px;
+  line-height: 24px;
+  border: none !important;
+}
+
+.login-form .login_tel /deep/ .el-input__suffix {
+  top: -6px;
+  right: 0px;
+}
+
+.login-form .login_pwd {
+  border: none;
+  border-bottom: 1px solid #c0c4cc;
+}
+
+.login-form .login_pwd .el-input /deep/ input {
+  padding: 0;
+  margin: 0;
+  font-size: 18px;
+  height: 24px;
+  line-height: 24px;
+  border: none;
+}
+
+.login-form .login_pwd .show-pwd {
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+
+.login-form .login_pwd /deep/ .el-input__suffix {
+  right: 20px;
+}
+.login-form /deep/ input::-webkit-input-placeholder {
+  color: #909399;
+  letter-spacing: 1px;
+}
+
+.login-form /deep/ input:focus::-webkit-input-placeholder {
+  color: #006eff;
+}
+
+.login-form .el-form-item__error {
+  margin: 2px auto;
+}
+
+.login-container {
+  height: 100%;
+}
+</style>

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
src/icons/iconfont.js


+ 2 - 0
src/main.js

@@ -20,6 +20,7 @@ import * as filters from '@/utils/filters'
 import axiosKq from '@/utils/axiosKq'
 import axiosUser from '@/utils/axiosUser'
 import axios from '@/utils/axios'
+import axiosKc from '@/utils/axiosKc'
 import * as socketApi from './api/websocket'
 import * as socketApiTow from './api/websocketTow'
 import ECharts from 'echarts';
@@ -41,6 +42,7 @@ Vue.prototype.$echarts = ECharts
 Vue.prototype.$axios = axios
 Vue.prototype.$axiosUser = axiosUser
 Vue.prototype.$axiosKq = axiosKq
+Vue.prototype.$axiosKc = axiosKc
 Vue.prototype.$moment = moment
 Vue.prototype.$getToken = getToken
 Vue.prototype.$serveAd = process.env.SERVE_AD

+ 1 - 1
src/permission.js

@@ -10,7 +10,7 @@ NProgress.configure({
 })
 
 // 免登名单
-const whiteList = ['/login','/loginbytoken','/reg','/forgetPwd','/resetPwd','/android','/bindingPhone','/demo','/swiperShow', '/weixin','/screen','/screenSan','/tySelect']
+const whiteList = ['/login','/loginbytoken','/course','/courseLogin','/reg','/forgetPwd','/resetPwd','/android','/bindingPhone','/demo','/swiperShow', '/weixin','/screen','/screenSan','/tySelect']
 
 router.beforeEach((to, from, next) => {
   if (Vue.$axiosUserRequestList.length > 0) { // 强行中断时才向下执行

+ 39 - 0
src/router/course.js

@@ -0,0 +1,39 @@
+// 在线课程相关
+const routes = [
+    {
+        path: '/',
+        name: 'courseHome',
+        component: () => import('@/course/home'),
+        label: '课程营销首页',
+        meta: {},
+    },
+    {
+        path: 'courseManage',
+        name: 'courseManage',
+        component: () => import('@/course/courseManage/home'),
+        label: '课程管理',
+        meta: {},
+    },
+    {
+        path: 'dealerManage',
+        name: 'dealerManage',
+        component: () => import('@/course/dealerManage/home'),
+        label: '经销商管理',
+        meta: {},
+    },
+    {
+        path: 'statistics',
+        name: 'courseManage',
+        component: () => import('@/course/statistics/home'),
+        label: '统计',
+        meta: {},
+    },
+    {
+        path: 'adminSetting',
+        name: 'adminSetting',
+        component: () => import('@/course/setting/home'),
+        label: '管理员设置',
+        meta: {},
+    }
+]
+export default routes

+ 19 - 4
src/router/index.js

@@ -4,6 +4,7 @@ import VueRouter from 'vue-router'
 import performanceRouter from '@/router/performanceRouter'
 import okrRouter from '@/router/okrRouter'
 import examineRouter from '@/router/examineRouter'
+import courseRouter from '@/router/course'
 /* 角色*/
 /*
 创始人 creator
@@ -186,7 +187,7 @@ const constantRouterMap = [
             }
           },
           {
-           	path: '/allTask',
+            path: '/allTask',
             name: '全部任务',
             component: () => import( /* webpackChunkName: "allTask" */ '@/point/views/workbench/task/allTask'),
             meta: {
@@ -416,7 +417,19 @@ const constantRouterMap = [
       },
     ]
   },
-
+  {
+    path: '/course',
+    name: '课程营销首页',
+    component: () => import('@/course/index'),
+    children: []
+  },
+  {
+    path: '/courseLogin',
+    name: 'courseLogin',
+    component: () => import('@/course/user/login'),
+    label: '课程营销登录',
+    meta: {},
+  },
   {
     path: '/login',
     name: 'login',
@@ -434,7 +447,7 @@ const constantRouterMap = [
   },
   {
     path: '/weixin',
-    name: 'weixin',    component: () => import('@/views/weixin'),
+    name: 'weixin', component: () => import('@/views/weixin'),
   },
   {
     path: '/reg',
@@ -487,7 +500,9 @@ const constantRouterMap = [
     redirect: '/login'
   },
 ]
-constantRouterMap[0].children.push(...performanceRouter,...okrRouter,...examineRouter);
+constantRouterMap[0].children.push(...performanceRouter, ...okrRouter, ...examineRouter);
+constantRouterMap[1].children.push(...courseRouter);
+console.log(constantRouterMap)
 export default new VueRouter({
   // mode: 'history',
   routes: constantRouterMap,

+ 5 - 0
src/store/getters.js

@@ -10,5 +10,10 @@ const getters = {
   site_info: state => state.user.site_info,
   account_info: state => state.user.account_info,
   sumTotal: state => state.okrStore.sumTotal,
+  
+  courseToken:state =>state.course.course_token,
+  course_user_info:state=>state.course.course_user_info,
+  course_site_info: state => state.course.course_site_info,
+  course_account_info: state => state.course.course_account_info,
 }
 export default getters

+ 3 - 1
src/store/index.js

@@ -2,13 +2,15 @@ import Vue from 'vue'
 import Vuex from 'vuex'
 import user from './modules/user'
 import okrStore from './modules/okrStore'
+import course from './modules/course'
 import getters from './getters'
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
   modules: {
     user,
-    okrStore
+    okrStore,
+    course
   },
   getters
 })

+ 114 - 0
src/store/modules/course.js

@@ -0,0 +1,114 @@
+import {
+    loginByUsername,
+    getUserInfo,
+    get_employee_map,
+    get_employee_map_all,
+    get_point_types,
+    get_site_info,
+    get_dept_tree,
+    get_account_info
+} from '@/api/login'
+import { removeAllToken, getCache, setCache } from '@/utils/auth'
+const courseStore = {
+    state: {
+        course_token: '',
+        course_user_info: {},
+        course_site_info: {},
+        course_account_info: {
+            "id": 2722,
+            "account_id": 183,
+            "site_id": 389,
+            "name": "郭家裕1",
+            "img_url": "",
+            "tel": "13553212681",
+            "status": 1,
+            "is_creator": 0,
+            "is_site_owner": 0,
+            "is_site_manager": 0,
+            "post": "",
+            "accedence_time": "2022-12-22",
+            "letter_index": "G",
+            "post_info": [],
+            "has_sm_scheme": 0,
+            employee_detail:
+            "wechat_bind": true
+        },//个人账号信息
+    },
+
+    mutations: {
+        SET_COURSEUSERINFO: (state, data) => {
+            state.course_user_info = data
+        },
+        SET_COURSESITEINFO: (state, data) => {
+            state.course_site_info = data
+        },
+        SET_COURSEACCOUNTINFO: (state, data) => {
+            state.course_account_info = data
+        }
+    },
+
+    actions: {
+        //公司信息
+        get_course_site_info({ commit }, isUpdate) {
+            return new Promise((resolve, reject) => {
+                const site_info = getCache('course_site_info')
+                if (site_info && !isUpdate) {
+                    commit('SET_COURSESITEINFO', site_info)
+                    resolve(site_info)
+                } else {
+                    get_course_site_info().then(response => {
+                        if (response.data.code == 1) {
+                            commit('SET_COURSESITEINFO', response.data.data)
+                            setCache('course_site_info', response.data.data)
+                            resolve(response.data.data)
+                        }
+                    }).catch(error => {
+                        reject(error)
+                    })
+                }
+            })
+        },
+        //平台信息
+        get_course_account_info({ commit }, isUpdate) {
+            return new Promise((resolve, reject) => {
+                const account_info = getCache('course_account_info')
+                if (account_info && !isUpdate) {
+                    commit('SET_COURSEACCOUNTINFO', account_info)
+                    resolve(account_info)
+                } else {
+                    get_course_account_info().then(response => {
+                        if (response.data.code == 1) {
+                            commit('SET_COURSEACCOUNTINFO', response.data.data)
+                            setCache('course_account_info', response.data.data)
+                            resolve(response.data.data)
+                        }
+                    }).catch(error => {
+                        reject(error)
+                    })
+                }
+            })
+        },
+        // 获取用户信息
+        getCourseUserInfo({ commit }) {
+            return new Promise((resolve, reject) => {
+                getUserInfo().then(response => {
+                    let data = response.data.data.user
+                    commit('SET_COURSEUSERINFO', data)
+                    setCache('course_account', data)
+                    resolve(data)
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
+        // 退出登录
+        CourseLogOut({ commit, state }) {
+            localStorage.clear()
+            sessionStorage.clear()
+            removeAllToken()
+            location.reload() // 重新刷新页面会清空VUEX数据,所以不用清空VUEX
+        },
+    }
+}
+
+export default courseStore

+ 13 - 0
src/utils/auth.js

@@ -5,6 +5,7 @@ import {
 } from 'jsencrypt'
 const publicKey = hexToDec();
 const TokenKey = 'Admin-Token'
+const CourseTokenKey = 'Course-Token'
 const USER = 'user'
 const PASW = 'pasw'
 
@@ -187,6 +188,11 @@ export function getUserData() {
   return store.getters.user_info || getCache('userInfo')
 }
 
+// 获取当前课程用户详情
+export function getCourseUserData() {
+  return store.getters.course_user_info || getCache('courseUserData')
+}
+
 //是否平台管理或者平台创始人
 export function getIsAdministrator() {
   var userInfo = getUserData();
@@ -257,6 +263,12 @@ export function setToken(token) {
 export function getToken() {
   return Cookies.get(TokenKey)
 }
+export function setCourseToken(token) {
+  return Cookies.set(CourseTokenKey, token)
+}
+export function getCourseToken() {
+  return Cookies.get(CourseTokenKey)
+}
 export function getUser() {
   return Cookies.get(USER)
 }
@@ -278,5 +290,6 @@ export function removeAllToken() {
   Cookies.remove('user')
   Cookies.remove('pasw')
   Cookies.remove(TokenKey)
+  Cookies.remove(CourseTokenKey)
   return true
 }

+ 176 - 0
src/utils/axiosKc.js

@@ -0,0 +1,176 @@
+import axios from 'axios'
+import {
+  Message,
+  MessageBox
+} from 'element-ui'
+import store from '@/store'
+import Router from '@/router'
+import {
+  getCache,
+  removeAllToken
+} from '@/utils/auth'
+import qs from 'qs'
+import Vue from 'vue'
+const service = axios.create({
+  baseURL: process.env.BASE_API,
+  // baseURL:'https://oa.g107.com',
+  baseURL:'https://3g954g5149.picp.vip',
+  
+  timeout: 20000,
+  headers: {
+    'Content-Type': 'application/x-www-form-urlencoded',
+    "Cache-Control": 'no-cache',
+    'pl':'b'
+  },
+  transformRequest: [function(data) {
+    return qs.stringify(data)
+  }]
+})
+
+service.interceptors.request.use(
+  config => {
+    return config
+  },
+  error => {
+    Promise.reject(error)
+  }
+)
+
+// 50008:非法的token; 50012:其他客户端登录了;  401:Token 过期了; 2000 考勤系统的token过期
+var bool = true // 五秒执行一次变量
+service.interceptors.response.use(
+  response => {
+    const res = response.data
+    if (res.code === 401) {
+      MessageBox.confirm('你已被登出,请重新登录', '确定登出', {
+        confirmButtonText: '重新登录',
+        showClose: false,
+        closeOnClickModal: false,
+        closeOnPressEscape: false,
+        showCancelButton: false,
+        type: 'warning'
+      }).then(() => {
+        store.dispatch('LogOut')
+      }).catch(() => {
+        store.dispatch('LogOut')
+      })
+      return Promise.reject(response)
+    } else if (res.code === 0) {
+      if (res.msg == '') {
+        return
+      }
+      Message({
+        message: res.msg
+      })
+      return Promise.reject(response)
+    } else if (res.code === 2001) {
+      Message({
+        message: res.msg
+      })
+      return Promise.reject(response)
+    } else if (res.code === 999) {
+      Message({
+        message: res.msg
+      })
+      return Promise.reject(response)
+    } else if (res.code === 3000) {
+      Message({
+        message: res.msg
+      })
+      return Promise.reject(response)
+    } else if (res.code === 4444) {
+      Message({
+        message: res.msg
+      })
+      return Promise.reject(response)
+    } else {
+      return response
+    }
+  },
+  error => {
+    if (error.message == 'interrupt') { // 是强制中断请求就拦截报错
+      return Promise.reject(error)
+    }
+    // 五秒内只执行一次
+    if (bool) {
+      Message({
+        message: error.message == 'timeout of 20000ms exceeded' ? '请求服务器超时,请稍后重试' : '请求网络错误,请稍后重试',
+        duration: 1 * 2000,
+        type: 'error'
+      })
+      bool = false
+      setTimeout(() => {
+        bool = true
+      }, 10000)
+    } else {
+      console.log('不执行')
+    }
+     return Promise.reject(error)
+  }
+)
+// 接口再次封装
+var CancelToken = axios.CancelToken // 中断请求
+Vue.$axiosUserRequestList = []
+export default (type, url, data, versions, Content_Type, transform,isToken) => {
+  var Accept, Token, ContentType, transformRequest = ''
+  switch (versions) {
+    case '':
+      Accept = 'application/json, text/plain, */*'
+      break
+    case undefined:
+      Accept = 'application/json, text/plain, */*'
+      break
+    case 'v2':
+      Accept = 'application/vnd.test.v2+json'
+      break
+    case 'v3':
+      Accept = 'application/vnd.test.v3+json'
+      break
+    case 'v4':
+      Accept = 'application/vnd.test.v4+json'
+      break
+  }
+  if (Content_Type == '' || Content_Type == undefined) {
+    ContentType = 'application/x-www-form-urlencoded'
+  } else {
+    ContentType = Content_Type
+  }
+  if (transform) {
+    transformRequest = transform
+  }
+  if (getCache('courseAccountToken')) {
+    Token = getCache('courseAccountToken');
+  }
+  if(isToken){
+    Token=isToken
+  }
+  return new Promise((resolve, reject) => { // 封装ajax
+    var aa = {
+      method: type,
+      url: url,
+      headers: {
+        'Accept': Accept,
+        'Content-Type': ContentType,
+        'A-TOKEN':Token
+      },
+      cancelToken: new CancelToken(c => { // 强行中断请求要用到的
+        Vue.$axiosUserRequestList.push(c)
+      })
+    }
+    var json = (type == 'get') ? Object.assign(aa, {
+      params: data
+    }, transformRequest) : Object.assign(aa, {
+      data: data
+    }, transformRequest)
+    var ajax = service(json).then(res => {
+      resolve(res)
+    }).catch(error => { // 中断请求和请求出错的处理
+      if (error.message == 'interrupt') {
+        return
+      } else {
+        reject(error)
+      }
+    })
+    return ajax
+  })
+}

+ 22 - 5
src/views/weixin.vue

@@ -116,10 +116,12 @@ export default {
       account_id: '',
       dialogVisible: false,
       account_site: [],
+      course_account_site:[],
       isShowSelect: false,
       exist:false,
       setp:1,
       wo_token:'',
+      course_wo_token:''
     };
   },
   watch: {
@@ -229,17 +231,17 @@ export default {
         }
     },
 
-    wxLogin() {
+    wxLogin(type) {
       axios({
         method: 'get',
-        url: process.env.BASE_API + '/api/pro/wo/oui',
+        url: 'https://oa.g107.com/api/pro/wo/oui',
         headers: {
           'Content-Type': 'application/x-www-form-urlencoded',
           pl: 'b',
           'A-TOKEN': this.$route.query.secret
         }
       }).then(res => {
-        if (res.data.code == 1) {
+        if (res.data.code == 1&&type==1) {
           let data=res.data.data
           this.account_site = data.account_site;
           this.wo_token=data.wo_token
@@ -252,6 +254,19 @@ export default {
             //等待用户输入手机号验证
             // this.isShowSelect = true;
           }
+        }else if (res.data.code == 1&&type==2) {
+          let data=res.data.data
+          this.account_site = data.account_site;
+          this.course_wo_token=data.wo_token
+          this.$setCache('course_account', data.account);
+          if (data.account_id !== 0) {
+            this.$setCache('courseAccountToken',data.wo_token);
+            // 已绑定平台账号
+            // this.openUrl(this.account_site);
+          } else {
+            //等待用户输入手机号验证
+            // this.isShowSelect = true;
+          }
         } else {
           this.$message.error(res.data.msg);
         }
@@ -278,8 +293,10 @@ export default {
     },
   },
   created() {
-    if (this.$route.query.secret) {
-      this.wxLogin();
+    if (this.$route.query.secret&&this.$route.query.ct !== 1) {
+      this.wxLogin(1);
+    }else{
+      this.wxLogin(2);
     }
   }
 };

BIN
static/images/wechat1.png


Неке датотеке нису приказане због велике количине промена