flat:暂存
This commit is contained in:
51
App.vue
51
App.vue
@@ -6,25 +6,34 @@ import useUserStore from './stores/useUserStore';
|
||||
import usePageAnimation from './hook/usePageAnimation';
|
||||
import useDictStore from './stores/useDictStore';
|
||||
import { GlobalInactivityManager } from '@/utils/GlobalInactivityManager';
|
||||
const { $api, navTo, appendScriptTagElement, aes_Decrypt, sm2_Decrypt, safeReLaunch } = inject('globalFunction');
|
||||
const {
|
||||
$api,
|
||||
navTo,
|
||||
appendScriptTagElement,
|
||||
aes_Decrypt,
|
||||
sm2_Decrypt,
|
||||
safeReLaunch,
|
||||
isY9MachineType,
|
||||
isAsdMachineType,
|
||||
} = inject('globalFunction');
|
||||
import config from '@/config.js';
|
||||
import baseDB from '@/utils/db.js';
|
||||
import { $confirm } from '@/utils/modal.js';
|
||||
import useLocationStore from '@/stores/useLocationStore';
|
||||
usePageAnimation();
|
||||
const appword = 'aKd20dbGdFvmuwrt'; // 固定值
|
||||
let uQRListen = null;
|
||||
let inactivityManager = null;
|
||||
let inactivityModalTimer = null;
|
||||
|
||||
usePageAnimation();
|
||||
onLaunch((options) => {
|
||||
useDictStore().getDictData();
|
||||
if (lightAppJssdk.user) {
|
||||
if (isAsdMachineType()) {
|
||||
console.warn('爱山东环境');
|
||||
getUserInfo();
|
||||
useUserStore().changMiniProgramAppStatus(false);
|
||||
useUserStore().changMachineEnv(false);
|
||||
useLocationStore().getLocationLoop()//循环获取定位
|
||||
useLocationStore().getLocationLoop(); //循环获取定位
|
||||
return;
|
||||
}
|
||||
if (isY9MachineType()) {
|
||||
@@ -34,17 +43,19 @@ onLaunch((options) => {
|
||||
useUserStore().changMiniProgramAppStatus(true);
|
||||
useUserStore().changMachineEnv(true);
|
||||
(function loop() {
|
||||
console.log('📍一体机尝试获取定位')
|
||||
useLocationStore().getLocation().then(({longitude,latitude})=>{
|
||||
console.log(`✅一体机获取定位成功:lng:${longitude},lat${latitude}`)
|
||||
})
|
||||
.catch(err=>{
|
||||
console.log('❌一体机获取定位失败,30s后尝试重新获取')
|
||||
setTimeout(() => {
|
||||
loop()
|
||||
}, 3000);
|
||||
})
|
||||
})()
|
||||
console.log('📍一体机尝试获取定位');
|
||||
useLocationStore()
|
||||
.getLocation()
|
||||
.then(({ longitude, latitude }) => {
|
||||
console.log(`✅一体机获取定位成功:lng:${longitude},lat${latitude}`);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('❌一体机获取定位失败,30s后尝试重新获取');
|
||||
setTimeout(() => {
|
||||
loop();
|
||||
}, 3000);
|
||||
});
|
||||
})();
|
||||
uQRListen = new IncreaseRevie();
|
||||
inactivityManager = new GlobalInactivityManager(handleInactivity, 60 * 1000);
|
||||
inactivityManager.start();
|
||||
@@ -52,7 +63,7 @@ onLaunch((options) => {
|
||||
}
|
||||
// 正式上线去除此方法
|
||||
console.warn('浏览器环境');
|
||||
useLocationStore().getLocationLoop()//循环获取定位
|
||||
useLocationStore().getLocationLoop(); //循环获取定位
|
||||
useUserStore().changMiniProgramAppStatus(true);
|
||||
useUserStore().changMachineEnv(false);
|
||||
useUserStore().initSeesionId(); //更新
|
||||
@@ -70,7 +81,6 @@ onLaunch((options) => {
|
||||
|
||||
onMounted(() => {});
|
||||
|
||||
|
||||
onShow(() => {
|
||||
console.log('App Show');
|
||||
});
|
||||
@@ -133,13 +143,6 @@ function performLogout() {
|
||||
inactivityManager?.resume(); // 恢复监听
|
||||
}
|
||||
|
||||
// 一体机环境判断
|
||||
function isY9MachineType() {
|
||||
const ua = navigator.userAgent;
|
||||
const isY9Machine = /Y9-ZYYH/i.test(ua); // 匹配机器型号
|
||||
return isY9Machine;
|
||||
}
|
||||
|
||||
// 爱山东环境登录
|
||||
function getUserInfo() {
|
||||
lightAppJssdk.user.getUserInfoWithEncryptedParamByAppId({
|
||||
|
||||
Reference in New Issue
Block a user