mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-16 13:21:10 -05:00
🐛 fix(api): Purge
This commit is contained in:
parent
6f0fa20737
commit
98c1c3047f
@ -9,7 +9,7 @@ const config = [
|
|||||||
requestLibPath: "import request from '@/utils/request';",
|
requestLibPath: "import request from '@/utils/request';",
|
||||||
schemaPath: 'https://swagger.ppanel.dev/user.json',
|
schemaPath: 'https://swagger.ppanel.dev/user.json',
|
||||||
serversPath: './services',
|
serversPath: './services',
|
||||||
projectName: 'admin',
|
projectName: 'user',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
// API 唯一标识:
|
// API 唯一标识:
|
||||||
import * as auth from './auth';
|
import * as auth from './auth';
|
||||||
import * as common from './common';
|
import * as common from './common';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
auth,
|
auth,
|
||||||
common,
|
common,
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import * as payment from './payment';
|
|||||||
import * as subscribe from './subscribe';
|
import * as subscribe from './subscribe';
|
||||||
import * as ticket from './ticket';
|
import * as ticket from './ticket';
|
||||||
import * as user from './user';
|
import * as user from './user';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
announcement,
|
announcement,
|
||||||
document,
|
document,
|
||||||
|
|||||||
13
apps/user/services/user/typings.d.ts
vendored
13
apps/user/services/user/typings.d.ts
vendored
@ -211,6 +211,11 @@ declare namespace API {
|
|||||||
total: number;
|
total: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type QueryUserAffiliateResponse = {
|
||||||
|
list: UserAffiliate[];
|
||||||
|
total: number;
|
||||||
|
};
|
||||||
|
|
||||||
type QueryUserBalanceLogListResponse = {
|
type QueryUserBalanceLogListResponse = {
|
||||||
list: UserBalanceLog[];
|
list: UserBalanceLog[];
|
||||||
total: number;
|
total: number;
|
||||||
@ -345,6 +350,14 @@ declare namespace API {
|
|||||||
status: number;
|
status: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type UserAffiliate = {
|
||||||
|
email: string;
|
||||||
|
avatar: string;
|
||||||
|
telegram: number;
|
||||||
|
registered_at: number;
|
||||||
|
enable: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type UserBalanceLog = {
|
type UserBalanceLog = {
|
||||||
id: number;
|
id: number;
|
||||||
user_id: number;
|
user_id: number;
|
||||||
|
|||||||
@ -2,6 +2,17 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/** Query User Affiliate GET /v1/public/user/affiliate */
|
||||||
|
export async function queryUserAffiliate(options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.QueryUserAffiliateResponse }>(
|
||||||
|
'/v1/public/user/affiliate',
|
||||||
|
{
|
||||||
|
method: 'GET',
|
||||||
|
...(options || {}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** Query User Balance Log GET /v1/public/user/balance_log */
|
/** Query User Balance Log GET /v1/public/user/balance_log */
|
||||||
export async function queryUserBalanceLog(options?: { [key: string]: any }) {
|
export async function queryUserBalanceLog(options?: { [key: string]: any }) {
|
||||||
return request<API.Response & { data?: API.QueryUserBalanceLogListResponse }>(
|
return request<API.Response & { data?: API.QueryUserBalanceLogListResponse }>(
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
const BASE_URL = 'https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-tutorial@main';
|
const BASE_URL = 'https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-tutorial';
|
||||||
|
|
||||||
export async function getTutorial(path: string): Promise<string> {
|
export async function getTutorial(path: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const url = `${BASE_URL}/${path}`;
|
const url = `${BASE_URL}/${path}`;
|
||||||
|
await fetch(url.replace('cdn', 'purge'));
|
||||||
const response = await fetch(url);
|
const response = await fetch(url);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
@ -24,9 +25,7 @@ type TutorialItem = {
|
|||||||
|
|
||||||
export async function getTutorialList() {
|
export async function getTutorialList() {
|
||||||
return await getTutorial('SUMMARY.md').then((markdown) => {
|
return await getTutorial('SUMMARY.md').then((markdown) => {
|
||||||
const map = parseTutorialToMap(
|
const map = parseTutorialToMap(markdown);
|
||||||
markdown.replace(/en-us/gi, 'en-US').replace(/zh-cn/gi, 'zh-CN'),
|
|
||||||
);
|
|
||||||
map.forEach((value, key) => {
|
map.forEach((value, key) => {
|
||||||
map.set(
|
map.set(
|
||||||
key,
|
key,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user