@@ -136,30 +88,13 @@
-
-
-
@@ -181,54 +116,20 @@ import lookImage from "@/components/fromBuild/lookImage";
import {
auth,
getVersion,
- crmebProduct,
- crmebCopyRight,
saveCrmebCopyRight,
getCrmebCopyRight,
getSystemInfo
} from "@/api/system";
-import { mapState } from "vuex";
-import { formatDate } from "@/utils/validate";
-import QRCode from "qrcodejs2";
-import Vcode from "vue-puzzle-vcode";
export default {
name: "system_auth",
- computed: {
- ...mapState("admin/layout", ["isMobile"]),
- ...mapState("admin/userLevel", ["categoryId"]),
- labelWidth() {
- return this.isMobile ? undefined : 85;
- },
- labelPosition() {
- return this.isMobile ? "top" : "right";
- },
- },
-
data() {
return {
baseURLS: Setting.apiBaseURL.replace(/adminapi/, ""),
- baseUrl: "https://shop.crmeb.net/html/index.html",
- iframeUrl: "",
- captchs: "http://authorize.crmeb.net/api/captchs/",
- authCode: "",
- status: 1,
- dayNum: 0,
- copyright: "",
- isTemplate: false,
- price: "",
- proPrice: "",
- productStatus: false,
+ licenseInfo: {},
copyrightText: "",
- success: false,
- payType: "",
- disabled: false,
- isShow: false, // 验证码模态框是否出现
- active: 0,
- timer: null,
version: "",
label: "",
- productType: "",
modalPic: false,
isChoice: "单选",
authorizedPicture: "", // 版权图片
@@ -304,28 +205,15 @@ export default {
],
};
},
- filters: {
- formatDate(time) {
- if (time !== 0) {
- let date = new Date(time * 1000);
- return formatDate(date, "yyyy-MM-dd hh:mm");
- }
- },
- },
components: {
- Vcode,
uploadPictures,
lookImage,
},
mounted() {
this.getAuth();
this.getVersion();
+ this.getCopyRight();
this.systemInfo();
- window.addEventListener("message", (e) => {
- if (e.data.event === "onCancel") {
- this.cancel();
- }
- });
},
methods: {
systemInfo() {
@@ -353,12 +241,6 @@ export default {
this.label = res.data.label;
});
},
- getCrmebCopyRight() {
- crmebCopyRight().then((res) => {
- this.getAuth();
- // return this.$Message.success(res.msg)
- });
- },
//保存版权信息
saveCopyRight() {
saveCrmebCopyRight({
@@ -384,79 +266,15 @@ export default {
this.authorizedPicture = res.data.copyrightImage || "";
});
},
- cancel() {
- if (this.productType === "copyright") {
- this.getCrmebCopyRight();
- } else {
- this.getAuth();
- }
- this.iframeUrl = "";
- this.isTemplate = false;
- },
- loginTabSwitch(index) {
- this.active = index;
- },
getAuth() {
auth()
.then((res) => {
- let data = res.data || {};
- this.authCode = data.authCode || "";
- this.status = data.status === undefined ? -1 : data.status;
- this.dayNum = data.day || 0;
- this.copyright = data.copyright;
- if (this.copyright) {
- this.getCopyRight();
- }
+ this.licenseInfo = res.data || {};
})
.catch((err) => {
this.$Message.error(err.msg);
});
},
- toCrmeb() {
- window.open("http://www.crmeb.com");
- },
- getProduct() {
- crmebProduct({ type: "copyright" })
- .then((res) => {
- this.price = res.data.attr.price;
- this.productStatus = true;
- })
- .catch((err) => {
- this.$Message.error(err.msg);
- });
- crmebProduct({ type: "pro" })
- .then((res) => {
- this.proPrice = res.data.attr.price;
- })
- .catch((err) => {
- this.$Message.error(err.msg);
- });
- },
- payment(product) {
- this.productType = product;
- let host = location.host;
- let hostData = host.split(".");
- if (hostData[0] === "test" && hostData.length === 4) {
- host = host.replace("test.", "");
- } else if (hostData[0] === "www" && hostData.length === 3) {
- host = host.replace("www.", "");
- }
- this.iframeUrl =
- this.baseUrl +
- "?url=" +
- host +
- "&product=" +
- product +
- "&version=" +
- this.version +
- "&label=" +
- this.label;
- this.isTemplate = true;
- },
- // 用户点击遮罩层,应该关闭模态框
- onClose() {
- this.isShow = false;
- },
},
destroyed() {},
};
diff --git a/pro_v3.5.1/view/admin/src/router/modules/system.js b/pro_v3.5.1/view/admin/src/router/modules/system.js
index e3eb2d80..57135ca3 100644
--- a/pro_v3.5.1/view/admin/src/router/modules/system.js
+++ b/pro_v3.5.1/view/admin/src/router/modules/system.js
@@ -137,7 +137,7 @@ export default {
name: `${pre}auth`,
meta: {
auth: ['system-maintain-auth'],
- title: '商业授权'
+ title: '系统许可'
},
component: () => import('@/pages/system/auth/index')
},