新增:token登录方式

This commit is contained in:
2024-09-06 17:09:36 +08:00
parent 9438021a08
commit 42730a4429
3 changed files with 42 additions and 1 deletions
+21 -1
View File
@@ -97,7 +97,7 @@ export function openSpmUrl(path: string, d?: any, id = 0): void {
// 跳转页面
url.value = `${domain}${path}${spm.value}${token.value}`;
console.log(url.value,'domain>>>>');
console.log(url.value, 'domain>>>>');
window.open(`${url.value}`);
}
@@ -396,3 +396,23 @@ export const getPageTitle = () => {
const { title } = meta;
return title;
};
/**
* 提取传参中的ID
* param 12334.html
* return 1234
* @param index
*/
export const getIdBySpm = (index: number) => {
console.log('split', router.currentRoute.value.query.spm);
const split = String(router.currentRoute.value.query.spm).split('.');
console.log(split);
return split[index];
};
/**
* 提取传参中的token
*/
export const getTokenBySpm = () => {
return JSON.parse(router.currentRoute.value.query.token);
};