|
@@ -1,25 +1,23 @@
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div v-if="isMobileDevice&&!isDingTalk()" class="loading">跳转处理中...</div>
|
|
<div v-if="isMobileDevice&&!isDingTalk()" class="loading">跳转处理中...</div>
|
|
- <a ref="myLink" :href="href" v-show="false">跳转app</a>
|
|
|
|
- <div v-if="isMobileDevice()&&isDingTalk()" class="wxtip" id="JweixinTip">
|
|
|
|
- <span class="wxtip-icon"></span>
|
|
|
|
-<!-- <p class="wxtip-txt">点击右上角<br/>选择在浏览器中打开</p>-->
|
|
|
|
- </div>
|
|
|
|
|
|
+<!-- <a ref="myLink" :href="href" v-show="false">跳转app</a>-->
|
|
|
|
+<!-- <div v-if="isMobileDevice()&&isDingTalk()" class="wxtip" id="JweixinTip">-->
|
|
|
|
+<!-- <span class="wxtip-icon"></span>-->
|
|
|
|
+<!-- </div>-->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { onMounted } from 'vue'
|
|
import { onMounted } from 'vue'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
|
+import * as LoginApi from "@/api/login";
|
|
|
|
+import * as authUtil from "@/utils/auth";
|
|
|
|
|
|
const { push } = useRouter()
|
|
const { push } = useRouter()
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
|
|
|
// 设备检测
|
|
// 设备检测
|
|
const isMobileDevice = (): boolean => {
|
|
const isMobileDevice = (): boolean => {
|
|
- // const ua = navigator.userAgent.toLowerCase()
|
|
|
|
- // return /mobile|android|iphone|ipad/i.test(ua) &&
|
|
|
|
- // !/(windows|macintosh|linux)/i.test
|
|
|
|
const userAgentInfo = navigator.userAgent;
|
|
const userAgentInfo = navigator.userAgent;
|
|
const mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod","OpenHarmony"];
|
|
const mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod","OpenHarmony"];
|
|
|
|
|
|
@@ -52,10 +50,11 @@ const clickA = () =>{
|
|
myLink.value.click();
|
|
myLink.value.click();
|
|
}
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- const { type = '', id = '' } = route.query
|
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
+ const { type = '', id = '', userId='' } = route.query
|
|
const isValidType = Object.keys(businessRoutes).includes(type as string)
|
|
const isValidType = Object.keys(businessRoutes).includes(type as string)
|
|
if (isMobileDevice()) {
|
|
if (isMobileDevice()) {
|
|
|
|
+ window.location.href = 'https://iot.deepoil.cc/deepoil/#/?type=' + type+'&id='+id+'&userId='+userId;
|
|
// 移动端跳转deepoil协议
|
|
// 移动端跳转deepoil协议
|
|
// try{
|
|
// try{
|
|
// const typelower = type.toLowerCase();
|
|
// const typelower = type.toLowerCase();
|
|
@@ -63,11 +62,16 @@ onMounted(() => {
|
|
// }catch (error) {
|
|
// }catch (error) {
|
|
// alert(error.message)
|
|
// alert(error.message)
|
|
// }
|
|
// }
|
|
- href.value = 'deepoil://'+type+'/'+id
|
|
|
|
- nextTick(()=>{
|
|
|
|
- setTimeout(clickA,1000)
|
|
|
|
- })
|
|
|
|
|
|
+ // href.value = 'deepoil://'+type+'/'+id
|
|
|
|
+ // nextTick(()=>{
|
|
|
|
+ // setTimeout(clickA,1000)
|
|
|
|
+ // })
|
|
} else if (isValidType) {
|
|
} else if (isValidType) {
|
|
|
|
+ const res = await LoginApi.simpleLogin(userId)
|
|
|
|
+ if (!res) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ authUtil.setToken(res)
|
|
// PC端路由跳转
|
|
// PC端路由跳转
|
|
if (type === 'generateInspect') {
|
|
if (type === 'generateInspect') {
|
|
push({ name:'InspectOrderWrite', params:{id} })
|
|
push({ name:'InspectOrderWrite', params:{id} })
|