Commit cbccda07 authored by chenqikuai's avatar chenqikuai

获取url

parent 79e7337a
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
<div class="line"></div> <div class="line"></div>
</div> </div>
<div class="txtContainer2"> <div class="txtContainer2">
<a <a :href="androidUrl">
href="https://phjr.obs.cn-east-3.myhuaweicloud.com/%E5%8D%8F%E4%BC%9A%E6%9C%8D%E5%8A%A1%E5%B9%B3%E5%8F%B0.apk"
>
<div class="btn btnTxt andriod"> <div class="btn btnTxt andriod">
<svg class="iconfont icon" aria-hidden="true" style="color: #3F7EC7; font-size: 28px;"> <svg class="iconfont icon" aria-hidden="true" style="color: #3F7EC7; font-size: 28px;">
<use xlink:href="#icon-anzhuo" /> <use xlink:href="#icon-anzhuo" />
...@@ -50,9 +48,7 @@ ...@@ -50,9 +48,7 @@
</div> </div>
</div> </div>
<div style="display: flex; justify-content: center" class="ig-btns-container"> <div style="display: flex; justify-content: center" class="ig-btns-container">
<a <a :href="androidUrl">
href="https://phjr.obs.cn-east-3.myhuaweicloud.com/%E5%8D%8F%E4%BC%9A%E6%9C%8D%E5%8A%A1%E5%B9%B3%E5%8F%B0.apk"
>
<div class="ig-btn" style="margin-right: 34px;"> <div class="ig-btn" style="margin-right: 34px;">
<svg <svg
class="iconfont icon" class="iconfont icon"
...@@ -86,19 +82,33 @@ ...@@ -86,19 +82,33 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref } from '@vue/reactivity'; import { ref } from '@vue/reactivity';
import { onBeforeMount } from '@vue/runtime-core'; import { onBeforeMount, onMounted } from '@vue/runtime-core';
import QrCode from './components/qrCode.vue'; import QrCode from './components/qrCode.vue';
import { getLatestedIosVersion, getLatestedAndroidVersion } from './service';
import { notifyStr, notifyStr2 } from './store'; import { notifyStr, notifyStr2 } from './store';
import { isWeChat } from './utils'; import { isWeChat } from './utils';
let timeoutid = NaN; let timeoutid = NaN;
const isInWeChat = ref(true) const isInWeChat = ref(true)
const iosUrl = ref('');
const androidUrl = ref('');
onMounted(async () => {
const ios = await getLatestedIosVersion()
const android = await getLatestedAndroidVersion()
if (ios.code === 200) {
iosUrl.value = ios.data.url
}
if (android.code === 200) {
androidUrl.value = android.data.url;
}
})
onBeforeMount(() => { onBeforeMount(() => {
isInWeChat.value = isWeChat(); isInWeChat.value = isWeChat();
}) })
const iosUrl = 'https://testflight.apple.com/join/QGlUXSr0'
const notify = (str: string) => { const notify = (str: string) => {
notifyStr.value = str notifyStr.value = str
......
export function getLatestedIosVersion() {
return fetch('/proxyApi/version/latest?os=ios', {
method: 'get',
}).then((ret) => ret.json())
}
export function getLatestedAndroidVersion() {
return fetch('/proxyApi/version/latest?os=android', {
method: 'get',
}).then((ret) => ret.json())
}
...@@ -8,6 +8,14 @@ export default defineConfig({ ...@@ -8,6 +8,14 @@ export default defineConfig({
build: { build: {
outDir: 'fns_front_download', outDir: 'fns_front_download',
}, },
server: {
proxy: {
'/proxyApi': {
target: 'http://172.16.102.150:8091/api/v1/',
rewrite: (path) => path.replace(/^\/proxyApi/, ''),
},
},
},
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, '/src'), '@': path.resolve(__dirname, '/src'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment