lrf402788946 5 سال پیش
والد
کامیت
1238ab19b8
3فایلهای تغییر یافته به همراه10 افزوده شده و 11 حذف شده
  1. 7 1
      src/layout/layout-part/heads.vue
  2. 2 6
      src/views/login/login.vue
  3. 1 4
      vue.config.js

+ 7 - 1
src/layout/layout-part/heads.vue

@@ -24,7 +24,7 @@
           <el-link class="el-icon-edit-outline info_icon">修改密码</el-link>
           <el-link class="el-icon-edit-outline info_icon">修改密码</el-link>
         </a>
         </a>
         <span class="mr14">|</span>
         <span class="mr14">|</span>
-        <a href="" style="color: #333;"
+        <a @click="logout" style="color: #333;"
           ><span class="el-icon-switch-button info_icon"></span>
           ><span class="el-icon-switch-button info_icon"></span>
           &nbsp;退出
           &nbsp;退出
         </a>
         </a>
@@ -99,6 +99,12 @@ export default {
         this.dialog = false;
         this.dialog = false;
       }
       }
     },
     },
+    logout() {
+      sessionStorage.removeItem('token');
+      sessionStorage.removeItem('user');
+      this.setUser(undefined);
+      this.$router.push('/login');
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 2 - 6
src/views/login/login.vue

@@ -117,9 +117,7 @@ export default {
     input3: '',
     input3: '',
     dialogFormVisible: false,
     dialogFormVisible: false,
     checked: false,
     checked: false,
-    form: {
-      name: '',
-    },
+    form: {},
     formLabelWidth: '60px',
     formLabelWidth: '60px',
   }),
   }),
   created() {
   created() {
@@ -138,9 +136,7 @@ export default {
     },
     },
     async submit(wxtoken) {
     async submit(wxtoken) {
       let data = JSON.parse(JSON.stringify(this.form));
       let data = JSON.parse(JSON.stringify(this.form));
-      if (this.loginType === 0) {
-        data.account = `${data.account}@999991`;
-      } else {
+      if (this.loginType !== 0) {
         data = { wxtoken: wxtoken };
         data = { wxtoken: wxtoken };
       }
       }
       let result = await this.corpLogin({ type: this.loginType, data: data });
       let result = await this.corpLogin({ type: this.loginType, data: data });

+ 1 - 4
vue.config.js

@@ -1,7 +1,7 @@
 const path = require('path');
 const path = require('path');
 const resumeSrc = path.resolve(__dirname, '../web-common');
 const resumeSrc = path.resolve(__dirname, '../web-common');
 module.exports = {
 module.exports = {
-  publicPath: process.env.NODE_ENV === 'development' ? '/' : '/www',
+  publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
   configureWebpack: config => {
   configureWebpack: config => {
     Object.assign(config, {
     Object.assign(config, {
       // 开发生产共同配置
       // 开发生产共同配置
@@ -21,12 +21,10 @@ module.exports = {
     proxy: {
     proxy: {
       '/api': {
       '/api': {
         target: 'http://smart.cc-lotus.info',
         target: 'http://smart.cc-lotus.info',
-        changeOrigin: true,
         ws: true,
         ws: true,
       },
       },
       '/files': {
       '/files': {
         target: 'http://smart.cc-lotus.info',
         target: 'http://smart.cc-lotus.info',
-        changeOrigin: true,
         ws: true,
         ws: true,
       },
       },
       '/ws': {
       '/ws': {
@@ -35,7 +33,6 @@ module.exports = {
       },
       },
       '/weixin': {
       '/weixin': {
         target: 'http://smart.cc-lotus.info',
         target: 'http://smart.cc-lotus.info',
-        changeOrigin: true,
         ws: true,
         ws: true,
       },
       },
     },
     },