perf: 专业版试用,无需绑定账号

This commit is contained in:
xiaojunnuo
2024-11-17 01:06:27 +08:00
parent c6488b58f5
commit c7c4318c11
5 changed files with 42 additions and 5 deletions

View File

@@ -108,6 +108,23 @@ export class PlusService {
return res.accessToken;
}
async getVipTrial() {
const plusRequestService = await this.getPlusRequestService();
await this.register();
const res = await plusRequestService.request({
url: '/activation/subject/vip/trialGet',
method: 'POST',
});
if (res.license) {
await this.updateLicense(res.license);
return {
duration: res.duration,
};
} else {
throw new Error('您已经领取过VIP试用了');
}
}
async requestWithToken(config: HttpRequestConfig) {
const plusRequestService = await this.getPlusRequestService();
const token = await this.getAccessToken();