|
@@ -45,6 +45,30 @@ const message = reactive<{ unread: number }>({
|
|
unread: 0,
|
|
unread: 0,
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+export const getRootDomain = () => {
|
|
|
|
+ let domain = '';
|
|
|
|
+ const domainItems = location.hostname.split('.');
|
|
|
|
+ if (
|
|
|
|
+ domainItems.length < 3 ||
|
|
|
|
+ (domainItems.length === 4 &&
|
|
|
|
+ +domainItems[0] > 0 &&
|
|
|
|
+ +domainItems[1] > 0 &&
|
|
|
|
+ +domainItems[2] > 0 &&
|
|
|
|
+ +domainItems[3] > 0)
|
|
|
|
+ ) {
|
|
|
|
+ domain = location.hostname;
|
|
|
|
+ } else if (
|
|
|
|
+ location.hostname.endsWith('.com.cn') ||
|
|
|
|
+ location.hostname.endsWith('.org.cn')
|
|
|
|
+ ) {
|
|
|
|
+ domain = domainItems.slice(-3).join('.');
|
|
|
|
+ } else {
|
|
|
|
+ domain = domainItems.slice(-2).join('.');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return domain;
|
|
|
|
+};
|
|
|
|
+
|
|
export const useUser = () => {
|
|
export const useUser = () => {
|
|
const getUser = async (token?: boolean) => {
|
|
const getUser = async (token?: boolean) => {
|
|
const params: any = {};
|
|
const params: any = {};
|
|
@@ -120,32 +144,9 @@ export const useUser = () => {
|
|
domain: domain, //'le5le.com',
|
|
domain: domain, //'le5le.com',
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ globalThis.deleteCookie = deleteCookie;
|
|
|
|
|
|
- router.replace({ path: '/login', query: router.currentRoute.value.query });
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- const getRootDomain = () => {
|
|
|
|
- let domain = '';
|
|
|
|
- const domainItems = location.hostname.split('.');
|
|
|
|
- if (
|
|
|
|
- domainItems.length < 3 ||
|
|
|
|
- (domainItems.length === 4 &&
|
|
|
|
- +domainItems[0] > 0 &&
|
|
|
|
- +domainItems[1] > 0 &&
|
|
|
|
- +domainItems[2] > 0 &&
|
|
|
|
- +domainItems[3] > 0)
|
|
|
|
- ) {
|
|
|
|
- domain = location.hostname;
|
|
|
|
- } else if (
|
|
|
|
- location.hostname.endsWith('.com.cn') ||
|
|
|
|
- location.hostname.endsWith('.org.cn')
|
|
|
|
- ) {
|
|
|
|
- domain = domainItems.slice(-3).join('.');
|
|
|
|
- } else {
|
|
|
|
- domain = domainItems.slice(-2).join('.');
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return domain;
|
|
|
|
|
|
+ // router.replace({ path: '/login', query: router.currentRoute.value.query });
|
|
};
|
|
};
|
|
|
|
|
|
return {
|
|
return {
|