chore: finalize license compliance cleanup

This commit is contained in:
danaisuiyuan
2026-04-30 17:57:03 +08:00
parent b650f0f167
commit bc1e7a308a
12 changed files with 98 additions and 330 deletions

View File

@@ -371,85 +371,7 @@ export function auth() {
}
/**
* @description 申请授权
* @param data
*/
export function authApply(data) {
return request({
url: "auth_apply",
method: "post",
data,
});
}
/**
* @description 获取授权产品
*/
export function crmebProduct(params) {
return request({
url: "crmeb_product",
method: "get",
params,
});
}
/**
* @description 授权验证码
*/
export function crmebVerify(params) {
return request({
url: "crmeb_verify",
method: "get",
params,
});
}
/**
* @description 授权登录
*/
export function crmebLogin(data) {
return request({
url: "/crmeb_login",
method: "post",
data,
});
}
/**
* @description 授权订单
*/
export function crmebOrder(data) {
return request({
url: "crmeb_order",
method: "post",
data,
});
}
/**
* @description 再次支付
*/
export function crmebPay(data) {
return request({
url: `crmeb_pay`,
method: "post",
data,
});
}
/**
* @description 获取授权订单
*/
export function getCrmebOrder(id, params) {
return request({
url: `crmeb_order/${id}`,
method: "get",
params,
});
}
/**
* @description 获取授权订单
* @description 获取系统版本
*/
export function getVersion() {
return request({
@@ -458,16 +380,6 @@ export function getVersion() {
});
}
/**
* @description 申请版权
*/
export function crmebCopyRight() {
return request({
url: `crmeb_copyright`,
method: "get",
});
}
/**
* @description 获取版权
*/

View File

@@ -3,68 +3,20 @@
<Card :bordered="false" dis-hover class="ivu-mt">
<div class="auth acea-row row-between-wrapper">
<div class="acea-row row-middle">
<Icon type="ios-bulb-outline" class="iconIos blue" />
<div class="text" v-if="status === -1 || status === -9">
<div>体验时间剩余 {{ dayNum }}</div>
<div class="code">
到期后后台将不能正常使用如果您对我们的系统满意请支持正版
</div>
</div>
<div class="text" v-else-if="status === 2">
<div>体验时间剩余 {{ dayNum }}</div>
<div class="code red">审核未通过</div>
</div>
<div class="text" v-else-if="status === 1">
<div>商业授权</div>
<div class="code">授权码{{ authCode }}</div>
</div>
<div class="text" v-else-if="status === 0">
<div>体验时间剩余 {{ dayNum }}</div>
<div class="code blue">授权申请已提交请等待审核</div>
</div>
</div>
<!-- <Button class="grey" @click="toCrmeb()" v-if="status === 1">进入官网</Button> -->
<div>
<Button @click="toCrmeb()" v-if="status === 1">进入官网</Button>
<Button
type="primary"
@click="payment('pro')"
v-else-if="status === -1 || status === -9"
>申请授权
</Button>
<Button
type="primary"
@click="payment('pro')"
v-else-if="status === 2"
>重新申请</Button
>
<Button class="grey" v-else-if="status === 0">审核中</Button>
<Button class="ml20" @click="payment('pro')" v-if="status !== 1"
>购买授权</Button
>
</div>
</div>
</Card>
<Card
:bordered="false"
dis-hover
class="ivu-mt"
v-if="!copyright && status == 1"
>
<!-- v-if="copyright == '0' && status == 1" -->
<div class="auth acea-row row-between-wrapper">
<div class="acea-row row-middle">
<span class="iconfont iconbanquan iconIos blue"></span>
<Icon type="ios-information-circle-outline" class="iconIos blue" />
<div class="text">
<div>去版权服务</div>
<div class="code">购买之后可以设置</div>
<div class="pro_price" v-if="productStatus">{{ price }}</div>
<div>系统许可</div>
<div class="code">当前系统使用自有版权配置不展示 CRMEB 原厂商业授权状态</div>
<div class="code">
版本{{ licenseInfo.edition || "custom" }} · 来源{{ licenseInfo.license_source || "self-owned" }}
</div>
<div class="code">系统版本{{ version || "-" }} {{ label || "" }}</div>
</div>
</div>
<Button type="primary" @click="payment('copyright')">立即购买</Button>
<Tag color="blue">自有配置</Tag>
</div>
</Card>
<Card :bordered="false" dis-hover class="ivu-mt" v-if="copyright">
<Card :bordered="false" dis-hover class="ivu-mt">
<div class="auth acea-row row-between-wrapper">
<div class="acea-row row-middle">
<span class="iconfont iconbanquan iconIos blue"></span>
@@ -136,30 +88,13 @@
</template>
</Table>
</Card>
<Modal
v-model="isTemplate"
scrollable
footer-hide
closable
title="商业授权"
:z-index="1"
width="447"
@on-cancel="cancel"
>
<iframe
width="100%"
height="580"
:src="iframeUrl"
frameborder="0"
></iframe>
</Modal>
<Modal
v-model="modalPic"
width="960px"
scrollable
footer-hide
closable
title="上传权图片"
title="上传权图片"
:mask-closable="false"
:z-index="1"
>
@@ -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() {},
};

View File

@@ -137,7 +137,7 @@ export default {
name: `${pre}auth`,
meta: {
auth: ['system-maintain-auth'],
title: '商业授权'
title: '系统许可'
},
component: () => import('@/pages/system/auth/index')
},