This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
91 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { SmileOutlined } from "@ant-design/icons-vue" | ||
import { notification } from "ant-design-vue" | ||
import { h } from "vue" | ||
import { getWebLatest } from "./api" | ||
import { VERSION } from "./const" | ||
import { versionStringCompare } from "./version_compare" | ||
|
||
const checkWebUpdate = () => { | ||
getWebLatest().then(res=>{ | ||
const lasted=res.data.tag_name.substring(1) | ||
const now=VERSION.substring(1) | ||
if(versionStringCompare(lasted,now)==1){ | ||
notification.open({ | ||
message: '发现新版本', | ||
description: | ||
'前端新版本:'+res.data.tag_name+', 请至'+res.data.html_url+'获取新版本', | ||
icon: h(SmileOutlined,{style: 'color: #1890ff'}), | ||
}); | ||
}else{ | ||
//已经是最新版本 | ||
console.log(VERSION) | ||
} | ||
}) | ||
} | ||
|
||
export default checkWebUpdate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const loadJS = (content: string) => { | ||
return new Promise<void>((resolve,reject)=>{ | ||
const script = document.createElement('script') | ||
script.type = "text/javascript" | ||
script.onload = ()=>{ | ||
resolve() | ||
} | ||
script.onerror = ()=>{ | ||
reject() | ||
} | ||
if(/^(http|https):\/\/([\w.]+\/?)\S*/.test(content)){ | ||
script.src=content | ||
}else{ | ||
script.text= content | ||
} | ||
document.querySelector('body')!.appendChild(script) | ||
}) | ||
} | ||
|
||
export default loadJS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
<template> | ||
<div class="about"> | ||
<h1>Alist</h1> | ||
<div> | ||
<h1><a href="https://github.com/Xhofe/alist">Alist</a></h1> | ||
<p>一款阿里云盘的目录文件列表程序,后端基于golang最好的http框架gin,前端使用vue和ant design。</p> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.about{ | ||
display: flex; | ||
justify-content: flex-start; | ||
max-width: min(800px,90vw); | ||
margin: 20px auto; | ||
padding: 40px 20px; | ||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); | ||
background-color: rgba(255, 255, 255, 0.9); | ||
border-radius: 10px; | ||
} | ||
</style> |
7c361e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
alist-web – ./
alist-web-xhofe.vercel.app
alist.now.sh
alist-web-git-main-xhofe.vercel.app
alist.nn.ci