完成适配移动端

This commit is contained in:
2025-02-22 22:11:19 +08:00
parent 98758e89e2
commit 1f79c93859
62 changed files with 549 additions and 2973 deletions

View File

@@ -111,9 +111,9 @@ export function navTo(d?: any, path?: string,spm?: boolean){
path = d?.path;
}
// 是否移动设备
if(isMobileDevice()){
path = '/m' + path;
}
// if(isMobileDevice()){
// path = '/m' + path;
// }
// 国际化配置
const i18n = useI18n();
if(i18n.locale.value){
@@ -169,3 +169,21 @@ export function loginAdminByToken(): void {
export function getTimeStamp(): number {
return new Date().getTime();
}
// 复制文本
export const copyText = (text: string) => {
// 模拟 输入框
const cInput = document.createElement('input');
cInput.value = text;
document.body.appendChild(cInput);
cInput.select(); // 选取文本框内容
// 执行浏览器复制命令
// 复制命令会将当前选中的内容复制到剪切板中这里就是创建的input标签
// Input要在正常的编辑状态下原生复制方法才会生效
ElMessage.success(`复制成功`);
document.execCommand('copy');
// 复制成功后再将构造的标签 移除
document.body.removeChild(cInput);
};