diff --git a/src/consts/api.js b/src/consts/api.js index 2e7b6cd8..07d5dc10 100644 --- a/src/consts/api.js +++ b/src/consts/api.js @@ -1,4 +1,5 @@ const baseApiUrlPath = '/api'; +const baseQrcodePath = '/qrcode'; const baseProxyUrlPath = '/proxy'; const baseAmapApiProxyUrlPath = '/_AMapService'; 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 { baseApiUrlPath: baseApiUrlPath, + baseQrcodePath: baseQrcodePath, baseProxyUrlPath: baseProxyUrlPath, baseAmapApiProxyUrlPath: baseAmapApiProxyUrlPath, googleMapJavascriptUrl: googleMapJavascriptUrl, diff --git a/src/lib/qrcode.js b/src/lib/qrcode.js new file mode 100644 index 00000000..d64f4b85 --- /dev/null +++ b/src/lib/qrcode.js @@ -0,0 +1,5 @@ +import services from '@/lib/services.js'; + +export function getMobileUrlQrCodePath() { + return services.generateQrCodeUrl('mobile_url'); +} diff --git a/src/lib/services.js b/src/lib/services.js index ac4d4ff4..0cd3a153 100644 --- a/src/lib/services.js +++ b/src/lib/services.js @@ -400,6 +400,9 @@ export default { ignoreError: !!ignoreError }); }, + generateQrCodeUrl: (qrCodeName) => { + return `${api.baseQrcodePath}/${qrCodeName}.png`; + }, generateMapProxyTileImageUrl: (mapProvider, language) => { const token = userState.getToken(); let url = `${api.baseProxyUrlPath}/map/tile/{z}/{x}/{y}.png?provider=${mapProvider}&token=${token}`; diff --git a/src/views/desktop/MainLayout.vue b/src/views/desktop/MainLayout.vue index 8b408223..2c3d5737 100644 --- a/src/views/desktop/MainLayout.vue +++ b/src/views/desktop/MainLayout.vue @@ -172,7 +172,7 @@
{{ $t('You can scan the below QR code on your mobile device.') }}
+