增加刷新/关闭编辑界面提示 https://github.com/rymcu/forest/issues/34

This commit is contained in:
ronger 2021-03-18 22:37:30 +08:00
parent 9e0f74f8c0
commit 7763a1cc0d
4 changed files with 44 additions and 0 deletions

View File

@ -239,6 +239,17 @@ export default {
} }
}, },
mounted() { mounted() {
window.addEventListener('beforeunload', e => {
e = e || window.event;
// IE8Firefox 4
if (e) {
e.returnValue = '关闭提示';
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示';
});
let _ts = this; let _ts = this;
this.$store.commit('setActiveMenu', 'postAdminTag'); this.$store.commit('setActiveMenu', 'postAdminTag');
this.$axios.$get('/api/upload/simple/token').then(function (res) { this.$axios.$get('/api/upload/simple/token').then(function (res) {

View File

@ -255,6 +255,17 @@ export default {
} }
}, },
async mounted() { async mounted() {
window.addEventListener('beforeunload', e => {
e = e || window.event;
// IE8Firefox 4
if (e) {
e.returnValue = '关闭提示';
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示';
});
let _ts = this; let _ts = this;
_ts.$store.commit("setActiveMenu", "admin-topic-post"); _ts.$store.commit("setActiveMenu", "admin-topic-post");
_ts.$axios.$get('/api/upload/simple/token').then(function (res) { _ts.$axios.$get('/api/upload/simple/token').then(function (res) {

View File

@ -322,6 +322,17 @@
} }
}, },
async mounted() { async mounted() {
window.addEventListener('beforeunload', e => {
e = e || window.event;
// IE8Firefox 4
if (e) {
e.returnValue = '关闭提示';
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示';
});
let _ts = this; let _ts = this;
_ts.$store.commit('setActiveMenu', 'post-article'); _ts.$store.commit('setActiveMenu', 'post-article');
const responseData = await _ts.$axios.$get('/api/upload/token'); const responseData = await _ts.$axios.$get('/api/upload/token');

View File

@ -339,6 +339,17 @@ export default {
} }
}, },
mounted() { mounted() {
window.addEventListener('beforeunload', e => {
e = e || window.event;
// IE8Firefox 4
if (e) {
e.returnValue = '关闭提示';
}
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示';
});
let _ts = this; let _ts = this;
_ts.$store.commit("setActiveMenu", "portfolio-post"); _ts.$store.commit("setActiveMenu", "portfolio-post");
this.$axios.$get('/api/upload/simple/token').then(function (res) { this.$axios.$get('/api/upload/simple/token').then(function (res) {