chore: initial commit - CloudSearch v0.0.2
This commit is contained in:
29
packages/frontend/index.html
Executable file
29
packages/frontend/index.html
Executable file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CloudSearch - 网盘资源搜索</title>
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<script>
|
||||
(function() {
|
||||
// 替换标题为网站名称
|
||||
fetch('/api/site-config').then(r=>r.json()).then(cfg=>{
|
||||
if(cfg.site_name) document.title = cfg.site_name + ' - 网盘资源搜索';
|
||||
}).catch(function(){});
|
||||
// 跳过:参数 ?desktop=1 强制使用桌面版
|
||||
if (window.location.search.includes('desktop=1')) return;
|
||||
var ua = navigator.userAgent;
|
||||
var isMobile = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(ua);
|
||||
var isTablet = /iPad|Android(?!.*Mobile)/i.test(ua);
|
||||
if (isMobile || isTablet) {
|
||||
window.location.replace(window.location.origin + '/h5');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user