|
@@ -7,8 +7,8 @@
|
|
|
import AppLayout from "@/framework/EditorAppLayout.vue";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import browser from "@/utils/browser";
|
|
|
-import { exchangeId } from "@/api";
|
|
|
-
|
|
|
+import { exchangeId, checkWork, getPanoInfo, checkLogin } from "@/api";
|
|
|
+import { LoginDetector, OnlineDetector } from "@/utils/starter";
|
|
|
export default {
|
|
|
components: {
|
|
|
AppLayout,
|
|
@@ -31,23 +31,57 @@ export default {
|
|
|
const res = await exchangeId({
|
|
|
id: id
|
|
|
})
|
|
|
+
|
|
|
if (token) {
|
|
|
localStorage.setItem('token', token)
|
|
|
}
|
|
|
- const { id: resID, num } = res.data
|
|
|
+
|
|
|
+
|
|
|
+ const { id: resID, num, calcStatus } = res.data
|
|
|
const isCam = String(num).length > 0
|
|
|
let urlRes = `./edit.html?id=${resID}&lang=${lang}#/base`
|
|
|
if (isCam) {
|
|
|
urlRes = `./edit.html?id=${resID}&lang=${lang}&from=cam#/base`
|
|
|
}
|
|
|
+ if (calcStatus === 0) {
|
|
|
+ this.$alert({
|
|
|
+ content: this.$i18n.t('common.calcing'),
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
console.log('res', urlRes)
|
|
|
location.replace(urlRes);
|
|
|
- },
|
|
|
- mounted() {
|
|
|
+ //检验是不是该用户作品
|
|
|
+ checkWork({
|
|
|
+ val: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ checkLogin().then((response) => {
|
|
|
+ if (response.code == 3005) {
|
|
|
+ this.$store.commit("UpdateIsShowState", false);
|
|
|
+ this.$bus.emit("canLoad", false);
|
|
|
+ return this.$alert({ content: "当前无操作权限" });
|
|
|
+ } else {
|
|
|
+ this.$bus.emit("canLoad", true);
|
|
|
+ LoginDetector.valid();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return this.$alert({ content: "该作品已被删除" });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ getPanoInfo().then(() => {
|
|
|
+ this.$store.commit("UpdateIsShowState", true);
|
|
|
+ OnlineDetector.valid();
|
|
|
+ });
|
|
|
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
document.title = this.$i18n.t("gather.editpage_name");
|
|
|
window.store = this.$store;
|
|
|
+
|
|
|
+
|
|
|
window.addEventListener(
|
|
|
"beforeunload",
|
|
|
(e) => {
|