配置文件

This commit is contained in:
John
2024-05-21 01:36:08 +08:00
parent 70a3efb430
commit bfbec3a56e
4 changed files with 15 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
export enum ResultEnum {
SUCCESS = 200,
ERROR = 400,
ERROR_401 = 401,
TIMEOUT = 10042,
TYPE = 'success',
}

View File

@@ -16,11 +16,12 @@ import { RequestOptions, Result, CreateAxiosOptions } from './types';
import { useUserStoreWidthOut } from '@/store/modules/user';
import {domainStoreWidthOut} from "@/store/modules/domain";
import { getConfig } from '@/config';
import { storage } from '@/utils/Storage';
const urlPrefix = '';
const tenantConfig = await getConfig();
// import router from '@/router';
import router from '@/router';
// import { storage } from '@/utils/Storage';
/**
@@ -103,6 +104,11 @@ const transform: AxiosTransform = {
case ResultEnum.ERROR:
showFailToast(errorMsg);
break;
case ResultEnum.ERROR_401:
storage.clear();
showFailToast(errorMsg);
router.replace('/login')
break;
// 登录超时
// case ResultEnum.TIMEOUT:
// const LoginName = PageEnum.BASE_LOGIN_NAME;

View File

@@ -117,7 +117,7 @@ import {showToast} from "vant";
import JGap from "@/components/JGap/JGap.vue";
import { useI18n } from 'vue-i18n';
const user = useUserStore()
const userStore = useUserStore()
const router = useRouter()
const { t } = useI18n()
const bannerList = [
@@ -288,8 +288,10 @@ onMounted(() => {
_getLoansInfo()
_getHomeInfo()
_getLoansUser()
if (userStore.getToken) {
_getUserInfo()
_getSts()
}
// _getSts()
})
onUnmounted(() => {
clearInterval(timer.value);

View File

@@ -4,7 +4,7 @@
<div class="header-bj">
<div class="header-head" :style="{'--bg-image': `url(${headerImage}) no-repeat`}"></div>
<div class="header-text">{{ customerInfo.nickName }}</div>
<div class="header-text-code" @click="copyToClipboard(customerInfo.userCode)">编号{{ customerInfo.userCode }}<span>(复制)</span></div>
<div class="header-text-code" @click="copyToClipboard(customerInfo.userCode)">编号{{ customerInfo.userCode }}<span><van-icon name="link-o" /></span></div>
</div>
</div>
<div class="content">
@@ -244,7 +244,7 @@ onMounted(() => {
color: #111a34;
transform: translateY(-60px);
span {
color: #7696f8;
color: #121b39;
}
}
}