chore: plus

This commit is contained in:
xiaojunnuo
2024-08-21 08:36:03 +08:00
parent db9d27468e
commit ab7a1673ff
5 changed files with 34 additions and 12 deletions
@@ -4,8 +4,10 @@
<fs-icon icon="mingcute:vip-1-line"></fs-icon>
<div class="text">
<span v-if="userStore.plusInfo?.isPlus">
<span>专业版</span>
<span>{{ expireTime }}</span>
<a-tooltip>
<template #title> 到期时间{{ expireTime }} </template>
<span>专业版</span>
</a-tooltip>
</span>
<span v-else @click="openUpgrade"> 当前免费版 </span>
</div>
@@ -55,8 +57,9 @@ function openUpgrade() {
<div class="mt-10 mb-10">
<a-input v-model:value={formState.code} placeholder={placeholder} />
<div class="mt-10">
没有激活码
<a href="https://afdian.com/a/greper" target="_blank">
爱发电赞助获取激活码
爱发电赞助获取
</a>
</div>
</div>
@@ -1,9 +1,10 @@
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
import { SysSettingsService } from '../service/sys-settings-service.js';
import { BaseController } from '../../../basic/base-controller.js';
import { appKey, utils, verify } from '@certd/pipeline';
import { appKey, verify } from '@certd/pipeline';
import { SysInstallInfo, SysLicenseInfo } from '../service/models.js';
import { logger } from '../../../utils/logger.js';
import { request } from '../../../utils/http.js';
/**
*/
@@ -22,8 +23,9 @@ export class SysPlusController extends BaseController {
code,
subjectId: installInfo.siteId,
};
const res: any = await utils.http({
url: 'https://api.ai.handsfree.work/activation/active',
const res: any = await request({
url: 'http://localhost:11007/activation/active',
method: 'post',
data: formData,
});
@@ -0,0 +1,13 @@
import { utils } from '@certd/pipeline';
export async function request(config: any) {
try {
return await utils.http(config);
} catch (e) {
const data = e.data || e.response?.data;
if (data) {
throw new Error(data.message || data.msg || data.error || data);
}
throw e;
}
}