You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.8 KiB
58 lines
1.8 KiB
<template>
|
|
<PageBanner title="实名认证" desc="Authentication"/>
|
|
<div class="login-layout m-auto sm:w-screen-xl w-full">
|
|
<div class="m-auto flex sm:flex-row flex-col sm:px-0 px-3 ">
|
|
<!-- 用户菜单 -->
|
|
<UserMenu :activeIndex="activeIndex" @done="reload"/>
|
|
<div class="flash bg-white rounded-lg px-8 py-4 w-full">
|
|
<Auth @done="reload"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import {useConfigInfo, useWebsite} from "~/composables/configState";
|
|
import {ref} from 'vue'
|
|
import {useServerRequest} from "~/composables/useServerRequest";
|
|
import type {ApiResult} from "~/api";
|
|
import UserMenu from "./components/UserMenu.vue";
|
|
import Auth from './components/Auth.vue';
|
|
import type {ShopMerchantApply} from "~/api/shop/shopMerchantApply/model";
|
|
import Base from "~/pages/user/components/Base.vue";
|
|
|
|
// 配置信息
|
|
const runtimeConfig = useRuntimeConfig();
|
|
const route = useRoute();
|
|
const activeIndex = ref('');
|
|
const website = useWebsite()
|
|
const config = useConfigInfo();
|
|
const merchantApply = ref<ShopMerchantApply>();
|
|
|
|
const reload = async () => {
|
|
// 未登录状态(是否强制登录)
|
|
const token = localStorage.getItem('token');
|
|
if (!token || token == '') {
|
|
navigateTo('/passport/login');
|
|
return false;
|
|
}
|
|
const {data: response} = await useServerRequest<ApiResult<ShopMerchantApply>>('/shop/shop-merchant-apply/getByUserId', {baseURL: runtimeConfig.public.apiServer})
|
|
if (response.value?.data) {
|
|
merchantApply.value = response.value.data;
|
|
}
|
|
if(config.value){
|
|
useHead({
|
|
title: `实名认证 - ${config.value?.siteName}`,
|
|
meta: [{name: website.value.keywords, content: website.value.comments}]
|
|
});
|
|
}
|
|
}
|
|
|
|
watch(
|
|
() => route.path,
|
|
(path) => {
|
|
activeIndex.value = path;
|
|
reload();
|
|
},
|
|
{immediate: true}
|
|
);
|
|
</script>
|