Browse Source

未登录时跳转登录

pull/3036/head
zhoupzh 2 years ago
parent
commit
785ac47d7b
2 changed files with 11 additions and 2 deletions
  1. +2
    -1
      templates/model/tuomin/upload.tmpl
  2. +9
    -1
      web_src/vuepages/pages/model/tuomin/index.vue

+ 2
- 1
templates/model/tuomin/upload.tmpl View File

@@ -6,7 +6,8 @@
{{template "base/alert" .}}
</div>
{{end}}
<div id="__vue-root"></div>
<div id="isSignd" data-sign="{{$.IsSigned}}" style="display: none;"></div>
<div id="__vue-root"></div>
</div>
<script src="{{StaticUrlPrefix}}/js/vp-model-tuomin.js?v={{MD5 AppVer}}"></script>
{{template "base/footer" .}}

+ 9
- 1
web_src/vuepages/pages/model/tuomin/index.vue View File

@@ -171,6 +171,7 @@ export default {
mode: this.$t("all"),
},
],
startFlag: false,
};
},
components: {},
@@ -210,6 +211,10 @@ export default {
document.body.removeChild(a);
},
startTranform() {
if (!this.startFlag) {
window.location.href = "/user/login";
return;
}
if (!this.file) return;
let fd = new FormData();
fd.append("file", this.file.raw);
@@ -248,7 +253,10 @@ export default {
});
},
},
mounted() {},
mounted() {
const signEl = document.querySelector("#isSignd");
this.startFlag = !!signEl.getAttribute("data-sign");
},
beforeDestroy() {},
};
</script>


Loading…
Cancel
Save