소스 검색

'飞书跳转'

魏志佳 5 년 전
부모
커밋
3da585e2bc
7개의 변경된 파일166개의 추가작업 그리고 23개의 파일을 삭제
  1. BIN
      dist.zip
  2. 7 1
      src/config/router.config.js
  3. 1 1
      src/permission.js
  4. 10 13
      src/store/modules/user.js
  5. 145 0
      src/views/user/FStransfer.vue
  6. 0 1
      src/views/user/transferLocal.vue
  7. 3 7
      vue.config.js

BIN
dist.zip


+ 7 - 1
src/config/router.config.js

@@ -59,7 +59,12 @@ export const constantRouterMap = [
         path: 'layer',
         name: 'layer',
         component: () => import(/* webpackChunkName: "user" */ '@/views/user/layer')
-      }
+      },
+      {
+        path: 'FStransfer',
+        name: 'FStransfer',
+        component: () => import(/* webpackChunkName: "fail" */ '@/views/user/FStransfer')
+      },
     ]
   },
 
@@ -85,4 +90,5 @@ export const constantRouterMap = [
     name: 'errorPage',
     component: () => import(/* webpackChunkName: "fail" */ '@/views/errorPage')
   },
+  
 ]

+ 1 - 1
src/permission.js

@@ -10,7 +10,7 @@ import {generateIndexRouter} from "@/utils/util"
 NProgress.configure({showSpinner: false}) // NProgress Configuration
 
 
-const whiteList = ['/user/login', '/user/register', '/user/register-result', '/user/alteration','/user/transfer-local','/errorPage','http://192.168.0.111:8088/jeecg-boot/sys/feishu/url'] // no redirect whitelist
+const whiteList = ['/user/login', '/user/register', '/user/register-result', '/user/alteration','/user/transfer-local','/errorPage','http://192.168.0.111:8088/jeecg-boot/sys/feishu/url','/user/FStransfer'] // no redirect whitelist
 
 router.beforeEach((to, from, next) => {
   NProgress.start() // start progress bar

+ 10 - 13
src/store/modules/user.js

@@ -50,8 +50,7 @@ const user = {
             commit('SET_TOKEN', result.token)
             commit('SET_INFO', userInfo)
             commit('SET_NAME', {username: userInfo.username, realname: userInfo.realname, welcome: welcome()})
-            commit('SET_AVATAR', userInfo.avatar)
-            
+            commit('SET_AVATAR', userInfo.avatar)           
             resolve(response)
           } else {
             reject(response)
@@ -61,17 +60,15 @@ const user = {
     },
     //企业微信登录
     wxLogin({commit}, userInfos) {
-
-              const result = userInfos.result
-              const userInfo = result.userInfo
-              Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
-              Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
-              Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
-              commit('SET_TOKEN', result.token)
-              commit('SET_INFO', userInfo)
-              commit('SET_NAME', {username: userInfo.username, realname: userInfo.realname, welcome: welcome()})
-              commit('SET_AVATAR', userInfo.avatar)
-
+        const result = userInfos.result
+        const userInfo = result.userInfo
+        Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
+        Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
+        Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
+        commit('SET_TOKEN', result.token)
+        commit('SET_INFO', userInfo)
+        commit('SET_NAME', {username: userInfo.username, realname: userInfo.realname, welcome: welcome()})
+        commit('SET_AVATAR', userInfo.avatar)
       },
     //手机号登录
     PhoneLogin({commit}, userInfo) {

+ 145 - 0
src/views/user/FStransfer.vue

@@ -0,0 +1,145 @@
+<template>
+    <div>
+        <div style="margin:100px 0">
+    <div style="text-align:center;width:300%;margin-left:-100%;font-size:30px" class="bounce">
+      
+      <span class="letter">飞</span>
+      <span class="letter">书</span>
+      <span class="letter">登</span>
+      <span class="letter">录</span>
+      <span class="letter">中</span>
+      <span class="letter">,</span>
+    
+      <span class="letter">请</span>
+      <span class="letter">稍</span>
+      <span class="letter">候</span>
+    </div>
+  </div>
+    </div>
+</template>
+
+<script>
+import { getAction,postAction } from '@/api/manage'
+import { mapActions } from 'vuex'
+import { timeFix } from '@/utils/util'
+export default {
+    data() {
+        return {
+            code:'',
+            state:'',
+        }
+    },
+    methods: {      
+      ...mapActions(['Login', 'Logout', 'PhoneLogin', 'wxLogin']),
+        login(values) {
+            this.wxLogin(values)
+            this.loginSuccess()
+        },
+        requestFailed(err) {
+            this.$notification['error']({
+                message: '登录失败',
+                description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
+                duration: 4
+            })
+            this.loginBtn = false
+        },
+        loginSuccess() {
+            this.$router.push({ name: 'dashboard' })
+            this.$notification.success({
+                message: '欢迎',
+                description: `${timeFix()},欢迎回来`
+            })
+        }
+    },
+    mounted() {
+        console.log(this.$route.query)
+        this.code=this.$route.query.code;
+        this.state=this.$route.query.state;
+        if(!this.code){
+            this.code='code'
+        }
+        getAction('sys/feishu/auth',{
+            code:this.code,
+            state:this.state
+        }).then((res)=>{
+            console.log(res)
+            if(res.success){
+                if(res.result.type){
+                    window.location.href=res.result.url;
+                }else{
+                    this.login(res);
+                }
+                
+            }else{
+                this.requestFailed(res)
+                this.$router.push({ name: 'login' })
+            }
+        });
+
+    },
+}
+</script>
+
+
+<style scoped>
+.bounce {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  color: black;
+  height: 100%;
+  font: normal bold 2rem 'Product Sans', sans-serif;
+  white-space: nowrap;
+}
+
+.letter {
+  animation: bounce 0.75s cubic-bezier(0.05, 0, 0.2, 1) infinite alternate;
+  display: inline-block;
+  transform: translate3d(0, 0, 0);
+  margin-top: 0.5em;
+  text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
+  font: normal 500 2rem 'Varela Round', sans-serif;
+}
+.letter:nth-child(1) {
+  animation-delay: 0s;
+}
+.letter:nth-child(2) {
+  animation-delay: 0.1s;
+}
+.letter:nth-child(3) {
+  animation-delay: 0.2s;
+}
+.letter:nth-child(4) {
+  animation-delay: 0.3s;
+}
+.letter:nth-child(5) {
+  animation-delay: 0.4s;
+}
+.letter:nth-child(6) {
+  animation-delay: 0.5s;
+}
+.letter:nth-child(7) {
+  animation-delay: 0.6s;
+}
+.letter:nth-child(8) {
+  animation-delay: 0.7s;
+}
+.letter:nth-child(9) {
+  animation-delay: 0.8s;
+}
+.letter:nth-child(10) {
+  animation-delay: 0.9s;
+}
+
+@keyframes bounce {
+  0% {
+    transform: translate3d(0, 0, 0);
+    text-shadow: rgba(255, 255, 255, 0.4) 0 0 0.05em;
+  }
+  100% {
+    transform: translate3d(0, -1em, 0);
+    text-shadow: rgba(255, 255, 255, 0.4) 0 1em 0.35em;
+  }
+}
+</style>

+ 0 - 1
src/views/user/transferLocal.vue

@@ -149,7 +149,6 @@ export default {
           this.login(res)
         } else {
           //   this.$message.error('企业微信登录失败,请选择账户登录')
-
           this.requestFailed(res)
           this.$router.push({ name: 'login' })
         }

+ 3 - 7
vue.config.js

@@ -67,13 +67,13 @@ module.exports = {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://192.168.1.23:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.1.22:8080', //请求本地 需要jeecg-boot后台项目  英豪
-        // target: 'http://192.168.0.111:8080', //请求本地 需要jeecg-boot后台项目  英豪
+        target: 'http://192.168.0.111:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        // target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
 
         // target: 'http://192.168.0.53:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
@@ -81,11 +81,7 @@ module.exports = {
 
         // target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目 
 
-        // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉        
-        // target: 'http://192.168.1.251:80', //请求本地 需要jeecg-boot后台项目 
-        // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉       
-        // target: 'http://192.168.1.165:8848', //请求本地 需要jeecg-boot后台项目  毕洁泉       
-        // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        
 
         ws: false,
         changeOrigin: true,