From 93ef3ffb6a7dd9b423762fb603d73e94e978f3d2 Mon Sep 17 00:00:00 2001 From: jiangweiguo <1578967617@qq.com> Date: Wed, 10 Apr 2024 11:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E5=BE=AE=E7=99=BB=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E7=BD=91=E9=A1=B5=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- src/api/login.js | 19 ++++- src/assets/chahao.png | Bin 0 -> 1091 bytes src/layout/index.vue | 62 +++++++++++---- src/store/modules/common/user.js | 3 +- src/views/home/index.vue | 3 + src/views/login/index.vue | 126 +++++++++++++++++++++++-------- 7 files changed, 163 insertions(+), 52 deletions(-) create mode 100644 src/assets/chahao.png diff --git a/.env.production b/.env.production index 908e604..686de8d 100644 --- a/.env.production +++ b/.env.production @@ -13,5 +13,5 @@ VUE_APP_API= '/' # 请求环境 # 方楠 -VUE_APP_BASE_API = 'http://expense-h5.lyrfp.com' +VUE_APP_BASE_API = 'http://one-h5.lyrfp.com' # VUE_APP_BASE_API = 'http://60.204.223.58:8080' diff --git a/src/api/login.js b/src/api/login.js index 38c0f22..bc81aaf 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -22,7 +22,8 @@ export function Wxlogin(query) { params: query }) } -// 通过code 后端获取访问用户身份 + +// 通过code 后端获取访问用户身份token export function sendCode(query) { return request({ url: '/system/auth/social-WeCom-login', @@ -30,6 +31,22 @@ export function sendCode(query) { params: query }) } +// 是否隐藏账号密码登录 +export function isProhibited(query) { + return request({ + url: '/system/auth/isProhibited', + method: 'get', + params: query + }) +} +// 账号密码登录 绑定企业微信 +export function userBind(data) { + return request({ + url: '/system/social-user/bind', + method: 'POST', + data + }) +} // 获取个人权限信息 export function getUserInfo() { diff --git a/src/assets/chahao.png b/src/assets/chahao.png new file mode 100644 index 0000000000000000000000000000000000000000..9e011338c0d0ca4a3170cdf855a7bc79a1aef8bf GIT binary patch literal 1091 zcmV-J1ibr+P)005u_0{{R3dEt5<0000dP)t-sM{rF4 z8ZZAFFaH}Z{~9j;954SKG5;Da{~9j;8ZQ4MH~$(h{~9h;$|zR=000bhQchC47wGk3K;}H3eq7J)TKiO1A-2MPSWKiPm!hbL5ap9gC+!l;9D?V#LA~63LByA>f7#kCIn1yeA}< z_Y%BZRSuX$f(L1mLV9)B1^yN1HJ%`)l#mA&9D0M)Vmg?qvrYK;Jn1&Yuy0Z*W>Yr`!1|0x24Ww85kUA34AaOrE=D(ZbH?hoTve z{cWm=JDf|;S^SDAWb`eDJV{K8EJ1UsTjSOG8}BA3j_(Yw+Mjqp6U7NZGvIAL1qoSC z9$9qlkPjzQ4Ja}M&E`4|EP1Q{&2gc_?BnaaZiHrv9eZ*b@xCiIQ;h8Xq{TflN6|rW z{LGI?LD4~we(?rtr060z{(~mTDY^)b^rldCRtse@K}z;*F+NV0ypcO()U0Vzieg7l zAVt<+Qxr>rm=@Y|>lun&Nd>nVoFXYj2|;=ud?g`85kdOR8p<3+5y7FU9LOryvW(!+ z#X2&%%9Nsv;P7Hxc}=J*(qm_KU6}=R{r`bGT@O`Vgn_%_sb~le-Hp41Drwpry}(^2 zcNGMO>5ZW74i&AtejvzRyNc=~Q30+<0O3c5KT4Annk`WqCt$2pY`E#|X$VT31KfR; zWd!9879IlNK?)v5;ej5Wiola4MLO3NrE{8uvm{A41u1b+l@h~~c6?a@FMQyo8N7Ie zm$&c&9Nr?pH!& zUxMHzt;G!&;NuVcfCfH7f)BayV>tMr5I)Mp4_o2mVEDiqKT^*&^zYXfzm|YsoPe)( z;FnL}>oNER9{7rp?=42hx2EN#i%IP`SKaW-c<^;W{6ZssJEIq}b$Iv{^r3*4 -
-
+
+
+ +
+
+

请在客户端打开链接

+
+
+
+
@@ -48,24 +59,41 @@ import { mapState } from 'vuex' export default { components: { - Feedback: () => import('./components/Feedback') + Feedback: () => import('./components/Feedback'), }, data() { return { + qw: false, safeHeight: 0, active: 'home-index', aliveArr: [], tabArr: [], - homeArr: ['home-consultation', 'home-handover', 'home-index', 'home-orderManage', 'home-stat'], - isTabeRouter: false + homeArr: [ + 'home-consultation', + 'home-handover', + 'home-index', + 'home-orderManage', + 'home-stat', + ], + isTabeRouter: false, } }, computed: { ...mapState('common', { - transitionActive: state => state.setting.active, - }) + transitionActive: (state) => state.setting.active, + }), }, created() { + /* if (/wxwork/i.test(navigator.userAgent)) { + // 在企业微信中打开 + } else { + // 不在企业微信中打开,可以做一些限制或提示 + this.qw = true + alert('请在企业微信中打开此页面!') + // 或者重定向到其他页面 + return + // window.location.href = 'https://your-company-wechat-url' + } */ this.handleInit() this.handleAlive() }, @@ -78,8 +106,8 @@ export default { this.isTabeRouter = true } }, - immediate: true - } + immediate: true, + }, }, mounted() { if (this.$refs.layoutTab) { @@ -100,13 +128,15 @@ export default { }, methods: { handleInit() { - const homeRoute = this.$router.options.routes.find(item => item.name === 'Home') + const homeRoute = this.$router.options.routes.find( + (item) => item.name === 'Home' + ) this.tabArr = homeRoute ? homeRoute.children : [] }, // 处理首页的跳转没有刷新数据问题 handleHomeAliveReset(obj) { if (this.homeArr.includes(obj.name)) { - this.homeArr = this.homeArr.filter(item => item !== obj.name) + this.homeArr = this.homeArr.filter((item) => item !== obj.name) this.$nextTick(() => { obj.fn() this.homeArr.push(obj.name) @@ -122,14 +152,14 @@ export default { if (!this.aliveArr.includes(name)) this.aliveArr.push(name) }, handleRemoveLive(name) { - let index = this.aliveArr.findIndex(item => item == name) + let index = this.aliveArr.findIndex((item) => item == name) if (index > -1) { this.aliveArr.splice(index, 1) } }, handleAliveSet(routerArr) { - routerArr.forEach(el => { + routerArr.forEach((el) => { if (el.meta && el.meta.cache) { this.aliveArr.push(el.name) } @@ -139,14 +169,14 @@ export default { }) }, handleResetLive(name) { - const num = this.aliveArr.findIndex(item => item === name) + const num = this.aliveArr.findIndex((item) => item === name) if (num > -1) { this.aliveArr.splice(num, 1) this.$nextTick(() => { this.aliveArr.push(name) }) } - } - } + }, + }, } diff --git a/src/store/modules/common/user.js b/src/store/modules/common/user.js index 114ab7b..15bd6be 100644 --- a/src/store/modules/common/user.js +++ b/src/store/modules/common/user.js @@ -143,7 +143,8 @@ export default { // } // } window.localStorage.setItem('out', 1) - router.replace('/login') + router.replace({path:'/login',query: {}}) + // window.location.href = process.env.VUE_APP_BASE_API }) }, diff --git a/src/views/home/index.vue b/src/views/home/index.vue index d554095..f27c59b 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -77,6 +77,9 @@ export default { return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} }) }, }, + created() { + console.log(this.$route.query, 'this.$router.query') + }, mounted() { this.$forceCloseLoading() this.handleFilterList() diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 45ece8b..a4e8f5a 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,5 +1,13 @@