Browse Source

云就业免登录相关

lrf 1 year ago
parent
commit
52a329806f
3 changed files with 18 additions and 10 deletions
  1. 4 3
      layout/admin/navBar.vue
  2. 7 7
      layout/register/login.vue
  3. 7 0
      store/login.js

+ 4 - 3
layout/admin/navBar.vue

@@ -17,7 +17,7 @@
               <span class="user-name" v-else @click="toLogin">请登录</span>
             </div>
             <el-dropdown-menu class="user-dropdown" slot="dropdown" v-if="user && user.userid">
-              <el-dropdown-item :divided="true" command="weixin"> <img :src="weixin" style="zoom:0.1" /> 绑定/更绑微信 </el-dropdown-item>
+              <!-- <el-dropdown-item :divided="true" command="weixin"> <img :src="weixin" style="zoom:0.1" /> 绑定/更绑微信 </el-dropdown-item> -->
               <el-dropdown-item :divided="true" icon="el-icon-key" command="passwd">
                 修改密码
               </el-dropdown-item>
@@ -83,8 +83,10 @@ export default {
   },
   methods: {
     ...mapMutations(['deleteUser', 'changeOption']),
-    ...mapActions(['login', 'update', 'getQrcode']),
+    ...mapActions(['login', 'update', 'getQrcode', 'logout']),
     async toLogout() {
+      // 云就业退出
+      await this.logout(this.user.id);
       this.deleteUser();
       this.$notify({
         title: '注销成功',
@@ -124,7 +126,6 @@ export default {
           user_id = localuser.id;
         }
       }
-      console.log(user_id);
       let uri = `/api/train/auth?redirect_uri=${Vue.config.weixin.target}/confirm?uid=${user_id}&type=1&qrcode=${res}`;
       this.$set(this, `qrUri`, uri);
       this.wxDialog = true;

+ 7 - 7
layout/register/login.vue

@@ -3,11 +3,11 @@
     <el-row>
       <el-col :span="24" class="style" :style="'background: url(' + loginBei + ')no-repeat center center;'">
         <el-col :span="24" class="login">
-          <el-col :span="16" class="left">
+          <el-col :span="24" class="left">
             <el-image class="image" :src="logoUrl"></el-image>
             <p class="title">吉林省高等学校毕业生就业信息网</p>
           </el-col>
-          <el-col :span="8" class="right">
+          <!-- <el-col :span="8" class="right">
             <el-col :span="24" class="title">
               {{ title }}
             </el-col>
@@ -33,7 +33,7 @@
                 </el-tab-pane>
               </el-tabs>
             </el-col>
-          </el-col>
+          </el-col> -->
         </el-col>
       </el-col>
     </el-row>
@@ -43,9 +43,9 @@
 <script>
 import Vue from 'vue';
 import '@frame/plugins/setting';
-import qrcode from '@frame/components/qrcode.vue';
+// import qrcode from '@frame/components/qrcode.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-import dataForm from '@frame/components/form';
+// import dataForm from '@frame/components/form';
 import _ from 'lodash';
 const { mapActions } = createNamespacedHelpers('login');
 export default {
@@ -55,7 +55,7 @@ export default {
     title: { type: String, default: '培训会系统登录' },
     type: { type: String, default: '0' },
   },
-  components: { dataForm, qrcode },
+  // components: { dataForm, qrcode },
   data: () => ({
     loginBei: require('../../assets/bg.jpg'),
     activeName: 'first',
@@ -75,7 +75,7 @@ export default {
     loading: true,
   }),
   created() {
-    this.toConnection();
+    // this.toConnection();
   },
   computed: {},
   methods: {

+ 7 - 0
store/login.js

@@ -14,11 +14,18 @@ const api = {
   wxCheck: `/api/train/wxcheck`,
   wxLogin: `/api/train/wxlogin`,
   openidLogin: `/api/train/openidLogin`,
+  logout: '/api/train/y/logout',
 };
 const state = () => ({});
 const mutations = {};
 
 const actions = {
+  // 云就业退出
+  async logout({ commit }, payload) {
+    const res = await this.$axios.get(`${api.logout}?id=${payload}`);
+    return res;
+  },
+
   /**
     user:Object required 登陆信息 
     router:router 如果跳转就传