feat: 给艳姐增加外部链接
This commit is contained in:
+12
-3
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="index" v-if="token">
|
||||
<image
|
||||
v-for="i in 30"
|
||||
:key="i"
|
||||
@@ -17,12 +17,21 @@
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import ReportApi from '@/sheep/api/report';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const { getToken } = ReportApi;
|
||||
|
||||
const token = ref('');
|
||||
|
||||
onLoad((e) => {
|
||||
onLoad(async (e) => {
|
||||
if (!e.token) {
|
||||
const res = await getToken();
|
||||
window.location.href =
|
||||
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
|
||||
return;
|
||||
}
|
||||
|
||||
token.value = e.token;
|
||||
uni.setStorageSync('token', e.token);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user