|
@@ -8,6 +8,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import axios from 'axios'
|
|
|
import { MessageBox } from 'element-ui'
|
|
|
export default {
|
|
|
name: 'App',
|
|
@@ -69,23 +70,38 @@
|
|
|
checkForUpdates();
|
|
|
self.timer = window.setInterval(checkForUpdates, intervalTime);
|
|
|
async function checkForUpdates() {
|
|
|
- getFilesName().then(res=>{
|
|
|
- if(res){
|
|
|
- if(res !== process.env.VUE_APP_RENEWAL_ENCODING){
|
|
|
- MessageBox.confirm('发现新版本,是否立即刷新页面?', '系统提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- showCancelButton:true,
|
|
|
- closeOnClickModal:false,
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }
|
|
|
- ).then(() => {
|
|
|
- clearInterval(self.timer);
|
|
|
- location.reload(true);
|
|
|
- }).catch(() => {});
|
|
|
- }
|
|
|
+ axios.get('/version.txt').then((data) => {
|
|
|
+ if (data.data !== process.env.VUE_APP_RENEWAL_ENCODING){
|
|
|
+ MessageBox.confirm('发现新版本,是否立即刷新页面?', '系统提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ showCancelButton:true,
|
|
|
+ closeOnClickModal:false,
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ clearInterval(self.timer);
|
|
|
+ location.reload(true);
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
+ // getFilesName().then(res=>{
|
|
|
+ // if(res){
|
|
|
+ // if(res !== process.env.VUE_APP_RENEWAL_ENCODING){
|
|
|
+ // MessageBox.confirm('发现新版本,是否立即刷新页面?', '系统提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // showCancelButton:true,
|
|
|
+ // closeOnClickModal:false,
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning'
|
|
|
+ // }
|
|
|
+ // ).then(() => {
|
|
|
+ // clearInterval(self.timer);
|
|
|
+ // location.reload(true);
|
|
|
+ // }).catch(() => {});
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
function getMetaContent(htmlContent) {
|
|
|
let matchContent = [];
|