mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
code refactor
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const baseApiUrlPath = '/api';
|
const baseApiUrlPath = '/api';
|
||||||
|
const baseQrcodePath = '/qrcode';
|
||||||
const baseProxyUrlPath = '/proxy';
|
const baseProxyUrlPath = '/proxy';
|
||||||
const baseAmapApiProxyUrlPath = '/_AMapService';
|
const baseAmapApiProxyUrlPath = '/_AMapService';
|
||||||
const googleMapJavascriptUrl = 'https://maps.googleapis.com/maps/api/js';
|
const googleMapJavascriptUrl = 'https://maps.googleapis.com/maps/api/js';
|
||||||
@@ -7,6 +8,7 @@ const amapJavascriptUrl = 'https://webapi.amap.com/maps?v=2.0';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
baseApiUrlPath: baseApiUrlPath,
|
baseApiUrlPath: baseApiUrlPath,
|
||||||
|
baseQrcodePath: baseQrcodePath,
|
||||||
baseProxyUrlPath: baseProxyUrlPath,
|
baseProxyUrlPath: baseProxyUrlPath,
|
||||||
baseAmapApiProxyUrlPath: baseAmapApiProxyUrlPath,
|
baseAmapApiProxyUrlPath: baseAmapApiProxyUrlPath,
|
||||||
googleMapJavascriptUrl: googleMapJavascriptUrl,
|
googleMapJavascriptUrl: googleMapJavascriptUrl,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import services from '@/lib/services.js';
|
||||||
|
|
||||||
|
export function getMobileUrlQrCodePath() {
|
||||||
|
return services.generateQrCodeUrl('mobile_url');
|
||||||
|
}
|
||||||
@@ -400,6 +400,9 @@ export default {
|
|||||||
ignoreError: !!ignoreError
|
ignoreError: !!ignoreError
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
generateQrCodeUrl: (qrCodeName) => {
|
||||||
|
return `${api.baseQrcodePath}/${qrCodeName}.png`;
|
||||||
|
},
|
||||||
generateMapProxyTileImageUrl: (mapProvider, language) => {
|
generateMapProxyTileImageUrl: (mapProvider, language) => {
|
||||||
const token = userState.getToken();
|
const token = userState.getToken();
|
||||||
let url = `${api.baseProxyUrlPath}/map/tile/{z}/{x}/{y}.png?provider=${mapProvider}&token=${token}`;
|
let url = `${api.baseProxyUrlPath}/map/tile/{z}/{x}/{y}.png?provider=${mapProvider}&token=${token}`;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
<p>{{ $t('You can scan the below QR code on your mobile device.') }}</p>
|
<p>{{ $t('You can scan the below QR code on your mobile device.') }}</p>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-text class="pa-4 w-100 d-flex justify-center">
|
<v-card-text class="pa-4 w-100 d-flex justify-center">
|
||||||
<img alt="qrcode" class="img-url-qrcode" src="/qrcode/mobile_url.png" />
|
<img alt="qrcode" class="img-url-qrcode" :src="mobileUrlQrCodePath" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn :href="mobileVersionPath">{{$t('Switch to Mobile Version') }}</v-btn>
|
<v-btn :href="mobileVersionPath">{{$t('Switch to Mobile Version') }}</v-btn>
|
||||||
@@ -200,6 +200,7 @@ import { useSettingsStore } from '@/stores/setting.js';
|
|||||||
import { useUserStore } from '@/stores/user.js';
|
import { useUserStore } from '@/stores/user.js';
|
||||||
|
|
||||||
import { getSystemTheme } from '@/lib/ui.js';
|
import { getSystemTheme } from '@/lib/ui.js';
|
||||||
|
import { getMobileUrlQrCodePath } from '@/lib/qrcode.js';
|
||||||
import { getMobileVersionPath } from '@/lib/version.js';
|
import { getMobileVersionPath } from '@/lib/version.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -257,6 +258,9 @@ export default {
|
|||||||
const { mdAndDown } = useDisplay();
|
const { mdAndDown } = useDisplay();
|
||||||
return mdAndDown.value;
|
return mdAndDown.value;
|
||||||
},
|
},
|
||||||
|
mobileUrlQrCodePath() {
|
||||||
|
return getMobileUrlQrCodePath();
|
||||||
|
},
|
||||||
mobileVersionPath() {
|
mobileVersionPath() {
|
||||||
return getMobileVersionPath();
|
return getMobileVersionPath();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user