This commit is contained in:
vastxie 2024-02-04 21:06:59 +08:00
parent 4aaa8d05f7
commit 435fc44522
180 changed files with 790 additions and 1476 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
pnpm-lock.yaml

View File

@ -1,10 +1,9 @@
# NineAI 更新整合版 # NineAI 更新整合版
99AI整合版基于 NineAI 二开的可商业化 AI Web 应用(免授权,无后门,支持快速部署) 99AI 整合版:基于 NineAI 二开的可商业化 AI Web 应用(免授权,无后门,支持快速部署)
## 页面预览 ## 页面预览
<img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/7e9927a5-b0a7-42e0-8699-c9cd13a6d31a"> <img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/7e9927a5-b0a7-42e0-8699-c9cd13a6d31a">
<img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/232ccf5d-90f6-45b5-8b9b-038959ac03af"> <img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/232ccf5d-90f6-45b5-8b9b-038959ac03af">
@ -17,20 +16,26 @@
<img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/18f32097-1c4d-4b8f-8c2e-2c7c36a51be1"> <img width="1229" alt="image" src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/18f32097-1c4d-4b8f-8c2e-2c7c36a51be1">
## 更新日志 ## 更新日志
### v2.6.0
1. **新增 mj-proxy-plus 支持**:支持[第三方](https://api.lightai.io)中转,添加容错和重试机制。(可联系作者获得 mj-proxy-plus 支持)
2. **简化模型配置流程**:精简了 Midjourney 模型的配置要求,现在用户仅需填写地址和 key 即可完成后台配置,简化了操作步骤。
3. **新增模型排序**:引入了新的模型排序功能,优化了模型排序逻辑,以提升用户的操作体验。
4. **DALL-E 绘图功能整合**DALL-E 绘图功能现在可以在 Chat 组件内直接使用DALL-E-3 模型可以在后台进行单独配置。
5. **注意事项**:本次升级 Midjourney 对历史数据不兼容,在升级前请做好数据备份,以防数据丢失。
### v2.5.0 ### v2.5.0
1. **GPT-4Vgpt-4-1106-vision-preview模型识图功能**添加了GPT-4V的图像识别功能增强了模型的多媒体处理能力。 1. **GPT-4Vgpt-4-1106-vision-preview模型识图功能**:添加了 GPT-4V 的图像识别功能,增强了模型的多媒体处理能力。
2. **文件上传预览及显示美化**对文件上传预览及显示进行了美化目前仅支持4V和ALL模型。 2. **文件上传预览及显示美化**:对文件上传预览及显示进行了美化,目前仅支持 4V ALL 模型。
3. **简化模型切换逻辑**:简化了模型切换逻辑,支持更多国内模型。该功能需搭配类 OneAPI 的中转管理使用。 3. **简化模型切换逻辑**:简化了模型切换逻辑,支持更多国内模型。该功能需搭配类 OneAPI 的中转管理使用。
4. **Chat页面UI精简和美化**:对 Chat 页面进行了精简和美化。请注意,其他页面尚未进行同步优化,因此在多界面切换时可能会有一定的割裂感。后续将继续对其他页面进行优化。 4. **Chat 页面 UI 精简和美化**:对 Chat 页面进行了精简和美化。请注意,其他页面尚未进行同步优化,因此在多界面切换时可能会有一定的割裂感。后续将继续对其他页面进行优化。
### v2.4.5 ### v2.4.5
1. 部分页面UI精简。 1. 部分页面 UI 精简。
2. 管理端地址改为 `/admin`,默认密码均设为 `123456` 2. 管理端地址改为 `/admin`,默认密码均设为 `123456`
3. 支持使用 GPT-4-All第三方逆向解析上传的文件、图片。 3. 支持使用 GPT-4-All第三方逆向解析上传的文件、图片。
4. 增加模型关联 Token 计费(可选)。 4. 增加模型关联 Token 计费(可选)。
@ -38,21 +43,24 @@
## 环境准备 ## 环境准备
1. **安装Node.js环境** 1. **安装 Node.js 环境**
- 请根据您的操作系统下载并安装Node.js。
- 可以从[Node.js官网](https://nodejs.org/)下载。
2. **安装PM2** - 请根据您的操作系统下载并安装 Node.js。
- 使用npm安装PM2`npm install pm2 -g` - 可以从[Node.js 官网](https://nodejs.org/)下载。
- PM2是一个带有负载均衡功能的Node应用的进程管理器。
3. **安装PNPM** 2. **安装 PM2**
- 使用npm安装PNPM`npm install -g pnpm`
- PNPM是一个快速、节省磁盘空间的包管理工具。 - 使用 npm 安装 PM2`npm install pm2 -g`
- PM2 是一个带有负载均衡功能的 Node 应用的进程管理器。
3. **安装 PNPM**
- 使用 npm 安装 PNPM`npm install -g pnpm`
- PNPM 是一个快速、节省磁盘空间的包管理工具。
## 配置项目 ## 配置项目
1. **配置环境变量** 1. **配置环境变量**
- 复制`.env.example`文件为`.env`。 - 复制`.env.example`文件为`.env`。
- 根据需要修改`.env`文件中的配置项。 - 根据需要修改`.env`文件中的配置项。
@ -63,11 +71,12 @@
## 启动项目 ## 启动项目
1. **启动服务** 1. **启动服务**
- 使用命令:`pnpm start` - 使用命令:`pnpm start`
- 这将启动项目并默认在9520端口监听。 - 这将启动项目,并默认在 9520 端口监听。
2. **访问项目** 2. **访问项目**
- 在浏览器中访问`http://localhost:9520`或者如果配置了nginx反向代理则通过配置的域名访问。 - 在浏览器中访问`http://localhost:9520`,或者如果配置了 nginx 反向代理,则通过配置的域名访问。
## 管理平台 ## 管理平台
@ -99,10 +108,6 @@
## 学习交流 ## 学习交流
完整未编译源码暂未开源扫码添加微信备注99拉交流群 完整未编译源码暂未开源,扫码添加微信备注 99拉交流群
<img src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/ee20578f-063d-48d8-bff6-85ac3e38fe60" width="300"> <img src="https://github.com/vastxie/NineAIQuickDeploy/assets/24899308/ee20578f-063d-48d8-bff6-85ac3e38fe60" width="300">

View File

@ -16,6 +16,6 @@ var MidjourneyActionEnum;
MidjourneyActionEnum[MidjourneyActionEnum["VARIATION"] = 3] = "VARIATION"; MidjourneyActionEnum[MidjourneyActionEnum["VARIATION"] = 3] = "VARIATION";
MidjourneyActionEnum[MidjourneyActionEnum["GENERATE"] = 4] = "GENERATE"; MidjourneyActionEnum[MidjourneyActionEnum["GENERATE"] = 4] = "GENERATE";
MidjourneyActionEnum[MidjourneyActionEnum["REGENERATE"] = 5] = "REGENERATE"; MidjourneyActionEnum[MidjourneyActionEnum["REGENERATE"] = 5] = "REGENERATE";
MidjourneyActionEnum[MidjourneyActionEnum["ZOOM"] = 6] = "ZOOM"; MidjourneyActionEnum[MidjourneyActionEnum["VARY"] = 6] = "VARY";
MidjourneyActionEnum[MidjourneyActionEnum["VARY"] = 7] = "VARY"; MidjourneyActionEnum[MidjourneyActionEnum["ZOOM"] = 7] = "ZOOM";
})(MidjourneyActionEnum = exports.MidjourneyActionEnum || (exports.MidjourneyActionEnum = {})); })(MidjourneyActionEnum = exports.MidjourneyActionEnum || (exports.MidjourneyActionEnum = {}));

View File

@ -1,93 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendMessageFromBaidu = exports.getAccessToken = void 0;
const axios = require('axios');
const getApiModelMaps = () => {
let res = {};
const maps = {
'ERNIE-Bot': 'completions',
'ERNIE-Bot-turbo': 'eb-instant',
'BLOOMZ-7B': 'bloomz_7b1',
'ERNIE-Bot-4': 'completions_pro',
'Llama-2-7b-chat': 'llama_2_7b',
'Llama-2-13b-chat': 'llama_2_13b',
'ChatGLM2-6B-32K': 'chatglm2_6b_32k',
'Qianfan-Chinese-Llama-2-7B': 'qianfan_chinese_llama_2_7b',
};
Object.keys(maps).map(key => {
res[`${key.toLowerCase()}`] = maps[key];
});
return res;
};
function getAccessToken(key, secret) {
let url = `https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=${key}&client_secret=${secret}`;
return new Promise((resolve, reject) => {
axios
.post(url)
.then((response) => {
resolve(response.data.access_token);
})
.catch((error) => {
reject(error);
});
});
}
exports.getAccessToken = getAccessToken;
function sendMessageFromBaidu(messagesHistory, { onProgress, accessToken, model, temperature = 0.95 }) {
const endUrl = getApiModelMaps()[model.trim().toLowerCase()];
return new Promise((resolve, reject) => {
const url = `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/${endUrl}?access_token=${accessToken}`;
var options = {
method: 'POST',
url,
responseType: 'stream',
headers: {
'Content-Type': 'application/json',
},
data: {
stream: true,
messages: messagesHistory,
},
};
axios(options)
.then((response) => {
const stream = response.data;
let resData = {};
let cacheChunk = '';
let cacheResText = '';
stream.on('data', (chunk) => {
const lines = chunk
.toString()
.split('\n\n')
.filter((line) => line.trim() !== '');
for (const line of lines) {
const message = line.replace('data: ', '');
try {
const msg = cacheChunk + message;
const parseData = JSON.parse(msg);
cacheChunk = '';
const { is_end, result } = parseData;
result && (cacheResText += result);
if (is_end) {
resData = parseData;
resData.text = cacheResText;
}
onProgress(parseData);
}
catch (error) {
cacheChunk = message;
}
}
});
stream.on('end', () => {
cacheResText = '';
cacheChunk = '';
resolve(resData);
});
})
.catch((error) => {
reject(new Error(error));
});
});
}
exports.sendMessageFromBaidu = sendMessageFromBaidu;

View File

@ -21,7 +21,7 @@ const chatLog_service_1 = require("../chatLog/chatLog.service");
const chatLog_entity_1 = require("../chatLog/chatLog.entity"); const chatLog_entity_1 = require("../chatLog/chatLog.entity");
const accountLog_entity_1 = require("../userBalance/accountLog.entity"); const accountLog_entity_1 = require("../userBalance/accountLog.entity");
const config_entity_1 = require("../globalConfig/config.entity"); const config_entity_1 = require("../globalConfig/config.entity");
const gptkeys_entity_1 = require("./gptkeys.entity"); const gptKeys_entity_1 = require("./gptKeys.entity");
const whiteList_entity_1 = require("./whiteList.entity"); const whiteList_entity_1 = require("./whiteList.entity");
const cramiPackage_entity_1 = require("../crami/cramiPackage.entity"); const cramiPackage_entity_1 = require("../crami/cramiPackage.entity");
const chatGroup_entity_1 = require("../chatGroup/chatGroup.entity"); const chatGroup_entity_1 = require("../chatGroup/chatGroup.entity");
@ -48,7 +48,7 @@ ChatgptModule = __decorate([
chatLog_entity_1.ChatLogEntity, chatLog_entity_1.ChatLogEntity,
accountLog_entity_1.AccountLogEntity, accountLog_entity_1.AccountLogEntity,
config_entity_1.ConfigEntity, config_entity_1.ConfigEntity,
gptkeys_entity_1.GptKeysEntity, gptKeys_entity_1.GptKeysEntity,
whiteList_entity_1.WhiteListEntity, whiteList_entity_1.WhiteListEntity,
user_entity_1.UserEntity, user_entity_1.UserEntity,
cramiPackage_entity_1.CramiPackageEntity, cramiPackage_entity_1.CramiPackageEntity,

View File

@ -29,7 +29,7 @@ const typeorm_1 = require("typeorm");
const typeorm_2 = require("@nestjs/typeorm"); const typeorm_2 = require("@nestjs/typeorm");
const badwords_service_1 = require("../badwords/badwords.service"); const badwords_service_1 = require("../badwords/badwords.service");
const autoreply_service_1 = require("../autoreply/autoreply.service"); const autoreply_service_1 = require("../autoreply/autoreply.service");
const gptkeys_entity_1 = require("./gptkeys.entity"); const gptKeys_entity_1 = require("./gptKeys.entity");
const globalConfig_service_1 = require("../globalConfig/globalConfig.service"); const globalConfig_service_1 = require("../globalConfig/globalConfig.service");
const fanyi_service_1 = require("../fanyi/fanyi.service"); const fanyi_service_1 = require("../fanyi/fanyi.service");
const app_entity_1 = require("../app/app.entity"); const app_entity_1 = require("../app/app.entity");
@ -127,7 +127,7 @@ let ChatgptService = class ChatgptService {
} }
} }
async chatProcess(body, req, res) { async chatProcess(body, req, res) {
var _a, _b, _c; var _a, _b, _c, _d;
const abortController = req.abortController; const abortController = req.abortController;
const { options = {}, appId, cusromPrompt, systemMessage = '' } = body; const { options = {}, appId, cusromPrompt, systemMessage = '' } = body;
let setSystemMessage = systemMessage; let setSystemMessage = systemMessage;
@ -184,7 +184,6 @@ let ChatgptService = class ChatgptService {
setSystemMessage = systemPreMessage + `\n Current date: ${currentDate}`; setSystemMessage = systemPreMessage + `\n Current date: ${currentDate}`;
} }
const mergedOptions = await this.getRequestParams(options, setSystemMessage, currentRequestModelKey, groupConfig.modelInfo); const mergedOptions = await this.getRequestParams(options, setSystemMessage, currentRequestModelKey, groupConfig.modelInfo);
const { maxModelTokens = 8000, maxResponseTokens = 4096, key } = currentRequestModelKey;
res && res.status(200); res && res.status(200);
let response = null; let response = null;
let othersInfo = null; let othersInfo = null;
@ -270,6 +269,7 @@ let ChatgptService = class ChatgptService {
maxTokenRes, maxTokenRes,
apiKey: modelKey, apiKey: modelKey,
model, model,
prompt,
fileInfo, fileInfo,
temperature, temperature,
proxyUrl: proxyResUrl, proxyUrl: proxyResUrl,
@ -277,8 +277,8 @@ let ChatgptService = class ChatgptService {
res.write(firstChunk ? JSON.stringify(chat) : `\n${JSON.stringify(chat)}`); res.write(firstChunk ? JSON.stringify(chat) : `\n${JSON.stringify(chat)}`);
lastChat = chat; lastChat = chat;
firstChunk = false; firstChunk = false;
}, }
}); }, this.uploadService);
isSuccess = true; isSuccess = true;
const userMessageData = { const userMessageData = {
id: this.nineStore.getUuid(), id: this.nineStore.getUuid(),
@ -297,7 +297,8 @@ let ChatgptService = class ChatgptService {
text: response.text, text: response.text,
role: 'assistant', role: 'assistant',
name: undefined, name: undefined,
usage: response.usage, usage: response === null || response === void 0 ? void 0 : response.usage,
fileInfo: response === null || response === void 0 ? void 0 : response.fileInfo,
parentMessageId: userMessageData.id, parentMessageId: userMessageData.id,
conversationId: response === null || response === void 0 ? void 0 : response.conversationId, conversationId: response === null || response === void 0 ? void 0 : response.conversationId,
}; };
@ -319,10 +320,11 @@ let ChatgptService = class ChatgptService {
temperature, temperature,
proxyUrl: proxyResUrl, proxyUrl: proxyResUrl,
onProgress: null, onProgress: null,
prompt,
}); });
} }
let { usage } = response === null || response === void 0 ? void 0 : response.detail; const usage = ((_a = response.detail) === null || _a === void 0 ? void 0 : _a.usage) || { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 };
const { prompt_tokens = 0, completion_tokens = 0, total_tokens = 0 } = usage; const { prompt_tokens, completion_tokens, total_tokens } = usage;
let charge = deduct; let charge = deduct;
if (isTokenBased === true) { if (isTokenBased === true) {
charge = Math.ceil((deduct * total_tokens) / tokenFeeRatio); charge = Math.ceil((deduct * total_tokens) / tokenFeeRatio);
@ -355,6 +357,7 @@ let ChatgptService = class ChatgptService {
userId: req.user.id, userId: req.user.id,
type: balance_constant_1.DeductionKey.CHAT_TYPE, type: balance_constant_1.DeductionKey.CHAT_TYPE,
prompt: prompt, prompt: prompt,
fileInfo: response === null || response === void 0 ? void 0 : response.fileInfo,
answer: response.text, answer: response.text,
promptTokens: prompt_tokens, promptTokens: prompt_tokens,
completionTokens: completion_tokens, completionTokens: completion_tokens,
@ -376,7 +379,7 @@ let ChatgptService = class ChatgptService {
temperature, temperature,
}), }),
}); });
common_1.Logger.debug(`本次调用: ${req.user.id} model: ${model} key -> ${key}, 模型名称: ${modelName}, 最大回复token: ${maxResponseTokens}`, 'ChatgptService'); common_1.Logger.debug(`户ID: ${req.user.id} 模型名称: ${modelName}-${model}, 消耗token: ${total_tokens}, 消耗积分: ${charge}`, 'ChatgptService');
const userBalance = await this.userBalanceService.queryUserBalance(req.user.id); const userBalance = await this.userBalanceService.queryUserBalance(req.user.id);
response.userBanance = Object.assign({}, userBalance); response.userBanance = Object.assign({}, userBalance);
response.result && (response.result = ''); response.result && (response.result = '');
@ -391,8 +394,8 @@ let ChatgptService = class ChatgptService {
catch (error) { catch (error) {
console.log('chat-error <----------------------------------------->', modelKey, error); console.log('chat-error <----------------------------------------->', modelKey, error);
const code = (error === null || error === void 0 ? void 0 : error.statusCode) || 400; const code = (error === null || error === void 0 ? void 0 : error.statusCode) || 400;
const status = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) || (error === null || error === void 0 ? void 0 : error.statusCode) || 400; const status = ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status) || (error === null || error === void 0 ? void 0 : error.statusCode) || 400;
console.log('chat-error-detail <----------------------------------------->', 'code: ', code, 'message', error === null || error === void 0 ? void 0 : error.message, 'statusText:', (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.statusText, 'status', (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.status); console.log('chat-error-detail <----------------------------------------->', 'code: ', code, 'message', error === null || error === void 0 ? void 0 : error.message, 'statusText:', (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.statusText, 'status', (_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.status);
if (error.status && error.status === 402) { if (error.status && error.status === 402) {
const errMsg = { message: `Catch Error ${error.message}`, code: 402 }; const errMsg = { message: `Catch Error ${error.message}`, code: 402 };
if (res) { if (res) {
@ -452,7 +455,7 @@ let ChatgptService = class ChatgptService {
const money = (body === null || body === void 0 ? void 0 : body.quality) === 'hd' ? 4 : 2; const money = (body === null || body === void 0 ? void 0 : body.quality) === 'hd' ? 4 : 2;
await this.userBalanceService.validateBalance(req, 'mjDraw', money); await this.userBalanceService.validateBalance(req, 'mjDraw', money);
let images = []; let images = [];
const detailKeyInfo = await this.modelsService.getRandomDrawKey(); const detailKeyInfo = await this.modelsService.getCurrentModelKeyInfo('dall-e-3');
const keyId = detailKeyInfo === null || detailKeyInfo === void 0 ? void 0 : detailKeyInfo.id; const keyId = detailKeyInfo === null || detailKeyInfo === void 0 ? void 0 : detailKeyInfo.id;
const { key, proxyResUrl } = await this.formatModelToken(detailKeyInfo); const { key, proxyResUrl } = await this.formatModelToken(detailKeyInfo);
common_1.Logger.log(`draw paompt info <==**==> ${body.prompt}, key ===> ${key}`, 'DrawService'); common_1.Logger.log(`draw paompt info <==**==> ${body.prompt}, key ===> ${key}`, 'DrawService');
@ -795,7 +798,7 @@ let ChatgptService = class ChatgptService {
}; };
ChatgptService = __decorate([ ChatgptService = __decorate([
(0, common_1.Injectable)(), (0, common_1.Injectable)(),
__param(0, (0, typeorm_2.InjectRepository)(gptkeys_entity_1.GptKeysEntity)), __param(0, (0, typeorm_2.InjectRepository)(gptKeys_entity_1.GptKeysEntity)),
__param(1, (0, typeorm_2.InjectRepository)(config_entity_1.ConfigEntity)), __param(1, (0, typeorm_2.InjectRepository)(config_entity_1.ConfigEntity)),
__param(2, (0, typeorm_2.InjectRepository)(chatBoxType_entity_1.ChatBoxTypeEntity)), __param(2, (0, typeorm_2.InjectRepository)(chatBoxType_entity_1.ChatBoxTypeEntity)),
__param(3, (0, typeorm_2.InjectRepository)(chatBox_entity_1.ChatBoxEntity)), __param(3, (0, typeorm_2.InjectRepository)(chatBox_entity_1.ChatBoxEntity)),

View File

@ -3,39 +3,105 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.getTokenCount = exports.sendMessageFromOpenAi = void 0; exports.getTokenCount = exports.sendMessageFromOpenAi = void 0;
const axios_1 = require("axios"); const axios_1 = require("axios");
const tiktoken_1 = require("@dqbd/tiktoken"); const tiktoken_1 = require("@dqbd/tiktoken");
const utils_1 = require("../../common/utils"); const common_1 = require("@nestjs/common");
const uuid = require("uuid");
const tokenizer = (0, tiktoken_1.get_encoding)('cl100k_base'); const tokenizer = (0, tiktoken_1.get_encoding)('cl100k_base');
function getFullUrl(proxyUrl) { function getFullUrl(proxyUrl) {
const processedUrl = proxyUrl.endsWith('/') ? proxyUrl.slice(0, -1) : proxyUrl; const processedUrl = proxyUrl.endsWith('/') ? proxyUrl.slice(0, -1) : proxyUrl;
const baseUrl = processedUrl || 'https://api.openai.com'; const baseUrl = processedUrl || 'https://api.openai.com';
return `${baseUrl}/v1/chat/completions`; return `${baseUrl}/v1/chat/completions`;
} }
function sendMessageFromOpenAi(messagesHistory, inputs) { async function sendMessageFromOpenAi(messagesHistory, inputs, uploadService) {
var _a; var _a, _b, _c, _d;
const { onProgress, maxToken, apiKey, model, temperature = 0.95, proxyUrl } = inputs; const { onProgress, maxToken, apiKey, model, temperature = 0.8, proxyUrl, prompt } = inputs;
const max_tokens = compilerToken(model, maxToken); if (model.includes('dall')) {
let result = { text: '', fileInfo: '' };
try {
const options = {
method: 'POST',
url: `${proxyUrl}/v1/images/generations`,
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${apiKey}`,
},
data: {
prompt: prompt,
model: model,
response_format: 'b64_json'
},
};
const response = await (0, axios_1.default)(options);
const { b64_json, revised_prompt } = response.data.data[0];
const buffer = Buffer.from(b64_json, 'base64');
let imgUrl = '';
try {
const filename = uuid.v4().slice(0, 10) + '.png';
common_1.Logger.debug(`------> 开始上传图片!!!`, 'MidjourneyService');
const buffer = Buffer.from(b64_json, 'base64');
imgUrl = await uploadService.uploadFile({ filename, buffer });
common_1.Logger.debug(`图片上传成功URL: ${imgUrl}`, 'MidjourneyService');
}
catch (error) {
common_1.Logger.error(`上传图片过程中出现错误: ${error}`, 'MidjourneyService');
}
result.fileInfo = imgUrl;
result.text = revised_prompt;
onProgress && onProgress({ text: result.text });
return result;
}
catch (error) {
const status = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) || 500;
console.log('openai-draw error: ', JSON.stringify(error), status);
const message = (_d = (_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) === null || _d === void 0 ? void 0 : _d.message;
if (status === 429) {
result.text = '当前请求已过载、请稍等会儿再试试吧!';
return result;
}
if (status === 400 && message.includes('This request has been blocked by our content filters')) {
result.text = '您的请求已被系统拒绝。您的提示可能存在一些非法的文本。';
return result;
}
if (status === 400 && message.includes('Billing hard limit has been reached')) {
result.text = '当前模型key已被封禁、已冻结当前调用Key、尝试重新对话试试吧';
return result;
}
if (status === 500) {
result.text = '绘制图片失败,请检查你的提示词是否有非法描述!';
return result;
}
if (status === 401) {
result.text = '绘制图片失败,此次绘画被拒绝了!';
return result;
}
result.text = '绘制图片失败,请稍后试试吧!';
return result;
}
}
else {
let result = { text: '' };
const options = { const options = {
method: 'POST', method: 'POST',
url: getFullUrl(proxyUrl), url: getFullUrl(proxyUrl),
responseType: 'stream', responseType: 'stream',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
Authorization: `Bearer ${(0, utils_1.removeSpecialCharacters)(apiKey)}`, Accept: "application/json",
Authorization: `Bearer ${apiKey}`,
}, },
data: { data: {
max_tokens,
stream: true, stream: true,
temperature, temperature,
model, model,
messages: messagesHistory messages: messagesHistory,
}, },
}; };
const prompt = (_a = messagesHistory[messagesHistory.length - 1]) === null || _a === void 0 ? void 0 : _a.content; if (model === 'gpt-4-vision-preview') {
options.data.max_tokens = 2048;
}
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
try { try {
const response = await (0, axios_1.default)(options); const response = await (0, axios_1.default)(options);
const stream = response.data; const stream = response.data;
let result = { text: '' };
stream.on('data', (chunk) => { stream.on('data', (chunk) => {
var _a; var _a;
const splitArr = chunk.toString().split('\n\n').filter((line) => line.trim() !== ''); const splitArr = chunk.toString().split('\n\n').filter((line) => line.trim() !== '');
@ -53,6 +119,7 @@ function sendMessageFromOpenAi(messagesHistory, inputs) {
return result; return result;
} }
try { try {
if (data !== " [DONE]" && data !== "[DONE]" && data != "[DONE] ") {
const parsedData = JSON.parse(data); const parsedData = JSON.parse(data);
if (parsedData.id) { if (parsedData.id) {
result.id = parsedData.id; result.id = parsedData.id;
@ -69,14 +136,19 @@ function sendMessageFromOpenAi(messagesHistory, inputs) {
} }
onProgress && onProgress({ text: result.text }); onProgress && onProgress({ text: result.text });
} }
}
catch (error) { catch (error) {
console.log('parse Error', data); console.log('parse Error', data);
} }
} }
}); });
let totalText = '';
messagesHistory.forEach(message => {
totalText += message.content + ' ';
});
stream.on('end', () => { stream.on('end', () => {
if (result.detail && result.text) { if (result.detail && result.text) {
const promptTokens = getTokenCount(prompt); const promptTokens = getTokenCount(totalText);
const completionTokens = getTokenCount(result.text); const completionTokens = getTokenCount(result.text);
result.detail.usage = { result.detail.usage = {
prompt_tokens: promptTokens, prompt_tokens: promptTokens,
@ -92,6 +164,7 @@ function sendMessageFromOpenAi(messagesHistory, inputs) {
reject(error); reject(error);
} }
}); });
}
} }
exports.sendMessageFromOpenAi = sendMessageFromOpenAi; exports.sendMessageFromOpenAi = sendMessageFromOpenAi;
function getTokenCount(text) { function getTokenCount(text) {
@ -104,19 +177,3 @@ function getTokenCount(text) {
return tokenizer.encode(text).length; return tokenizer.encode(text).length;
} }
exports.getTokenCount = getTokenCount; exports.getTokenCount = getTokenCount;
function compilerToken(model, maxToken) {
let max = 0;
if (model.includes(3.5)) {
max = maxToken > 4096 ? 4096 : maxToken;
}
if (model.includes('gpt-4')) {
max = maxToken > 8192 ? 8192 : maxToken;
}
if (model.includes('preview')) {
max = maxToken > 4096 ? 4096 : maxToken;
}
if (model.includes('32k')) {
max = maxToken > 32768 ? 32768 : maxToken;
}
return max;
}

View File

@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.NineStore = void 0; exports.NineStore = void 0;
const uuid_1 = require("uuid"); const uuid_1 = require("uuid");
const tiktoken_1 = require("@dqbd/tiktoken"); const tiktoken_1 = require("@dqbd/tiktoken");
const common_1 = require("@nestjs/common");
const tokenizer = (0, tiktoken_1.get_encoding)('cl100k_base'); const tokenizer = (0, tiktoken_1.get_encoding)('cl100k_base');
class NineStore { class NineStore {
constructor(options) { constructor(options) {
@ -32,7 +31,7 @@ class NineStore {
let messages = []; let messages = [];
let nextNumTokensEstimate = 0; let nextNumTokensEstimate = 0;
if (systemMessage) { if (systemMessage) {
const specialModels = ['gemini-pro', 'ERNIE', 'qwen', 'SparkDesk', 'hunyuan']; const specialModels = ['gemini-pro', 'ERNIE', 'hunyuan'];
const isSpecialModel = model && specialModels.some(specialModel => model.includes(specialModel)); const isSpecialModel = model && specialModels.some(specialModel => model.includes(specialModel));
if (isSpecialModel) { if (isSpecialModel) {
messages.push({ role: 'user', content: systemMessage, name }); messages.push({ role: 'user', content: systemMessage, name });
@ -65,7 +64,6 @@ class NineStore {
} }
messages.push({ role: 'user', content: text, name }); messages.push({ role: 'user', content: text, name });
} }
common_1.Logger.debug(`发送的参数:${messages}`);
let nextMessages = messages; let nextMessages = messages;
do { do {
if (!parentMessageId) { if (!parentMessageId) {
@ -77,7 +75,7 @@ class NineStore {
} }
const { text, name, role, fileInfo } = parentMessage; const { text, name, role, fileInfo } = parentMessage;
let content = text; let content = text;
if (role === 'user' && fileInfo) { if (fileInfo) {
if (model === 'gpt-4-vision-preview') { if (model === 'gpt-4-vision-preview') {
content = [ content = [
{ "type": "text", "text": text }, { "type": "text", "text": text },

View File

@ -1,101 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendMessageFromZhipu = exports.compilerStream = exports.compilerMetaJsonStr = exports.generateToken = void 0;
const axios = require('axios');
const jwt = require('jsonwebtoken');
function generateToken(apikey, expSeconds = 1000 * 60 * 60 * 24 * 360) {
const [id, secret] = apikey.split('.');
const payload = {
api_key: id,
exp: Math.round(Date.now()) + expSeconds * 1000,
timestamp: Math.round(Date.now()),
};
return jwt.sign(payload, secret, { algorithm: 'HS256', header: { alg: 'HS256', sign_type: 'SIGN' } });
}
exports.generateToken = generateToken;
function compilerMetaJsonStr(data) {
let jsonStr = {};
try {
jsonStr = JSON.parse(data);
}
catch (error) {
jsonStr = {
usage: {
completion_tokens: 49,
prompt_tokens: 333,
total_tokens: 399
},
};
console.error('json parse error from zhipu!', data);
}
return jsonStr;
}
exports.compilerMetaJsonStr = compilerMetaJsonStr;
function compilerStream(streamArr) {
var _a;
if (streamArr.length === 3) {
return {
event: streamArr[0].replace('event:', ''),
id: streamArr[1].replace('id:', ''),
is_end: false,
result: streamArr[2].replace('data:', '').trim()
};
}
if (streamArr.length === 4) {
return {
event: streamArr[0].replace('event:', ''),
id: streamArr[1].replace('id:', ''),
result: streamArr[2].replace('data:', '').trim(),
is_end: true,
usage: (_a = compilerMetaJsonStr(streamArr[3].replace('meta:', ''))) === null || _a === void 0 ? void 0 : _a.usage
};
}
}
exports.compilerStream = compilerStream;
async function sendMessageFromZhipu(messagesHistory, { onProgress, key, model, temperature = 0.95 }) {
const token = await generateToken(key);
return new Promise((resolve, reject) => {
const url = `https://open.bigmodel.cn/api/paas/v3/model-api/${model}/sse-invoke`;
const options = {
method: 'POST',
url,
responseType: 'stream',
headers: {
'Content-Type': 'application/json',
'Authorization': token
},
data: {
prompt: messagesHistory,
temperature
}
};
axios(options)
.then(response => {
const stream = response.data;
let resData;
let cacheResText = '';
stream.on('data', chunk => {
const stramArr = chunk.toString().split("\n").filter((line) => line.trim() !== "");
const parseData = compilerStream(stramArr);
if (!parseData)
return;
const { id, result, is_end } = parseData;
result && (cacheResText += result.trim());
if (is_end) {
parseData.is_end = false;
resData = parseData;
resData.text = cacheResText;
}
onProgress(parseData);
});
stream.on('end', () => {
resolve(resData);
cacheResText = '';
});
})
.catch(error => {
console.log('error: ', error);
});
});
}
exports.sendMessageFromZhipu = sendMessageFromZhipu;

View File

@ -26,10 +26,10 @@ let DatabaseService = class DatabaseService {
if (!user || user.length === 0) { if (!user || user.length === 0) {
const superPassword = bcrypt.hashSync('123456', 10); const superPassword = bcrypt.hashSync('123456', 10);
const adminPassword = bcrypt.hashSync('123456', 10); const adminPassword = bcrypt.hashSync('123456', 10);
const superEmail = 'default@cooper.com'; const superEmail = 'super';
const adminEmail = 'defaultAdmin@cooper.com'; const adminEmail = 'admin';
const superUserinfo = { username: 'super', password: superPassword, status: 1, email: superEmail, sex: 1, role: 'super' }; const superUserinfo = { username: 'super', password: superPassword, status: 1, email: superEmail, sex: 1, role: 'super' };
const adminUserinfo = { username: 'admin', password: adminPassword, status: 1, email: adminEmail, sex: 1, role: 'admin' }; const adminUserinfo = { username: 'admin', password: adminPassword, status: 0, email: adminEmail, sex: 1, role: 'admin' };
await this.createDefaultUser(superUserinfo); await this.createDefaultUser(superUserinfo);
await this.createDefaultUser(adminUserinfo); await this.createDefaultUser(adminUserinfo);
} }
@ -59,83 +59,70 @@ let DatabaseService = class DatabaseService {
} }
async createBaseSiteConfig() { async createBaseSiteConfig() {
try { try {
const code = ` const code = ``;
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?cb8c9a3bcadbc200e950b05f9c61a385";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
`;
const noticeInfo = ` const noticeInfo = `
#### NineAi 欢迎您 #### AIWeb 欢迎您
- NineAi唯一官方网站 https://ai.jiangly.com - 欢迎使用 AIWeb
- NineAi 作者VX J_longyan - 初始管理员账号密码 super 123456 前台后台登录都可以修改
- NineAi 作者QQ 927898639
- 欢迎使用Nine
- 初始管理员账号密码 super nine-super 前台后台登录都可以修改
- 初始预览账号密码 admin 123456 为后台查看账号 仅可查看部分非敏感数据 - 初始预览账号密码 admin 123456 为后台查看账号 仅可查看部分非敏感数据
`; `;
const defaultConfig = [ const defaultConfig = [
{ configKey: 'siteName', configVal: 'Nine Ai', public: 1, encry: 0 }, { configKey: 'siteName', configVal: '', public: 1, encry: 0 },
{ configKey: 'qqNumber', configVal: '840814166', public: 1, encry: 0 }, { configKey: 'qqNumber', configVal: '', public: 1, encry: 0 },
{ configKey: 'vxNumber', configVal: 'wangpanzhu321', public: 1, encry: 0 }, { configKey: 'vxNumber', configVal: '', public: 1, encry: 0 },
{ configKey: 'robotAvatar', configVal: '', public: 1, encry: 0 }, { configKey: 'robotAvatar', configVal: '', public: 1, encry: 0 },
{ {
configKey: 'userDefautlAvatar', configKey: 'userDefautlAvatar',
configVal: 'https://public-1300678944.cos.ap-shanghai.myqcloud.com/blog/1682571295452image.png', configVal: '',
public: 0, public: 0,
encry: 0, encry: 0,
}, },
{ configKey: 'baiduCode', configVal: code, public: 1, encry: 0 }, { configKey: 'baiduCode', configVal: code, public: 1, encry: 0 },
{ configKey: 'baiduSiteId', configVal: '19024441', public: 0, encry: 0 }, { configKey: 'baiduSiteId', configVal: '', public: 0, encry: 0 },
{ {
configKey: 'baiduToken', configKey: 'baiduToken',
configVal: '121.a1600b9b60910feea2ef627ea9776a6f.YGP_CWCOA2lNcIGJ27BwXGxa6nZhBQyLUS4XVaD.TWt9TA', configVal: '',
public: 0, public: 0,
encry: 0, encry: 0,
}, },
{ configKey: 'buyCramiAddress', configVal: '', public: 1, encry: 0 }, { configKey: 'buyCramiAddress', configVal: '', public: 1, encry: 0 },
{ configKey: 'openaiBaseUrl', configVal: 'https://api.openai.com', public: 0, encry: 0 }, { configKey: 'openaiBaseUrl', configVal: 'https://api.lightai.io', public: 0, encry: 0 },
{ configKey: 'noticeInfo', configVal: noticeInfo, public: 1, encry: 0 }, { configKey: 'noticeInfo', configVal: noticeInfo, public: 1, encry: 0 },
{ configKey: 'registerVerifyEmailTitle', configVal: 'NineTeam团队账号验证', public: 0, encry: 0 }, { configKey: 'registerVerifyEmailTitle', configVal: 'AIWeb账号验证', public: 0, encry: 0 },
{ {
configKey: 'registerVerifyEmailDesc', configKey: 'registerVerifyEmailDesc',
configVal: '欢迎使用Nine Team团队的产品服务,请在五分钟内完成你的账号激活,点击以下按钮激活您的账号,', configVal: '欢迎使用AI Web团队的产品服务,请在五分钟内完成你的账号激活,点击以下按钮激活您的账号,',
public: 0, public: 0,
encry: 0, encry: 0,
}, },
{ configKey: 'registerVerifyEmailFrom', configVal: 'NineTeam团队', public: 0, encry: 0 }, { configKey: 'registerVerifyEmailFrom', configVal: 'AI Web团队', public: 0, encry: 0 },
{ configKey: 'registerVerifyExpir', configVal: '1800', public: 0, encry: 0 }, { configKey: 'registerVerifyExpir', configVal: '1800', public: 0, encry: 0 },
{ configKey: 'registerSuccessEmailTitle', configVal: 'NineTeam团队账号激活成功', public: 0, encry: 0 }, { configKey: 'registerSuccessEmailTitle', configVal: 'AIWeb账号激活成功', public: 0, encry: 0 },
{ configKey: 'registerSuccessEmailTeamName', configVal: 'NineTeam团队', public: 0, encry: 0 }, { configKey: 'registerSuccessEmailTeamName', configVal: 'AIWeb', public: 0, encry: 0 },
{ {
configKey: 'registerSuccessEmaileAppend', configKey: 'registerSuccessEmaileAppend',
configVal: ',请妥善保管您的账号,我们将为您赠送50次对话额度和5次绘画额度、祝您使用愉快', configVal: ',请妥善保管您的账号,祝您使用愉快',
public: 0, public: 0,
encry: 0, encry: 0,
}, },
{ configKey: 'registerFailEmailTitle', configVal: 'NineTeam账号激活失败', public: 0, encry: 0 }, { configKey: 'registerFailEmailTitle', configVal: 'AIWeb账号激活失败', public: 0, encry: 0 },
{ configKey: 'registerFailEmailTeamName', configVal: 'NineTeam团队', public: 0, encry: 0 }, { configKey: 'registerFailEmailTeamName', configVal: 'AIWeb团队', public: 0, encry: 0 },
{ configKey: 'registerSendStatus', configVal: '1', public: 1, encry: 0 }, { configKey: 'registerSendStatus', configVal: '1', public: 1, encry: 0 },
{ configKey: 'registerSendModel3Count', configVal: '30', public: 1, encry: 0 }, { configKey: 'registerSendModel3Count', configVal: '30', public: 1, encry: 0 },
{ configKey: 'registerSendModel4Count', configVal: '3', public: 1, encry: 0 }, { configKey: 'registerSendModel4Count', configVal: '3', public: 1, encry: 0 },
{ configKey: 'registerSendDrawMjCount', configVal: '3', public: 1, encry: 0 }, { configKey: 'registerSendDrawMjCount', configVal: '3', public: 1, encry: 0 },
{ configKey: 'firstRegisterSendStatus', configVal: '1', public: 1, encry: 0 }, { configKey: 'firstRegisterSendStatus', configVal: '1', public: 1, encry: 0 },
{ configKey: 'firstRegisterSendRank', configVal: '500', public: 1, encry: 0 }, { configKey: 'firstRegisterSendRank', configVal: '500', public: 1, encry: 0 },
{ configKey: 'firstRregisterSendModel3Count', configVal: '20', public: 1, encry: 0 }, { configKey: 'firstRregisterSendModel3Count', configVal: '10', public: 1, encry: 0 },
{ configKey: 'firstRregisterSendModel4Count', configVal: '2', public: 1, encry: 0 }, { configKey: 'firstRregisterSendModel4Count', configVal: '10', public: 1, encry: 0 },
{ configKey: 'firstRregisterSendDrawMjCount', configVal: '3', public: 1, encry: 0 }, { configKey: 'firstRregisterSendDrawMjCount', configVal: '10', public: 1, encry: 0 },
{ configKey: 'inviteSendStatus', configVal: '1', public: 1, encry: 0 }, { configKey: 'inviteSendStatus', configVal: '1', public: 1, encry: 0 },
{ configKey: 'inviteGiveSendModel3Count', configVal: '30', public: 1, encry: 0 }, { configKey: 'inviteGiveSendModel3Count', configVal: '0', public: 1, encry: 0 },
{ configKey: 'inviteGiveSendModel4Count', configVal: '3', public: 1, encry: 0 }, { configKey: 'inviteGiveSendModel4Count', configVal: '0', public: 1, encry: 0 },
{ configKey: 'inviteGiveSendDrawMjCount', configVal: '1', public: 1, encry: 0 }, { configKey: 'inviteGiveSendDrawMjCount', configVal: '0', public: 1, encry: 0 },
{ configKey: 'invitedGuestSendModel3Count', configVal: '10', public: 1, encry: 0 }, { configKey: 'invitedGuestSendModel3Count', configVal: '10', public: 1, encry: 0 },
{ configKey: 'invitedGuestSendModel4Count', configVal: '1', public: 1, encry: 0 }, { configKey: 'invitedGuestSendModel4Count', configVal: '10', public: 1, encry: 0 },
{ configKey: 'invitedGuestSendDrawMjCount', configVal: '1', public: 1, encry: 0 }, { configKey: 'invitedGuestSendDrawMjCount', configVal: '10', public: 1, encry: 0 },
{ configKey: 'isVerifyEmail', configVal: '1', public: 1, encry: 0 }, { configKey: 'isVerifyEmail', configVal: '1', public: 1, encry: 0 },
]; ];
const res = await this.connection.query(`INSERT INTO config (configKey, configVal, public, encry) VALUES ${defaultConfig const res = await this.connection.query(`INSERT INTO config (configKey, configVal, public, encry) VALUES ${defaultConfig

View File

@ -38,10 +38,6 @@ __decorate([
(0, typeorm_1.Column)({ comment: '垫图图片 + 绘画描述词 + 额外参数 = 完整的prompt', type: 'text' }), (0, typeorm_1.Column)({ comment: '垫图图片 + 绘画描述词 + 额外参数 = 完整的prompt', type: 'text' }),
__metadata("design:type", String) __metadata("design:type", String)
], MidjourneyEntity.prototype, "fullPrompt", void 0); ], MidjourneyEntity.prototype, "fullPrompt", void 0);
__decorate([
(0, typeorm_1.Column)({ comment: '随机产生的绘画ID用于拿取比对结果' }),
__metadata("design:type", String)
], MidjourneyEntity.prototype, "randomDrawId", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '当前绘制任务的进度', nullable: true }), (0, typeorm_1.Column)({ comment: '当前绘制任务的进度', nullable: true }),
__metadata("design:type", Number) __metadata("design:type", Number)
@ -56,7 +52,7 @@ __decorate([
], MidjourneyEntity.prototype, "status", void 0); ], MidjourneyEntity.prototype, "status", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: 'mj绘画的动作、绘图、放大、变换、图生图' }), (0, typeorm_1.Column)({ comment: 'mj绘画的动作、绘图、放大、变换、图生图' }),
__metadata("design:type", Number) __metadata("design:type", String)
], MidjourneyEntity.prototype, "action", void 0); ], MidjourneyEntity.prototype, "action", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '一组图片的第几张、放大或者变换的时候需要使用', nullable: true }), (0, typeorm_1.Column)({ comment: '一组图片的第几张、放大或者变换的时候需要使用', nullable: true }),
@ -66,18 +62,22 @@ __decorate([
(0, typeorm_1.Column)({ comment: '是否推荐0: 默认不推荐 1: 推荐', nullable: true, default: 0 }), (0, typeorm_1.Column)({ comment: '是否推荐0: 默认不推荐 1: 推荐', nullable: true, default: 0 }),
__metadata("design:type", Number) __metadata("design:type", Number)
], MidjourneyEntity.prototype, "rec", void 0); ], MidjourneyEntity.prototype, "rec", void 0);
__decorate([
(0, typeorm_1.Column)({ comment: '对图片操作的', nullable: true }),
__metadata("design:type", String)
], MidjourneyEntity.prototype, "customId", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '绘画的ID每条不一样', nullable: true }), (0, typeorm_1.Column)({ comment: '绘画的ID每条不一样', nullable: true }),
__metadata("design:type", String) __metadata("design:type", String)
], MidjourneyEntity.prototype, "message_id", void 0); ], MidjourneyEntity.prototype, "drawId", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '对图片放大或者变体的ID', nullable: true }), (0, typeorm_1.Column)({ comment: '图片链接', nullable: true, type: 'text' }),
__metadata("design:type", String) __metadata("design:type", String)
], MidjourneyEntity.prototype, "custom_id", void 0); ], MidjourneyEntity.prototype, "drawUrl", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '图片信息尺寸', nullable: true, type: 'text' }), (0, typeorm_1.Column)({ comment: '图片比例', nullable: true, type: 'text' }),
__metadata("design:type", String) __metadata("design:type", String)
], MidjourneyEntity.prototype, "fileInfo", void 0); ], MidjourneyEntity.prototype, "drawRatio", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '扩展参数', nullable: true, type: 'text' }), (0, typeorm_1.Column)({ comment: '扩展参数', nullable: true, type: 'text' }),
__metadata("design:type", String) __metadata("design:type", String)

View File

@ -22,19 +22,18 @@ const axios_1 = require("axios");
const globalConfig_service_1 = require("../globalConfig/globalConfig.service"); const globalConfig_service_1 = require("../globalConfig/globalConfig.service");
const midjourney_constant_1 = require("../../common/constants/midjourney.constant"); const midjourney_constant_1 = require("../../common/constants/midjourney.constant");
const upload_service_1 = require("../upload/upload.service"); const upload_service_1 = require("../upload/upload.service");
const badwords_service_1 = require("../badwords/badwords.service");
const userBalance_service_1 = require("../userBalance/userBalance.service"); const userBalance_service_1 = require("../userBalance/userBalance.service");
const utils_1 = require("../../common/utils"); const utils_1 = require("../../common/utils");
const redisCache_service_1 = require("../redisCache/redisCache.service"); const redisCache_service_1 = require("../redisCache/redisCache.service");
const prompt_entity_1 = require("./prompt.entity"); const prompt_entity_1 = require("./prompt.entity");
const image_size_1 = require("image-size");
let MidjourneyService = class MidjourneyService { let MidjourneyService = class MidjourneyService {
constructor(midjourneyEntity, userEntity, mjPromptsEntity, globalConfigService, uploadService, badwordsService, userBalanceService, redisCacheService) { constructor(midjourneyEntity, userEntity, mjPromptsEntity, globalConfigService, uploadService, userBalanceService, redisCacheService) {
this.midjourneyEntity = midjourneyEntity; this.midjourneyEntity = midjourneyEntity;
this.userEntity = userEntity; this.userEntity = userEntity;
this.mjPromptsEntity = mjPromptsEntity; this.mjPromptsEntity = mjPromptsEntity;
this.globalConfigService = globalConfigService; this.globalConfigService = globalConfigService;
this.uploadService = uploadService; this.uploadService = uploadService;
this.badwordsService = badwordsService;
this.userBalanceService = userBalanceService; this.userBalanceService = userBalanceService;
this.redisCacheService = redisCacheService; this.redisCacheService = redisCacheService;
this.lockPrompt = []; this.lockPrompt = [];
@ -42,580 +41,191 @@ let MidjourneyService = class MidjourneyService {
async sleep(time) { async sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time)); return new Promise((resolve) => setTimeout(resolve, time));
} }
async getImageSizeFromUrl(imageUrl) {
try {
const response = await axios_1.default.get(imageUrl, { responseType: 'arraybuffer' });
const buffer = Buffer.from(response.data, 'binary');
const dimensions = (0, image_size_1.default)(buffer);
return { width: dimensions.width, height: dimensions.height };
}
catch (error) {
console.error('Error fetching image size:', error);
throw error;
}
}
async draw(jobData, jobId) { async draw(jobData, jobId) {
const { id, action } = jobData; const { id, action, drawId } = jobData;
const drawInfo = await this.midjourneyEntity.findOne({ where: { id } }); const drawInfo = await this.midjourneyEntity.findOne({ where: { id } });
const { customId } = drawInfo;
try { try {
await this.bindJobId(id, jobId); await this.bindJobId(id, jobId);
await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWING); await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWING);
if (action === midjourney_constant_1.MidjourneyActionEnum.DRAW || action === midjourney_constant_1.MidjourneyActionEnum.GENERATE) { const result = await this.sendDrawCommand(drawInfo, action);
await this.sendDrawCommand(drawInfo, jobData); drawInfo.drawId = result;
const drawRes = await this.pollComparisonResultDraw(drawInfo); const drawRes = await this.pollComparisonResultDraw(id, drawInfo);
await this.updateDrawData(jobData, drawRes); await this.updateDrawData(jobData, drawRes);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.UPSCALE) {
const { message_id, custom_id } = drawInfo;
await this.sendSmInteractions({ message_id, custom_id }, jobData);
common_1.Logger.debug(`记录${id}已经成功发送了图片放大指令`, 'MidjourneyService');
const drawRes = await this.pollComparisonResultUpscale(drawInfo);
await this.updateDrawData(jobData, drawRes);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.VARIATION) {
const { message_id, custom_id } = drawInfo;
await this.sendSmInteractions({ message_id, custom_id }, jobData);
common_1.Logger.debug(`记录${id}已经成功发送了图片变化指令`, 'MidjourneyService');
const drawRes = await this.pollComparisonResultVariation(drawInfo);
await this.updateDrawData(jobData, drawRes);
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.REGENERATE) {
const { message_id, custom_id } = drawInfo;
await this.sendReGenerateInteractions({ message_id, custom_id }, jobData);
common_1.Logger.debug(`记录${id}已经成功发送了重新生成图片指令`, 'MidjourneyService');
const drawRes = await this.pollComparisonResultReGenerate(drawInfo);
await this.updateDrawData(jobData, drawRes);
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.VARY) {
const { message_id, custom_id } = drawInfo;
await this.sendVaryInteractions({ message_id, custom_id }, jobData);
common_1.Logger.debug(`记录${id}已经成功发送单张图片增强指令`, 'MidjourneyService');
const drawRes = await this.pollComparisonResultVary(drawInfo);
await this.updateDrawData(jobData, drawRes);
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.ZOOM) {
const { message_id, custom_id } = drawInfo;
await this.sendZoomInteractions({ message_id, custom_id }, jobData);
common_1.Logger.debug(`记录${id}已经成功发送单张图片缩放指令`, 'MidjourneyService');
const drawRes = await this.pollComparisonResultZoom(drawInfo);
await this.updateDrawData(jobData, drawRes);
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
}
this.drawSuccess(jobData); this.drawSuccess(jobData);
return true; return true;
} }
catch (error) { catch (error) {
this.lockPrompt = this.lockPrompt.filter((item) => item !== drawInfo.randomDrawId);
await this.drawFailed(jobData);
console.log('error: ', error); console.log('error: ', error);
return true; return true;
} }
} }
async addDrawQueue(params) { async addDrawQueue(params) {
const { prompt, imgUrl = '', extraParam = '', action = 1, userId, randomDrawId, orderId, custom_id, message_id } = params; try {
const { prompt, imgUrl = '', extraParam = '', action, userId, orderId, customId, drawId } = params;
const fullPrompt = imgUrl ? `${imgUrl} ${prompt} ${extraParam}` : `${prompt} ${extraParam}`; const fullPrompt = imgUrl ? `${imgUrl} ${prompt} ${extraParam}` : `${prompt} ${extraParam}`;
await this.badwordsService.checkBadWords(fullPrompt, userId);
const drawInfo = { const drawInfo = {
userId, userId,
drawId,
extraParam, extraParam,
prompt, prompt,
imgUrl, imgUrl,
fullPrompt, fullPrompt,
randomDrawId,
status: midjourney_constant_1.MidjourneyStatusEnum.WAITING, status: midjourney_constant_1.MidjourneyStatusEnum.WAITING,
action: action, action,
orderId, orderId,
custom_id, customId,
message_id,
}; };
const res = await this.midjourneyEntity.save(drawInfo); const res = await this.midjourneyEntity.save(drawInfo);
return res; return res;
} }
catch (error) {
console.error('Error in addDrawQueue:', error);
throw error;
}
}
async updateDrawStatus(id, status) { async updateDrawStatus(id, status) {
await this.midjourneyEntity.update({ id }, { status }); await this.midjourneyEntity.update({ id }, { status });
} }
async updateDrawData(jobData, drawRes) { async updateDrawData(jobData, drawRes) {
try { try {
const { id, content, channel_id, attachments = [], timestamp, durationSpent } = drawRes; const { id, imageUrl, action, submitTime, finishTime, progress } = drawRes;
const { filename, url, proxy_url, width, height, size } = attachments[0]; const durationSpent = finishTime - submitTime;
let filename = `${Date.now()}-${id}.png`;
const mjNotSaveImg = await this.globalConfigService.getConfigs(['mjNotSaveImg']); const mjNotSaveImg = await this.globalConfigService.getConfigs(['mjNotSaveImg']);
let cosUrl = ''; let cosUrl = '';
let isSaveImg = true;
try {
if (!Number(mjNotSaveImg) || Number(mjNotSaveImg) === 0) { if (!Number(mjNotSaveImg) || Number(mjNotSaveImg) === 0) {
common_1.Logger.debug(`------> 开始上传图片!!!`, 'MidjourneyService'); common_1.Logger.debug(`------> 开始上传图片!!!`, 'MidjourneyService');
const startDate = new Date(); cosUrl = await this.uploadService.uploadFileFromUrl({ filename, url: imageUrl });
cosUrl = await this.uploadService.uploadFileFromUrl({ filename, url });
const endDate = new Date();
common_1.Logger.debug(`本次图片上传耗时为${(endDate.getTime() - startDate.getTime()) / 1000}`, 'MidjourneyService');
} }
else { else {
console.log('本次不存图片了'); cosUrl = imageUrl;
isSaveImg = false;
common_1.Logger.debug('本次不存图片了', 'MidjourneyService');
} }
const cosType = await this.uploadService.getUploadType(); }
catch (uploadError) {
common_1.Logger.error('存储图片失败,使用原始图片链接', 'MidjourneyService');
cosUrl = imageUrl;
isSaveImg = false;
}
const { width, height } = await this.getImageSizeFromUrl(imageUrl);
const drawInfo = { const drawInfo = {
status: midjourney_constant_1.MidjourneyStatusEnum.DRAWED, status: midjourney_constant_1.MidjourneyStatusEnum.DRAWED,
message_id: id, drawId: id,
action: action,
drawUrl: cosUrl,
drawRatio: `${width}x${height}`,
progress: 100, progress: 100,
fileInfo: JSON.stringify({ width, height, size, filename, cosUrl, cosType }),
extend: this.removeEmoji(JSON.stringify(drawRes)), extend: this.removeEmoji(JSON.stringify(drawRes)),
durationSpent, durationSpent,
isSaveImg: !Number(mjNotSaveImg) || Number(mjNotSaveImg) === 0, isSaveImg,
}; };
await this.midjourneyEntity.update({ id: jobData.id }, drawInfo); await this.midjourneyEntity.update({ id: jobData.id }, drawInfo);
} }
catch (error) { catch (error) {
console.log('TODO->存储图片失败, ', jobData, error); throw new common_1.HttpException('更新绘画数据失败', common_1.HttpStatus.BAD_REQUEST);
} }
} }
async getHistroyMessageIds(randomDrawId) { async sendDrawCommand(drawInfo, action) {
const res = await this.midjourneyEntity.find({ where: { randomDrawId, status: midjourney_constant_1.MidjourneyStatusEnum.DRAWED } }); const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl']));
return res.map((item) => item.message_id); const mjKey = (await this.globalConfigService.getConfigs(['mjKey']));
} const { id, fullPrompt, imgUrl, drawId, customId } = drawInfo;
async sendDrawCommand(drawInfo, jobData) { const prompt = imgUrl ? `${imgUrl} ${fullPrompt}` : `${fullPrompt}`;
const { fullPrompt, randomDrawId, imgUrl } = drawInfo; let url = '';
const prompt = imgUrl ? `[${randomDrawId}] ${imgUrl} ${fullPrompt}` : `[${randomDrawId}] ${fullPrompt}`; let payloadJson = {};
common_1.Logger.debug(`本次绘图指令为${prompt}`, 'MidjourneyService'); const MAX_RETRIES = 3;
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams(); let retryCount = 0;
const payloadJson = { while (retryCount < MAX_RETRIES) {
type: 2,
application_id,
guild_id,
channel_id,
session_id,
data: { version, id, name: 'imagine', type: 1, options: [{ type: 3, name: 'prompt', value: prompt }], attachments: [] },
};
try { try {
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000'; if (action === 'IMAGINE') {
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/draw` : 'https://discord.com/api/v9/interactions'; url = `${mjProxyUrl}/mj/submit/imagine`;
const headers = { authorization }; payloadJson = { prompt: prompt };
}
else {
url = `${mjProxyUrl}/mj/submit/action`;
payloadJson = { taskId: drawId, customId: customId };
}
const headers = { "mj-api-secret": mjKey };
const res = await axios_1.default.post(url, payloadJson, { headers }); const res = await axios_1.default.post(url, payloadJson, { headers });
return false; const { result } = res.data;
if (result) {
common_1.Logger.log(`绘画ID: ${result}`, 'MidjourneyService');
return result;
}
else {
throw new Error('未能获取结果数据');
}
} }
catch (error) { catch (error) {
common_1.Logger.error(`发送绘画指令失败`, 'MidjourneyService'); retryCount++;
if (retryCount >= MAX_RETRIES) {
await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWFAIL);
throw new common_1.HttpException('发送绘图指令失败、请联系管理员检测绘画配置!', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('发送绘图指令失败、请联系管理员检测绘画配置!', common_1.HttpStatus.BAD_REQUEST);
} }
} }
async sendSmInteractions(params, jobData) {
const { message_id, custom_id } = params;
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams();
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/draw` : 'https://discord.com/api/v9/interactions';
const headers = { authorization };
const body = {
type: 3,
guild_id,
channel_id,
message_flags: 0,
message_id,
application_id,
session_id,
data: {
component_type: 2,
custom_id,
},
};
try {
await axios_1.default.post(url, body, { headers });
}
catch (error) {
console.log('发送放大变幻指令失败: ', error);
common_1.Logger.error(`发送放大变幻指令失败`, 'MidjourneyService');
throw new common_1.HttpException('对图片放大变幻失败...', common_1.HttpStatus.BAD_REQUEST);
} }
} }
async sendReGenerateInteractions(params, jobData) { async pollComparisonResultDraw(id, drawInfo) {
const { message_id, custom_id } = params; const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl']));
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams(); const mjKey = (await this.globalConfigService.getConfigs(['mjKey']));
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/draw` : 'https://discord.com/api/v9/interactions';
const headers = { authorization };
const body = {
type: 3,
guild_id,
channel_id,
message_id,
application_id,
session_id,
data: {
component_type: 2,
custom_id,
},
};
try {
await axios_1.default.post(url, body, { headers });
}
catch (error) {
console.log('发送重新生成指令失败: ', error);
common_1.Logger.error(`发送放大变幻指令失败`, 'MidjourneyService');
throw new common_1.HttpException('对图片放大变幻失败...', common_1.HttpStatus.BAD_REQUEST);
}
}
async sendVaryInteractions(params, jobData) {
const { message_id, custom_id } = params;
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams();
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/draw` : 'https://discord.com/api/v9/interactions';
const headers = { authorization };
const body = {
type: 3,
guild_id,
channel_id,
message_id,
application_id,
session_id,
data: {
component_type: 2,
custom_id,
},
};
try {
await axios_1.default.post(url, body, { headers });
}
catch (error) {
console.log('发送对单张图片增强指令失败: ', error);
common_1.Logger.error(`发送单张图片增强指令失败`, 'MidjourneyService');
throw new common_1.HttpException('对图片单张增强失败...', common_1.HttpStatus.BAD_REQUEST);
}
}
async sendZoomInteractions(params, jobData) {
const { message_id, custom_id } = params;
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams();
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/draw` : 'https://discord.com/api/v9/interactions';
const headers = { authorization };
const body = {
type: 3,
guild_id,
channel_id,
message_id,
application_id,
session_id,
data: {
component_type: 2,
custom_id,
},
};
try {
await axios_1.default.post(url, body, { headers });
}
catch (error) {
console.log('发送对单张图片增强指令失败: ', error);
common_1.Logger.error(`发送单张图片增强指令失败`, 'MidjourneyService');
throw new common_1.HttpException('对图片单张增强失败...', common_1.HttpStatus.BAD_REQUEST);
}
}
async pollComparisonResultDraw(drawInfo) {
common_1.Logger.debug(`开始查询绘画结果`, 'MidjourneyService');
const startTime = Date.now(); const startTime = Date.now();
const INTERVAL_BEFORE_90S = 10000; const POLL_INTERVAL = 5000;
const INTERVAL_AFTER_90S = 30000; const TIMEOUT = 150000;
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 150000;
const TIMEOUT = timeout;
let pollingCount = 0; let pollingCount = 0;
let drawRes = null; let retryCount = 0;
let isMatchSuccessful = false; const MAX_RETRIES = 5;
const { drawId } = drawInfo;
try { try {
while (!isMatchSuccessful && Date.now() - startTime < TIMEOUT) { while (Date.now() - startTime < TIMEOUT && retryCount < MAX_RETRIES) {
let interval; await new Promise(resolve => setTimeout(resolve, POLL_INTERVAL));
if (Date.now() - startTime < 90000) { try {
interval = INTERVAL_BEFORE_90S; const headers = {
"Content-Type": "application/x-www-form-urlencoded",
"mj-api-secret": mjKey
};
const url = `${mjProxyUrl}/mj/task/${drawId}/fetch`;
const res = await axios_1.default.get(url, { headers });
const responses = res.data;
const progress = responses.process;
await this.midjourneyEntity.update({ id }, { progress: progress });
if (responses.status === 'SUCCESS') {
common_1.Logger.log(`绘制成功, URL: ${responses.imageUrl}`, 'MidjourneyService');
return responses;
} }
else {
interval = INTERVAL_AFTER_90S;
} }
await this.sleep(interval); catch (error) {
common_1.Logger.debug(`【绘制图片】第 ${pollingCount + 1} 次开始查询`, 'MidjourneyService'); retryCount++;
drawRes = await this.findCurrentPromptResult(drawInfo.randomDrawId); common_1.Logger.error(`轮询过程中发生错误: ${error}`, 'MidjourneyService');
if (drawRes) {
const { content } = drawRes;
const progress = await this.parseProgress(content);
common_1.Logger.debug(`【绘制图片】第 ${pollingCount + 1} 次、 当前绘画进度为${progress}%`, 'MidjourneyService');
await this.midjourneyEntity.update({ id: drawInfo.id }, { progress: progress !== null && progress !== void 0 ? progress : 100 });
} }
isMatchSuccessful = drawRes && !drawRes.edited_timestamp;
pollingCount++; pollingCount++;
} }
if (!drawRes) { if (retryCount >= MAX_RETRIES) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT); await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWFAIL);
throw new common_1.HttpException('轮询失败次数过多,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
}
common_1.Logger.error('绘画超时,请稍后再试!', 'MidjourneyService');
await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWFAIL);
throw new common_1.HttpException('绘画超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('绘画超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
} }
const endTime = Date.now();
return Object.assign(Object.assign({}, drawRes), { durationSpent: Math.floor((endTime - startTime) / 1000) });
}
catch (error) { catch (error) {
console.log('获取图片列表结果失败: ', error); common_1.Logger.error('获取图片结果失败: ', error, 'MidjourneyService');
} await this.updateDrawStatus(id, midjourney_constant_1.MidjourneyStatusEnum.DRAWFAIL);
} throw error;
async pollComparisonResultUpscale(drawInfo) {
common_1.Logger.debug(`开始查询放大图片信息`, 'MidjourneyService');
const startTime = Date.now();
const { message_id, custom_id, randomDrawId, orderId } = drawInfo;
let enlargeImgDetail = null;
let pollingCount = 0;
while (!enlargeImgDetail && pollingCount < 10) {
common_1.Logger.debug(`开始比对放大图片第${pollingCount + 1}`, 'MidjourneyService');
enlargeImgDetail = await this.findCurrentEnlargeImgResult(randomDrawId, orderId);
await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (5000 - 3000 + 1)) + 3000));
pollingCount++;
}
if (!enlargeImgDetail) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT);
throw new common_1.HttpException('放大图片超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
}
const endTime = Date.now();
return Object.assign(Object.assign({}, enlargeImgDetail), { durationSpent: Math.floor((endTime - startTime) / 1000) });
}
async pollComparisonResultReGenerate(drawInfo) {
common_1.Logger.debug(`开始查询重复绘制的图片信息`, 'MidjourneyService');
const TIMEOUT = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 150000;
const startTime = Date.now();
const { message_id, custom_id, randomDrawId, orderId } = drawInfo;
let reGenerateImgDetail = null;
let pollingTime = 0;
let count = 0;
while (!reGenerateImgDetail && pollingTime < TIMEOUT) {
common_1.Logger.debug(`开始比对重新绘制图片第${count + 1}`, 'MidjourneyService');
reGenerateImgDetail = await this.findCurrentReGenerateImgResult(randomDrawId, message_id);
const t = Math.floor(Math.random() * (5000 - 3000 + 1)) + 8000;
await new Promise((resolve) => setTimeout(resolve, t));
pollingTime += t;
count++;
}
if (!reGenerateImgDetail) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT);
throw new common_1.HttpException('重新绘制图片超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
}
const endTime = Date.now();
return Object.assign(Object.assign({}, reGenerateImgDetail), { durationSpent: Math.floor((endTime - startTime) / 1000) });
}
async pollComparisonResultVary(drawInfo) {
common_1.Logger.debug(`开始查询单张图片增强的图片信息`, 'MidjourneyService');
const TIMEOUT = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 150000;
const startTime = Date.now();
const { message_id, custom_id, randomDrawId, orderId } = drawInfo;
let varyImgDetail = null;
let pollingTime = 0;
let count = 0;
while (!varyImgDetail && pollingTime < TIMEOUT) {
common_1.Logger.debug(`开始单张图片增强第${count + 1}`, 'MidjourneyService');
varyImgDetail = await this.findCurrentVaryImgResult(randomDrawId, message_id);
const t = Math.floor(Math.random() * (5000 - 3000 + 1)) + 8000;
await new Promise((resolve) => setTimeout(resolve, t));
pollingTime += t;
count++;
}
if (!varyImgDetail) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT);
throw new common_1.HttpException('单张图片增强超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
}
const endTime = Date.now();
return Object.assign(Object.assign({}, varyImgDetail), { durationSpent: Math.floor((endTime - startTime) / 1000) });
}
async pollComparisonResultZoom(drawInfo) {
common_1.Logger.debug(`开始查询单张图片缩放的图片信息`, 'MidjourneyService');
const TIMEOUT = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 150000;
const startTime = Date.now();
const { message_id, custom_id, randomDrawId, orderId } = drawInfo;
let zoomImgDetail = null;
let pollingTime = 0;
let count = 0;
while (!zoomImgDetail && pollingTime < TIMEOUT) {
common_1.Logger.debug(`开始单张图片缩放第${count + 1}`, 'MidjourneyService');
zoomImgDetail = await this.findCurrentZoomImgResult(randomDrawId, message_id);
const t = Math.floor(Math.random() * (5000 - 3000 + 1)) + 8000;
await new Promise((resolve) => setTimeout(resolve, t));
pollingTime += t;
count++;
}
if (!zoomImgDetail) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT);
throw new common_1.HttpException('单张图片缩放超时,请稍后再试!', common_1.HttpStatus.BAD_REQUEST);
}
const endTime = Date.now();
return Object.assign(Object.assign({}, zoomImgDetail), { durationSpent: Math.floor((endTime - startTime) / 1000) });
}
async pollComparisonResultVariation(drawInfo) {
common_1.Logger.debug(`开始轮询单张变换图片结果`, 'MidjourneyService');
let variationImgDetail = null;
const startTime = Date.now();
while (!variationImgDetail) {
common_1.Logger.debug(`变换图片获取中------>`, 'MidjourneyService');
variationImgDetail = await this.findCurrentVariationImgResult(drawInfo.randomDrawId);
const nextPollingDelay = 10000;
await this.sleep(nextPollingDelay);
const endTime = Date.now();
const durationSpent = Math.floor(endTime - startTime);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 150000;
const TIMEOUT = timeout;
if (durationSpent >= TIMEOUT) {
await this.updateDrawStatus(drawInfo.id, midjourney_constant_1.MidjourneyStatusEnum.DRAWTIMEOUT);
throw new common_1.HttpException('变换当前图片超时!', common_1.HttpStatus.BAD_REQUEST);
}
}
return Object.assign(Object.assign({}, variationImgDetail), { durationSpent: Math.floor(Date.now() - startTime) });
}
async findCurrentEnlargeImgResult(randomDrawId, orderId) {
const messageList = await this.getMessageList();
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const enlargeImgDetail = messageList.find((item) => {
const { content } = item;
if (!this.extractContent(content))
return false;
const { prompt, order } = this.extractContent(content);
return content.includes(randomDrawId) && orderId === order && !histroyMessageIds.includes(item.id);
});
return enlargeImgDetail;
}
async findCurrentVariationImgResult(randomDrawId) {
const messageList = await this.getMessageList();
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const variationImgDetail = messageList.find((item) => {
const { content } = item;
return content.includes(randomDrawId) && !histroyMessageIds.includes(item.id) && this.isVariationsImage(content);
});
if (variationImgDetail) {
if (this.lockPrompt.includes(randomDrawId)) {
common_1.Logger.debug(`【变体图片】当前图片已经被锁定,等待同任务完成`, 'MidjourneyService');
return null;
}
else {
this.lockPrompt.push(randomDrawId);
}
}
return variationImgDetail;
}
async findCurrentReGenerateImgResult(randomDrawId, message_id) {
const messageList = await this.getMessageList();
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const reGenerateImgDetail = messageList.find((item) => {
const { content } = item;
return content.includes(randomDrawId) && !histroyMessageIds.includes(item.id) && item.id !== message_id && this.isReGenerateImage(content);
});
if (reGenerateImgDetail) {
if (this.lockPrompt.includes(randomDrawId)) {
common_1.Logger.debug(`【重新生成图片】当前图片已经被锁定,等待同任务完成`, 'MidjourneyService');
return null;
}
else {
this.lockPrompt.push(randomDrawId);
}
}
return reGenerateImgDetail;
}
async findCurrentZoomImgResult(randomDrawId, message_id) {
const messageList = await this.getMessageList();
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const reGenerateImgDetail = messageList.find((item) => {
const { content } = item;
return content.includes(randomDrawId) && !histroyMessageIds.includes(item.id) && item.id !== message_id && this.isZoomImage(content);
});
if (reGenerateImgDetail) {
if (this.lockPrompt.includes(randomDrawId)) {
common_1.Logger.debug(`【重新生成图片】当前图片已经被锁定,等待同任务完成`, 'MidjourneyService');
return null;
}
else {
this.lockPrompt.push(randomDrawId);
}
}
return reGenerateImgDetail;
}
async findCurrentVaryImgResult(randomDrawId, message_id) {
const messageList = await this.getMessageList();
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const varyImgDetail = messageList.find((item) => {
const { content } = item;
return content.includes(randomDrawId) && !histroyMessageIds.includes(item.id) && item.id !== message_id && this.isVaryImage(content);
});
if (varyImgDetail) {
if (this.lockPrompt.includes(randomDrawId)) {
common_1.Logger.debug(`【单张图片增强】当前图片已经被锁定,等待同任务完成`, 'MidjourneyService');
return null;
}
else {
this.lockPrompt.push(randomDrawId);
}
}
return varyImgDetail;
}
extractContent(str) {
const promptMatch = str.match(/\*\*(.+?)\*\*/);
const orderMatch = str.match(/- Image #(\d+)/);
if (!promptMatch || !orderMatch) {
return null;
}
const prompt = promptMatch[1];
const order = parseInt(orderMatch[1]);
return { prompt, order };
}
async findCurrentPromptResult(randomDrawId) {
const histroyMessageIds = await this.getHistroyMessageIds(randomDrawId);
const messageList = await this.getMessageList();
if (!messageList || !messageList.length)
return;
const matchingItem = messageList.find((item) => {
const { attachments = [], content, edited_timestamp } = item;
return content.includes(randomDrawId) && attachments.length > 0 && !histroyMessageIds.includes(item === null || item === void 0 ? void 0 : item.id);
});
return matchingItem || null;
}
isVariationsImage(str) {
const regex = /- Variations/;
return regex.test(str);
}
isSingleImage(str) {
const regex = /Image #\d+/;
return regex.test(str);
}
isReGenerateImage(str) {
return !this.isVariationsImage(str) && !this.isSingleImage(str);
}
isVaryImage(str) {
const regex = /- Variations \(.*?\)/;
return regex.test(str);
}
isZoomImage(str) {
const regex = /- Zoom Out/;
return regex.test(str);
}
async getMjDefaultParams() {
const configs = await this.globalConfigService.getConfigs([
'mjId',
'mjApplicationId',
'mjGuildId',
'mjChannelId',
'mjSessionId',
'mjVersion',
'mjAuthorization',
'mjRateLimit',
'mjProxy',
]);
const params = {
application_id: configs.mjApplicationId,
guild_id: configs.mjGuildId,
channel_id: configs.mjChannelId,
session_id: configs.mjSessionId,
version: configs.mjVersion,
id: configs.mjId,
authorization: configs.mjAuthorization,
mjRateLimit: configs.mjRateLimit,
mjProxy: configs.mjProxy || 0,
};
return params;
}
async getMessageList() {
try {
const { application_id, guild_id, channel_id, session_id, version, id, authorization, mjProxy } = await this.getMjDefaultParams();
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const url = mjProxy == 1 ? `${mjProxyUrl}/mj/list?channel_id=${channel_id}` : `https://discord.com/api/v9/channels/${channel_id}/messages?limit=50`;
const headers = { authorization };
const response = await axios_1.default.get(url, { headers });
return response.data;
}
catch (error) {
common_1.Logger.error('查询绘制结果失败: getMessageList', error, 'MidjourneyService');
return [];
}
}
parseProgress(content) {
const regex = /\((\d+)%\)/;
const match = content.match(regex);
if (match) {
return parseInt(match[1], 10);
}
else {
return null;
} }
} }
removeEmoji(str) { removeEmoji(str) {
@ -633,19 +243,7 @@ let MidjourneyService = class MidjourneyService {
order: { id: 'DESC' }, order: { id: 'DESC' },
take: size, take: size,
skip: (page - 1) * size, skip: (page - 1) * size,
}); select: ['id', 'userId', 'prompt', 'extraParam', 'fullPrompt', 'rec', 'orderId', 'drawId', 'drawUrl', 'drawRatio', 'isDelete', 'status', 'action']
const mjProxyImgUrl = await this.globalConfigService.getConfigs(['mjProxyImgUrl']);
rows.forEach((item) => {
var _a, _b, _c, _d;
try {
const { extend, isSaveImg, fileInfo } = item;
const originUrl = (_b = (_a = JSON.parse(extend)) === null || _a === void 0 ? void 0 : _a.attachments[0]) === null || _b === void 0 ? void 0 : _b.url;
item.fileInfo = this.formatFileInfo(fileInfo, isSaveImg, mjProxyImgUrl, originUrl);
item.isGroup = ((_d = (_c = JSON.parse(extend)) === null || _c === void 0 ? void 0 : _c.components[0]) === null || _d === void 0 ? void 0 : _d.components[0].label) === "U1";
item.originUrl = originUrl;
}
catch (error) {
}
}); });
const countQueue = await this.midjourneyEntity.count({ where: { isDelete: 0, status: (0, typeorm_2.In)([1, 2]) } }); const countQueue = await this.midjourneyEntity.count({ where: { isDelete: 0, status: (0, typeorm_2.In)([1, 2]) } });
const data = { rows: (0, utils_1.formatCreateOrUpdateDate)(rows), count, countQueue }; const data = { rows: (0, utils_1.formatCreateOrUpdateDate)(rows), count, countQueue };
@ -655,78 +253,40 @@ let MidjourneyService = class MidjourneyService {
throw new common_1.HttpException('获取我得绘制列表失败', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('获取我得绘制列表失败', common_1.HttpStatus.BAD_REQUEST);
} }
} }
formatFileInfo(fileInfo, isSaveImg, mjProxyImgUrl, originUrl) {
if (!fileInfo)
return {};
let parseFileInfo = null;
try {
parseFileInfo = JSON.parse(fileInfo);
}
catch (error) {
parseFileInfo = null;
}
if (!parseFileInfo)
return;
const { url, filename, size, cosUrl, width, height } = parseFileInfo;
const targetSize = 310;
const imgType = cosUrl.includes('cos') ? 'tencent' : cosUrl.includes('oss') ? 'ali' : 'chevereto';
let compress;
let thumbImg;
if (imgType === 'tencent') {
const ratio = width / height;
const targetHeight = Math.round(targetSize / ratio);
thumbImg = cosUrl + `?imageView2/1/w/${targetSize}/h/${targetHeight}/q/55`;
}
if (imgType === 'ali') {
const ratio = height / width;
const targetWidth = Math.round(targetSize / ratio);
thumbImg = cosUrl + `?x-oss-process=image/resize,w_${targetWidth}`;
}
if (imgType === 'chevereto') {
thumbImg = cosUrl.replace(/\.png$/, '.md.png');
}
parseFileInfo.thumbImg = thumbImg;
if (!isSaveImg) {
const proxyImgUrl = `${mjProxyImgUrl}/mj/pipe?url=${originUrl}`;
parseFileInfo.thumbImg = proxyImgUrl;
parseFileInfo.cosUrl = proxyImgUrl;
}
return parseFileInfo;
}
async getDrawActionDetail(action, drawId, orderId) { async getDrawActionDetail(action, drawId, orderId) {
const detailInfo = await this.midjourneyEntity.findOne({ where: { id: drawId } }); const detailInfo = await this.midjourneyEntity.findOne({ where: { drawId: drawId } });
if (!detailInfo) const { extend, prompt, imgUrl, extraParam } = detailInfo;
throw new common_1.HttpException('当前绘画信息不存在!', common_1.HttpStatus.BAD_REQUEST); const extendObj = JSON.parse(extend);
const { extend, message_id, prompt, imgUrl, extraParam, randomDrawId } = detailInfo; const buttons = extendObj.buttons || [];
const historyDetailDrawInfo = JSON.parse(extend); let currentButton;
const { components = [] } = historyDetailDrawInfo; if (action === 'UPSCALE') {
if (!components.length) { currentButton = buttons.find(button => {
throw new common_1.HttpException('当前图片没有绘画信息、无法放大!', common_1.HttpStatus.BAD_REQUEST); const isStandardUpscale = button.label.startsWith(`U${orderId}`);
const isUpscaleUpscale = (orderId === 1 && /(Redo )?Upscale \(Subtle\)/.test(button.label)) ||
(orderId === 2 && /(Redo )?Upscale \(Creative\)/.test(button.label));
return isStandardUpscale || isUpscaleUpscale;
});
} }
let currentImgComponent = {}; if (action === 'VARIATION') {
if (action === midjourney_constant_1.MidjourneyActionEnum.UPSCALE) { currentButton = buttons.find(button => {
currentImgComponent = components[0]['components'][orderId - 1]; const isStandardVariation = button.label.startsWith(`V${orderId}`);
const isVaryVariation = (orderId === 1 && /Vary \(Strong\)/.test(button.label)) ||
(orderId === 2 && /Vary \(Region\)/.test(button.label));
return isStandardVariation || isVaryVariation;
});
} }
if (action === midjourney_constant_1.MidjourneyActionEnum.VARIATION) { if (action === 'REGENERATE') {
currentImgComponent = components[1]['components'][orderId - 1]; currentButton = buttons.find(button => button.customId.startsWith("MJ::JOB::reroll::0::") && button.label === "");
} }
if (action === midjourney_constant_1.MidjourneyActionEnum.REGENERATE) { if (action === 'ZOOM') {
currentImgComponent = components[0]['components'][orderId - 1]; currentButton = buttons.find(button => (orderId === 1 && button.label === "Zoom Out 2x") ||
(orderId === 2 && button.label === "Zoom Out 1.5x"));
} }
if (action === midjourney_constant_1.MidjourneyActionEnum.VARY) { if (!currentButton) {
currentImgComponent = components[0]['components'][orderId - 1]; throw new common_1.HttpException('所需绘画操作信息不存在!', common_1.HttpStatus.BAD_REQUEST);
}
if (action === midjourney_constant_1.MidjourneyActionEnum.ZOOM) {
currentImgComponent = components[1]['components'][orderId - 1];
}
const { custom_id } = currentImgComponent;
return { custom_id, message_id, prompt, imgUrl, extraParam, randomDrawId };
}
async checkIsUpscale(custom_id) {
const count = await this.midjourneyEntity.count({ where: { custom_id, status: midjourney_constant_1.MidjourneyStatusEnum.DRAWED } });
if (count > 0) {
throw new common_1.HttpException('当前图片已经放大过了!', common_1.HttpStatus.BAD_REQUEST);
} }
const { customId } = currentButton;
return { customId, prompt, extraParam, drawId };
} }
async deleteDraw(id, req) { async deleteDraw(id, req) {
const d = await this.midjourneyEntity.findOne({ where: { id, userId: req.user.id, isDelete: 0 } }); const d = await this.midjourneyEntity.findOne({ where: { id, userId: req.user.id, isDelete: 0 } });
@ -759,7 +319,7 @@ let MidjourneyService = class MidjourneyService {
} }
async drawSuccess(jobData) { async drawSuccess(jobData) {
const { id, userId, action } = jobData; const { id, userId, action } = jobData;
const amount = action === 2 ? 1 : 4; const amount = action === "UPSCALE" ? 1 : 4;
common_1.Logger.debug(`绘画完成,执行扣费,扣除费用:${amount}积分。`); common_1.Logger.debug(`绘画完成,执行扣费,扣除费用:${amount}积分。`);
await this.userBalanceService.refundMjBalance(userId, -amount); await this.userBalanceService.refundMjBalance(userId, -amount);
await this.midjourneyEntity.update({ id }, { status: 3 }); await this.midjourneyEntity.update({ id }, { status: 3 });
@ -786,26 +346,13 @@ let MidjourneyService = class MidjourneyService {
order: { id: 'DESC' }, order: { id: 'DESC' },
take: size, take: size,
skip: (page - 1) * size, skip: (page - 1) * size,
select: ['fileInfo', 'extend', 'prompt', 'createdAt', 'id', 'extend', 'fullPrompt', 'rec', 'isSaveImg'], select: ['id', 'drawId', 'drawUrl', 'drawRatio', 'prompt', 'fullPrompt', 'rec', 'createdAt', 'action', 'status'],
});
const mjProxyImgUrl = await this.globalConfigService.getConfigs(['mjProxyImgUrl']);
rows.forEach((item) => {
var _a, _b, _c, _d;
try {
const { extend, isSaveImg, fileInfo } = item;
const originUrl = (_b = (_a = JSON.parse(extend)) === null || _a === void 0 ? void 0 : _a.attachments[0]) === null || _b === void 0 ? void 0 : _b.url;
item.fileInfo = this.formatFileInfo(fileInfo, isSaveImg, mjProxyImgUrl, originUrl);
item.isGroup = ((_d = (_c = JSON.parse(extend)) === null || _c === void 0 ? void 0 : _c.components[0]) === null || _d === void 0 ? void 0 : _d.components[0].label) === "U1";
item.originUrl = originUrl;
}
catch (error) {
}
}); });
if (Number(size) === 999) { if (Number(size) === 999) {
const data = { const data = {
rows: rows.map((item) => { rows: rows.map((item) => {
const { fileInfo, prompt, createdAt, id, fullPrompt, rec, originUrl } = item; const { id, drawId, drawUrl, drawRatio, prompt, fullPrompt, createdAt, rec, action, status } = item;
return { fileInfo, prompt, createdAt, id, fullPrompt, rec, originUrl }; return { id, drawId, drawUrl, drawRatio, prompt, fullPrompt, createdAt, rec, action, status };
}), }),
count, count,
}; };
@ -840,19 +387,6 @@ let MidjourneyService = class MidjourneyService {
rows.forEach((item) => { rows.forEach((item) => {
item.userInfo = userInfos.find((user) => user.id === item.userId); item.userInfo = userInfos.find((user) => user.id === item.userId);
}); });
const mjProxyImgUrl = await this.globalConfigService.getConfigs(['mjProxyImgUrl']);
rows.forEach((item) => {
var _a, _b, _c, _d;
try {
const { extend, isSaveImg, fileInfo } = item;
const originUrl = (_b = (_a = JSON.parse(extend)) === null || _a === void 0 ? void 0 : _a.attachments[0]) === null || _b === void 0 ? void 0 : _b.url;
item.fileInfo = this.formatFileInfo(fileInfo, isSaveImg, mjProxyImgUrl, originUrl);
item.isGroup = ((_d = (_c = JSON.parse(extend)) === null || _c === void 0 ? void 0 : _c.components[0]) === null || _d === void 0 ? void 0 : _d.components[0].label) === "U1";
item.originUrl = originUrl;
}
catch (error) {
}
});
if (req.user.role !== 'super') { if (req.user.role !== 'super') {
rows.forEach((item) => { rows.forEach((item) => {
if (item.userInfo && item.userInfo.email) { if (item.userInfo && item.userInfo.email) {
@ -944,7 +478,6 @@ MidjourneyService = __decorate([
typeorm_2.Repository, typeorm_2.Repository,
globalConfig_service_1.GlobalConfigService, globalConfig_service_1.GlobalConfigService,
upload_service_1.UploadService, upload_service_1.UploadService,
badwords_service_1.BadwordsService,
userBalance_service_1.UserBalanceService, userBalance_service_1.UserBalanceService,
redisCache_service_1.RedisCacheService]) redisCache_service_1.RedisCacheService])
], MidjourneyService); ], MidjourneyService);

View File

@ -45,6 +45,10 @@ __decorate([
(0, swagger_1.ApiProperty)({ example: 1, description: 'key的权重' }), (0, swagger_1.ApiProperty)({ example: 1, description: 'key的权重' }),
__metadata("design:type", Number) __metadata("design:type", Number)
], SetModelDto.prototype, "keyWeight", void 0); ], SetModelDto.prototype, "keyWeight", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 1, description: '模型排序' }),
__metadata("design:type", Number)
], SetModelDto.prototype, "modelOrder", void 0);
__decorate([ __decorate([
(0, swagger_1.ApiProperty)({ example: 4096, description: '模型支持的最大TOken数量', required: true }), (0, swagger_1.ApiProperty)({ example: 4096, description: '模型支持的最大TOken数量', required: true }),
__metadata("design:type", Number) __metadata("design:type", Number)

View File

@ -42,6 +42,10 @@ __decorate([
(0, typeorm_1.Column)({ comment: '模型总计使用的token数量', default: 0 }), (0, typeorm_1.Column)({ comment: '模型总计使用的token数量', default: 0 }),
__metadata("design:type", Number) __metadata("design:type", Number)
], ModelsTypeEntity.prototype, "useToken", void 0); ], ModelsTypeEntity.prototype, "useToken", void 0);
__decorate([
(0, typeorm_1.Column)({ comment: '模型排序', default: 1 }),
__metadata("design:type", Number)
], ModelsTypeEntity.prototype, "modelOrder", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: '单词调用扣除的次数', default: 1 }), (0, typeorm_1.Column)({ comment: '单词调用扣除的次数', default: 1 }),
__metadata("design:type", Number) __metadata("design:type", Number)

View File

@ -50,6 +50,10 @@ __decorate([
(0, typeorm_1.Column)({ comment: 'key权重', default: 1 }), (0, typeorm_1.Column)({ comment: 'key权重', default: 1 }),
__metadata("design:type", Number) __metadata("design:type", Number)
], ModelsEntity.prototype, "keyWeight", void 0); ], ModelsEntity.prototype, "keyWeight", void 0);
__decorate([
(0, typeorm_1.Column)({ comment: 'key权重', default: 1 }),
__metadata("design:type", Number)
], ModelsEntity.prototype, "modelOrder", void 0);
__decorate([ __decorate([
(0, typeorm_1.Column)({ comment: 'key的使用次数', default: 0 }), (0, typeorm_1.Column)({ comment: 'key的使用次数', default: 0 }),
__metadata("design:type", Number) __metadata("design:type", Number)

View File

@ -18,7 +18,6 @@ const typeorm_1 = require("@nestjs/typeorm");
const typeorm_2 = require("typeorm"); const typeorm_2 = require("typeorm");
const models_entity_1 = require("./models.entity"); const models_entity_1 = require("./models.entity");
const status_constant_1 = require("../../common/constants/status.constant"); const status_constant_1 = require("../../common/constants/status.constant");
const baidu_1 = require("../chatgpt/baidu");
const utils_1 = require("../../common/utils"); const utils_1 = require("../../common/utils");
const modelType_entity_1 = require("./modelType.entity"); const modelType_entity_1 = require("./modelType.entity");
let ModelsService = class ModelsService { let ModelsService = class ModelsService {
@ -33,7 +32,6 @@ let ModelsService = class ModelsService {
} }
async onModuleInit() { async onModuleInit() {
await this.initCalcKey(); await this.initCalcKey();
this.refreshBaiduAccesstoken();
} }
async initCalcKey() { async initCalcKey() {
this.keyPoolMap = {}; this.keyPoolMap = {};
@ -114,9 +112,6 @@ let ModelsService = class ModelsService {
if (Number(keyType !== 1)) { if (Number(keyType !== 1)) {
const res = await this.modelsEntity.save(params); const res = await this.modelsEntity.save(params);
await this.initCalcKey(); await this.initCalcKey();
if (keyType === 2) {
this.refreshBaiduAccesstoken();
}
return res; return res;
} }
else { else {
@ -162,6 +157,9 @@ let ModelsService = class ModelsService {
key && (where.key = (0, typeorm_2.Like)(`%${key}%`)); key && (where.key = (0, typeorm_2.Like)(`%${key}%`));
const [rows, count] = await this.modelsEntity.findAndCount({ const [rows, count] = await this.modelsEntity.findAndCount({
where: where, where: where,
order: {
modelOrder: 'ASC'
},
skip: (page - 1) * size, skip: (page - 1) * size,
take: size, take: size,
}); });
@ -176,10 +174,13 @@ let ModelsService = class ModelsService {
async modelsList() { async modelsList() {
const cloneModelMaps = JSON.parse(JSON.stringify(this.modelMaps)); const cloneModelMaps = JSON.parse(JSON.stringify(this.modelMaps));
Object.keys(cloneModelMaps).forEach(key => { Object.keys(cloneModelMaps).forEach(key => {
cloneModelMaps[key] = Array.from(cloneModelMaps[key].map(t => { cloneModelMaps[key] = cloneModelMaps[key].sort((a, b) => a.modelOrder - b.modelOrder);
cloneModelMaps[key] = Array.from(cloneModelMaps[key]
.map(t => {
const { modelName, model, deduct, deductType, maxRounds } = t; const { modelName, model, deduct, deductType, maxRounds } = t;
return { modelName, model, deduct, deductType, maxRounds }; return { modelName, model, deduct, deductType, maxRounds };
}).reduce((map, obj) => map.set(obj.modelName, obj), new Map()).values()); })
.reduce((map, obj) => map.set(obj.modelName, obj), new Map()).values());
}); });
return { return {
modelTypeList: this.modelTypes, modelTypeList: this.modelTypes,
@ -194,27 +195,6 @@ let ModelsService = class ModelsService {
.where('id = :id', { id }) .where('id = :id', { id })
.execute(); .execute();
} }
async refreshBaiduAccesstoken() {
const allKeys = await this.modelsEntity.find({ where: { keyType: 2 } });
const keysMap = {};
allKeys.forEach(keyInfo => {
const { key, secret } = keyInfo;
if (!keysMap.key) {
keysMap[key] = [{ keyInfo }];
}
else {
keysMap[key].push(keyInfo);
}
});
Object.keys(keysMap).forEach(async (key) => {
const { secret, id } = keysMap[key][0]['keyInfo'];
const accessToken = await (0, baidu_1.getAccessToken)(key, secret);
await this.modelsEntity.update({ key }, { accessToken });
});
setTimeout(() => {
this.initCalcKey();
}, 1000);
}
async getRandomDrawKey() { async getRandomDrawKey() {
const drawkeys = await this.modelsEntity.find({ where: { isDraw: true, status: true } }); const drawkeys = await this.modelsEntity.find({ where: { isDraw: true, status: true } });
if (!drawkeys.length) { if (!drawkeys.length) {

View File

@ -34,9 +34,9 @@ __decorate([
__metadata("design:type", String) __metadata("design:type", String)
], MjDrawDto.prototype, "imgUrl", void 0); ], MjDrawDto.prototype, "imgUrl", void 0);
__decorate([ __decorate([
(0, swagger_1.ApiProperty)({ example: 1, description: '绘画动作 绘图、放大、变换、图生图' }), (0, swagger_1.ApiProperty)({ example: 'IMAGINE', description: '任务类型,可用值:IMAGINE,UPSCALE,VARIATION,ZOOM,PAN,DESCRIBE,BLEND,SHORTEN,SWAP_FACE' }),
(0, class_validator_1.IsOptional)(), (0, class_validator_1.IsOptional)(),
__metadata("design:type", Number) __metadata("design:type", String)
], MjDrawDto.prototype, "action", void 0); ], MjDrawDto.prototype, "action", void 0);
__decorate([ __decorate([
(0, swagger_1.ApiProperty)({ example: 1, description: '变体或者放大的序号' }), (0, swagger_1.ApiProperty)({ example: 1, description: '变体或者放大的序号' }),
@ -48,4 +48,9 @@ __decorate([
(0, class_validator_1.IsOptional)(), (0, class_validator_1.IsOptional)(),
__metadata("design:type", Number) __metadata("design:type", Number)
], MjDrawDto.prototype, "drawId", void 0); ], MjDrawDto.prototype, "drawId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 1, description: '任务ID' }),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", Number)
], MjDrawDto.prototype, "taskId", void 0);
exports.MjDrawDto = MjDrawDto; exports.MjDrawDto = MjDrawDto;

View File

@ -17,7 +17,6 @@ const common_1 = require("@nestjs/common");
const bull_1 = require("@nestjs/bull"); const bull_1 = require("@nestjs/bull");
const utils_1 = require("../../common/utils"); const utils_1 = require("../../common/utils");
const midjourney_service_1 = require("../midjourney/midjourney.service"); const midjourney_service_1 = require("../midjourney/midjourney.service");
const midjourney_constant_1 = require("../../common/constants/midjourney.constant");
const userBalance_service_1 = require("../userBalance/userBalance.service"); const userBalance_service_1 = require("../userBalance/userBalance.service");
const globalConfig_service_1 = require("../globalConfig/globalConfig.service"); const globalConfig_service_1 = require("../globalConfig/globalConfig.service");
let QueueService = class QueueService { let QueueService = class QueueService {
@ -33,68 +32,31 @@ let QueueService = class QueueService {
await this.midjourneyService.cleanQueue(); await this.midjourneyService.cleanQueue();
} }
async addMjDrawQueue(body, req) { async addMjDrawQueue(body, req) {
const { prompt, imgUrl, extraParam, orderId, action = 1, drawId } = body; const { imgUrl, orderId, action, drawId } = body;
await this.midjourneyService.checkLimit(req); await this.midjourneyService.checkLimit(req);
await this.userBalanceService.validateBalance(req, 'mjDraw', action === 2 ? 1 : 4); await this.userBalanceService.validateBalance(req, 'mjDraw', action === 'UPSCALE' ? 1 : 4);
if (action === midjourney_constant_1.MidjourneyActionEnum.DRAW || action === midjourney_constant_1.MidjourneyActionEnum.GENERATE) { if (action === 'IMAGINE') {
const randomDrawId = `${(0, utils_1.createRandomUid)()}`; const randomDrawId = `${(0, utils_1.createRandomUid)()}`;
const params = Object.assign(Object.assign({}, body), { userId: req.user.id, randomDrawId }); const params = Object.assign(Object.assign({}, body), { userId: req.user.id, randomDrawId });
const res = await this.midjourneyService.addDrawQueue(params); const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000; const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action: imgUrl ? 4 : 1, userId: req.user.id }, { delay: 1000, timeout: +timeout }); const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action: action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id); this.jobIds.push(job.id);
return true; return true;
} }
else {
const { orderId, action, drawId } = body;
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
if (!drawId || !orderId) { if (!drawId || !orderId) {
throw new common_1.HttpException('缺少必要参数!', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('缺少必要参数!', common_1.HttpStatus.BAD_REQUEST);
} }
if (action === midjourney_constant_1.MidjourneyActionEnum.UPSCALE) {
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const { custom_id } = actionDetail;
await this.midjourneyService.checkIsUpscale(custom_id);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
if (action === midjourney_constant_1.MidjourneyActionEnum.VARIATION) {
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
if (action === midjourney_constant_1.MidjourneyActionEnum.REGENERATE) {
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
if (action === midjourney_constant_1.MidjourneyActionEnum.VARY) {
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
if (action === midjourney_constant_1.MidjourneyActionEnum.ZOOM) {
const actionDetail = await this.midjourneyService.getDrawActionDetail(action, drawId, orderId);
const params = Object.assign(Object.assign(Object.assign({}, body), { userId: req.user.id }), actionDetail);
const res = await this.midjourneyService.addDrawQueue(params);
const timeout = (await this.globalConfigService.getConfigs(['mjTimeoutMs'])) || 200000;
const job = await this.mjDrawQueue.add('mjDraw', { id: res.id, action, userId: req.user.id }, { delay: 1000, timeout: +timeout });
this.jobIds.push(job.id);
return;
}
} }
async getQueue() { async getQueue() {
return { jobIds: this.jobIds }; return { jobIds: this.jobIds };

View File

@ -44,9 +44,6 @@ let TaskService = class TaskService {
}); });
}); });
} }
refreshBaiduAccesstoken() {
this.modelsService.refreshBaiduAccesstoken();
}
}; };
__decorate([ __decorate([
(0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_HOUR), (0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_HOUR),
@ -60,12 +57,6 @@ __decorate([
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", Promise) __metadata("design:returntype", Promise)
], TaskService.prototype, "checkUserMemerExpire", null); ], TaskService.prototype, "checkUserMemerExpire", null);
__decorate([
(0, schedule_1.Cron)('0 0 */5 * *'),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], TaskService.prototype, "refreshBaiduAccesstoken", null);
TaskService = __decorate([ TaskService = __decorate([
(0, common_1.Injectable)(), (0, common_1.Injectable)(),
__param(0, (0, typeorm_1.InjectRepository)(userBalance_entity_1.UserBalanceEntity)), __param(0, (0, typeorm_1.InjectRepository)(userBalance_entity_1.UserBalanceEntity)),

View File

@ -27,21 +27,32 @@ let UploadService = class UploadService {
const { filename: name, originalname, buffer, dir = 'ai', mimetype } = file; const { filename: name, originalname, buffer, dir = 'ai', mimetype } = file;
const fileTyle = mimetype ? mimetype.split('/')[1] : ''; const fileTyle = mimetype ? mimetype.split('/')[1] : '';
const filename = originalname || name; const filename = originalname || name;
common_1.Logger.debug(`准备上传文件: ${filename}, 类型: ${fileTyle}`, 'UploadService');
const { tencentCosStatus = 0, aliOssStatus = 0, cheveretoStatus = 0, } = await this.globalConfigService.getConfigs(['tencentCosStatus', 'aliOssStatus', 'cheveretoStatus']); const { tencentCosStatus = 0, aliOssStatus = 0, cheveretoStatus = 0, } = await this.globalConfigService.getConfigs(['tencentCosStatus', 'aliOssStatus', 'cheveretoStatus']);
common_1.Logger.debug(`上传配置状态 - 腾讯云: ${tencentCosStatus}, 阿里云: ${aliOssStatus}, Chevereto: ${cheveretoStatus}`, 'UploadService');
if (!Number(tencentCosStatus) && !Number(aliOssStatus) && !Number(cheveretoStatus)) { if (!Number(tencentCosStatus) && !Number(aliOssStatus) && !Number(cheveretoStatus)) {
throw new common_1.HttpException('请先前往后台配置上传图片的方式', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('请先前往后台配置上传图片的方式', common_1.HttpStatus.BAD_REQUEST);
} }
try {
if (Number(tencentCosStatus)) { if (Number(tencentCosStatus)) {
return this.uploadFileByTencentCos({ filename, buffer, dir, fileTyle }); common_1.Logger.debug(`使用腾讯云COS上传`, 'UploadService');
return await this.uploadFileByTencentCos({ filename, buffer, dir, fileTyle });
} }
if (Number(aliOssStatus)) { if (Number(aliOssStatus)) {
common_1.Logger.debug(`使用阿里云OSS上传`, 'UploadService');
return await this.uploadFileByAliOss({ filename, buffer, dir, fileTyle }); return await this.uploadFileByAliOss({ filename, buffer, dir, fileTyle });
} }
if (Number(cheveretoStatus)) { if (Number(cheveretoStatus)) {
common_1.Logger.debug(`使用Chevereto上传`, 'UploadService');
const { filename, buffer: fromBuffer, dir } = file; const { filename, buffer: fromBuffer, dir } = file;
return await this.uploadFileByChevereto({ filename, buffer: fromBuffer.toString('base64'), dir, fileTyle }); return await this.uploadFileByChevereto({ filename, buffer: fromBuffer.toString('base64'), dir, fileTyle });
} }
} }
catch (error) {
common_1.Logger.error(`上传失败: ${error.message}`, 'UploadService');
throw error;
}
}
async getUploadType() { async getUploadType() {
const { tencentCosStatus = 0, aliOssStatus = 0, cheveretoStatus = 0, } = await this.globalConfigService.getConfigs(['tencentCosStatus', 'aliOssStatus', 'cheveretoStatus']); const { tencentCosStatus = 0, aliOssStatus = 0, cheveretoStatus = 0, } = await this.globalConfigService.getConfigs(['tencentCosStatus', 'aliOssStatus', 'cheveretoStatus']);
if (Number(tencentCosStatus)) { if (Number(tencentCosStatus)) {
@ -108,25 +119,9 @@ let UploadService = class UploadService {
this.tencentCos = new TENCENTCOS({ SecretId, SecretKey, FileParallelLimit: 10 }); this.tencentCos = new TENCENTCOS({ SecretId, SecretKey, FileParallelLimit: 10 });
try { try {
const proxyMj = (await this.globalConfigService.getConfigs(['mjProxy'])) || 0; const proxyMj = (await this.globalConfigService.getConfigs(['mjProxy'])) || 0;
if (Number(proxyMj) === 1) {
const data = { cosType: 'tencent', url, cosParams: { Bucket, Region, SecretId, SecretKey } };
const mjProxyUrl = (await this.globalConfigService.getConfigs(['mjProxyUrl'])) || 'http://172.247.48.137:8000';
const res = await axios_1.default.post(`${mjProxyUrl}/mj/replaceUpload`, data);
if (!res.data)
throw new common_1.HttpException('上传图片失败[ten][url]', common_1.HttpStatus.BAD_REQUEST);
let locationUrl = res.data.replace(/^(http:\/\/|https:\/\/|\/\/|)(.*)/, 'https://$2');
const { acceleratedDomain } = await this.getUploadConfig('tencent');
if (acceleratedDomain) {
locationUrl = locationUrl.replace(/^(https:\/\/[^/]+)(\/.*)$/, `https://${acceleratedDomain}$2`);
console.log('当前已开启全球加速----------------->');
}
return locationUrl;
}
else {
const buffer = await this.getBufferFromUrl(url); const buffer = await this.getBufferFromUrl(url);
return await this.uploadFileByTencentCos({ filename, buffer, dir, fileTyle: '' }); return await this.uploadFileByTencentCos({ filename, buffer, dir, fileTyle: '' });
} }
}
catch (error) { catch (error) {
console.log('TODO->error: ', error); console.log('TODO->error: ', error);
throw new common_1.HttpException('上传图片失败[ten][url]', common_1.HttpStatus.BAD_REQUEST); throw new common_1.HttpException('上传图片失败[ten][url]', common_1.HttpStatus.BAD_REQUEST);

View File

@ -1,6 +1,6 @@
{ {
"name": "aiweb", "name": "99ai",
"version": "2.5.0", "version": "2.6.0",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,
@ -43,7 +43,7 @@
"@types/cache-manager-redis-store": "^2.0.1", "@types/cache-manager-redis-store": "^2.0.1",
"abort-controller": "^3.0.0", "abort-controller": "^3.0.0",
"ali-oss": "^6.17.1", "ali-oss": "^6.17.1",
"axios": "^1.3.4", "axios": "^1.4.0",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"body-parser": "^1.20.2", "body-parser": "^1.20.2",
"bull": "^4.10.4", "bull": "^4.10.4",
@ -63,6 +63,7 @@
"form-data": "^4.0.0", "form-data": "^4.0.0",
"guid-typescript": "^1.0.9", "guid-typescript": "^1.0.9",
"hbs": "^4.2.0", "hbs": "^4.2.0",
"image-size": "^1.1.1",
"ioredis": "^5.3.2", "ioredis": "^5.3.2",
"isomorphic-fetch": "^3.0.0", "isomorphic-fetch": "^3.0.0",
"javascript-obfuscator": "^4.0.2", "javascript-obfuscator": "^4.0.2",

View File

@ -1,12 +1,9 @@
{ {
"apps": { "apps": {
"name": "99ai-v2.5.0", "name": "99ai-v2.6.0",
"script": "./dist/main.js", "script": "./dist/main.js",
"watch": true, "watch": true,
"ignore_watch": [ "ignore_watch": ["node_modules", "logs"],
"node_modules",
"logs"
],
"env": { "env": {
"TZ": "Asia/Shanghai" "TZ": "Asia/Shanghai"
}, },

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as u,r as i,s as p,x as f,o as v,c as m,e as a,a as o,f as h,m as b,_ as x,h as I,p as k,i as w,k as y,t as B,b as N,n as g,q as s}from"./index-a4526b0d.js";const c=t=>(k("data-v-599b59df"),t=t(),w(),t),C={class:"notfound"},S={class:"content"},V=c(()=>o("h1",null,"404",-1)),R=c(()=>o("div",{class:"desc"}," 抱歉,你访问的页面不存在 ",-1)),_=u({__name:"[...all]",setup(t){const l=b(),e=i({inter:NaN,countdown:5});p(()=>{e.value.inter&&clearInterval(e.value.inter)}),f(()=>{e.value.inter=setInterval(()=>{e.value.countdown--,e.value.countdown===0&&(e.value.inter&&clearInterval(e.value.inter),n())},1e3)});function n(){l.push("/")}return(q,D)=>{const r=x,d=I("el-button");return v(),m("div",C,[a(r,{name:"404",class:"icon"}),o("div",S,[V,R,a(d,{type:"primary",onClick:n},{default:h(()=>[y(B(N(e).countdown)+" 秒后,返回首页 ",1)]),_:1})])])}}});typeof s=="function"&&s(_);const L=g(_,[["__scopeId","data-v-599b59df"]]);export{L as default}; import{d as u,r as i,s as p,x as f,o as v,c as m,e as a,a as o,f as h,m as b,_ as x,h as I,p as k,i as w,k as y,t as B,b as N,n as g,q as s}from"./index-4eef28ae.js";const c=t=>(k("data-v-599b59df"),t=t(),w(),t),C={class:"notfound"},S={class:"content"},V=c(()=>o("h1",null,"404",-1)),R=c(()=>o("div",{class:"desc"}," 抱歉,你访问的页面不存在 ",-1)),_=u({__name:"[...all]",setup(t){const l=b(),e=i({inter:NaN,countdown:5});p(()=>{e.value.inter&&clearInterval(e.value.inter)}),f(()=>{e.value.inter=setInterval(()=>{e.value.countdown--,e.value.countdown===0&&(e.value.inter&&clearInterval(e.value.inter),n())},1e3)});function n(){l.push("/")}return(q,D)=>{const r=x,d=I("el-button");return v(),m("div",C,[a(r,{name:"404",class:"icon"}),o("div",S,[V,R,a(d,{type:"primary",onClick:n},{default:h(()=>[y(B(N(e).countdown)+" 秒后,返回首页 ",1)]),_:1})])])}}});typeof s=="function"&&s(_);const L=g(_,[["__scopeId","data-v-599b59df"]]);export{L as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as B}from"./index-5e1cba81.js";import{a as N}from"./userBalance-acf40cb3.js";import{s as F,t as G,U as H,q as O}from"./index-20fc3802.js";import{u as $}from"./utcformatTime-e76e5157.js";import{d as Q,r as _,Q as I,x as X,o as u,c as y,e as a,f as t,R as x,S as R,b as m,k as d,w as J,I as h,t as b,P as K,h as r,X as W,q as M}from"./index-a4526b0d.js";const Z=Q({__name:"accountLog",setup(ee){const C=_(),T=_(0),f=_(!1),n=I({userId:"",rechargeType:"",packageId:"",page:1,size:15});I({model3Count:[{required:!0,message:"请填写赠送基础模型额度",trigger:"blur"}],model4Count:[{required:!0,message:"请填写赠送高级模型额度",trigger:"blur"}],drawMjCount:[{required:!0,message:"请填写赠送绘画积分额度",trigger:"blur"}]});const A=_([]),U=_([]);async function i(){try{f.value=!0;const s=await N.queryUserAccountLog(n),{rows:l,count:g}=s.data;f.value=!1,T.value=g,U.value=l}catch{f.value=!1}}async function P(s){const l=await K.queryAllUser({size:30,keyword:s});A.value=l.data.rows}function q(s){s==null||s.resetFields(),i()}return X(()=>i()),(s,l)=>{const g=r("el-option"),k=r("el-select"),w=r("el-form-item"),S=r("el-button"),D=r("el-form"),z=B,V=r("el-avatar"),o=r("el-table-column"),v=r("el-tag"),Y=r("el-table"),E=r("el-pagination"),L=r("el-row"),j=W("loading");return u(),y("div",null,[a(z,null,{default:t(()=>[a(D,{ref_key:"formRef",ref:C,inline:!0,model:n},{default:t(()=>[a(w,{label:"用户名称",prop:"userId"},{default:t(()=>[a(k,{modelValue:n.userId,"onUpdate:modelValue":l[0]||(l[0]=e=>n.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"昵称|手机号|邮箱[模糊搜索]","remote-show-suffix":"","remote-method":P},{default:t(()=>[(u(!0),y(x,null,R(A.value,e=>(u(),h(g,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(w,{label:"充值类型",prop:"rechargeType"},{default:t(()=>[a(k,{modelValue:n.rechargeType,"onUpdate:modelValue":l[1]||(l[1]=e=>n.rechargeType=e),placeholder:"请选择充值类型",clearable:""},{default:t(()=>[(u(!0),y(x,null,R(m(F),e=>(u(),h(g,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(w,null,{default:t(()=>[a(S,{type:"primary",onClick:i},{default:t(()=>[d(" 查询 ")]),_:1}),a(S,{onClick:l[2]||(l[2]=e=>q(C.value))},{default:t(()=>[d(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(z,{style:{width:"100%"}},{default:t(()=>[J((u(),h(Y,{border:"",data:U.value,style:{width:"100%"},size:"large"},{default:t(()=>[a(o,{prop:"avatar",label:"用户头像",width:"120",fixed:""},{default:t(e=>[a(V,{src:e.row.avatar},null,8,["src"])]),_:1}),a(o,{prop:"username",label:"用户名称",width:"150",fixed:""}),a(o,{prop:"id",label:"用户ID",width:"80"}),a(o,{prop:"uid",label:"订单ID",width:"130"}),a(o,{prop:"email",label:"用户邮箱",width:"250",align:"left"}),a(o,{prop:"balanceInfo.useModel4Count",label:"充值类型",width:"160",align:"center"},{default:t(e=>[a(v,{type:"success"},{default:t(()=>{var p,c;return[d(b((p=e.row)!=null&&p.rechargeType?m(G)[(c=e.row)==null?void 0:c.rechargeType]:"---"),1)]}),_:2},1024)]),_:1}),a(o,{prop:"model3Count",label:"基础模型额度",width:"120",align:"center"}),a(o,{prop:"model4Count",label:"高级模型额度",width:"120",align:"center"}),a(o,{prop:"drawMjCount",label:"绘画余额额度",width:"120",align:"center"}),a(o,{label:"额度有效期",width:"170",align:"center"},{default:t(e=>[a(v,{type:"success"},{default:t(()=>{var p,c;return[d(b(((p=e.row)==null?void 0:p.days)<=0?"永久时效":`${(c=e.row)==null?void 0:c.days}`),1)]}),_:2},1024)]),_:1}),a(o,{prop:"status",label:"用户状态",width:"120",align:"center"},{default:t(({row:e})=>[a(v,{type:m(H)[e.status]},{default:t(()=>[d(b(m(O)[e.status]),1)]),_:2},1032,["type"])]),_:1}),a(o,{prop:"createdAt",label:"充值时间",width:"200",align:"center"},{default:t(e=>[d(b(m($)(e.row.createdAt,"YYYY-MM-DD hh:mm:ss")),1)]),_:1})]),_:1},8,["data"])),[[j,f.value]]),a(L,{class:"flex justify-end mt-5"},{default:t(()=>[a(E,{"current-page":n.page,"onUpdate:currentPage":l[3]||(l[3]=e=>n.page=e),"page-size":n.size,"onUpdate:pageSize":l[4]||(l[4]=e=>n.size=e),class:"mr-5","page-sizes":[15,30,50,100],layout:"total, sizes, prev, pager, next, jumper",total:T.value,onSizeChange:i,onCurrentChange:i},null,8,["current-page","page-size","total"])]),_:1})]),_:1})])}}});typeof M=="function"&&M(Z);export{Z as default}; import{_ as B}from"./index-7911c6db.js";import{a as N}from"./userBalance-567019d9.js";import{r as F,s as G,U as H,p as O}from"./index-66a830a3.js";import{u as $}from"./utcformatTime-e76e5157.js";import{d as Q,r as _,Q as I,x as X,o as u,c as y,e as a,f as t,R as x,S as R,b as m,k as d,w as J,I as h,t as b,P as K,h as r,X as W,q as M}from"./index-4eef28ae.js";const Z=Q({__name:"accountLog",setup(ee){const C=_(),T=_(0),f=_(!1),n=I({userId:"",rechargeType:"",packageId:"",page:1,size:15});I({model3Count:[{required:!0,message:"请填写赠送基础模型额度",trigger:"blur"}],model4Count:[{required:!0,message:"请填写赠送高级模型额度",trigger:"blur"}],drawMjCount:[{required:!0,message:"请填写赠送绘画积分额度",trigger:"blur"}]});const A=_([]),U=_([]);async function i(){try{f.value=!0;const s=await N.queryUserAccountLog(n),{rows:l,count:g}=s.data;f.value=!1,T.value=g,U.value=l}catch{f.value=!1}}async function P(s){const l=await K.queryAllUser({size:30,keyword:s});A.value=l.data.rows}function D(s){s==null||s.resetFields(),i()}return X(()=>i()),(s,l)=>{const g=r("el-option"),k=r("el-select"),w=r("el-form-item"),S=r("el-button"),V=r("el-form"),z=B,q=r("el-avatar"),o=r("el-table-column"),v=r("el-tag"),Y=r("el-table"),E=r("el-pagination"),L=r("el-row"),j=W("loading");return u(),y("div",null,[a(z,null,{default:t(()=>[a(V,{ref_key:"formRef",ref:C,inline:!0,model:n},{default:t(()=>[a(w,{label:"用户名称",prop:"userId"},{default:t(()=>[a(k,{modelValue:n.userId,"onUpdate:modelValue":l[0]||(l[0]=e=>n.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"昵称|手机号|邮箱[模糊搜索]","remote-show-suffix":"","remote-method":P},{default:t(()=>[(u(!0),y(x,null,R(A.value,e=>(u(),h(g,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(w,{label:"充值类型",prop:"rechargeType"},{default:t(()=>[a(k,{modelValue:n.rechargeType,"onUpdate:modelValue":l[1]||(l[1]=e=>n.rechargeType=e),placeholder:"请选择充值类型",clearable:""},{default:t(()=>[(u(!0),y(x,null,R(m(F),e=>(u(),h(g,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(w,null,{default:t(()=>[a(S,{type:"primary",onClick:i},{default:t(()=>[d(" 查询 ")]),_:1}),a(S,{onClick:l[2]||(l[2]=e=>D(C.value))},{default:t(()=>[d(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(z,{style:{width:"100%"}},{default:t(()=>[J((u(),h(Y,{border:"",data:U.value,style:{width:"100%"},size:"large"},{default:t(()=>[a(o,{prop:"avatar",label:"用户头像",width:"120",fixed:""},{default:t(e=>[a(q,{src:e.row.avatar},null,8,["src"])]),_:1}),a(o,{prop:"username",label:"用户名称",width:"150",fixed:""}),a(o,{prop:"id",label:"用户ID",width:"80"}),a(o,{prop:"uid",label:"订单ID",width:"130"}),a(o,{prop:"email",label:"用户邮箱",width:"250",align:"left"}),a(o,{prop:"balanceInfo.useModel4Count",label:"充值类型",width:"160",align:"center"},{default:t(e=>[a(v,{type:"success"},{default:t(()=>{var p,c;return[d(b((p=e.row)!=null&&p.rechargeType?m(G)[(c=e.row)==null?void 0:c.rechargeType]:"---"),1)]}),_:2},1024)]),_:1}),a(o,{prop:"model3Count",label:"基础模型额度",width:"120",align:"center"}),a(o,{prop:"model4Count",label:"高级模型额度",width:"120",align:"center"}),a(o,{prop:"drawMjCount",label:"绘画余额额度",width:"120",align:"center"}),a(o,{label:"额度有效期",width:"170",align:"center"},{default:t(e=>[a(v,{type:"success"},{default:t(()=>{var p,c;return[d(b(((p=e.row)==null?void 0:p.days)<=0?"永久时效":`${(c=e.row)==null?void 0:c.days}`),1)]}),_:2},1024)]),_:1}),a(o,{prop:"status",label:"用户状态",width:"120",align:"center"},{default:t(({row:e})=>[a(v,{type:m(H)[e.status]},{default:t(()=>[d(b(m(O)[e.status]),1)]),_:2},1032,["type"])]),_:1}),a(o,{prop:"createdAt",label:"充值时间",width:"200",align:"center"},{default:t(e=>[d(b(m($)(e.row.createdAt,"YYYY-MM-DD hh:mm:ss")),1)]),_:1})]),_:1},8,["data"])),[[j,f.value]]),a(L,{class:"flex justify-end mt-5"},{default:t(()=>[a(E,{"current-page":n.page,"onUpdate:currentPage":l[3]||(l[3]=e=>n.page=e),"page-size":n.size,"onUpdate:pageSize":l[4]||(l[4]=e=>n.size=e),class:"mr-5","page-sizes":[15,30,50,100],layout:"total, sizes, prev, pager, next, jumper",total:T.value,onSizeChange:i,onCurrentChange:i},null,8,["current-page","page-size","total"])]),_:1})]),_:1})])}}});typeof M=="function"&&M(Z);export{Z as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as v}from"./index-5e1cba81.js";import{a as O}from"./config-33902e1a.js";import{d as w,Q as B,r as C,B as I,x as R,o as U,c as q,e,f as l,a as b,k as N,b as m,E as g,h as o,q as y}from"./index-a4526b0d.js";const j={class:"flex justify-between"},E=b("b",null,"阿里云OSS参数设置",-1),M=w({__name:"ali",setup(Q){const t=B({aliOssStatus:"",aliOssAccessKeyId:"",aliOssAccessKeySecret:"",aliOssRegion:"",aliOssBucket:""}),_=C();async function f(){const n=await O.queryConfig({keys:["aliOssAccessKeySecret","aliOssRegion","aliOssBucket","aliOssAccessKeyId","aliOssStatus"]});Object.assign(t,n.data)}function x(){var n;(n=_.value)==null||n.validate(async s=>{if(s){try{await O.setConfig({settings:V(t)}),g.success("变更配置信息成功")}catch{}f()}else g.error("请填写完整信息")})}function V(n){return Object.keys(n).map(s=>({configKey:s,configVal:n[s]}))}const i=I(()=>[{required:Number(t.aliOssStatus)===1,message:"开启配置后请填写此项",trigger:"change"}]);return R(()=>{f()}),(n,s)=>{const p=o("el-alert"),S=v,k=o("el-button"),K=o("el-switch"),c=o("el-form-item"),u=o("el-col"),r=o("el-row"),d=o("el-input"),A=o("el-form"),h=o("el-card");return U(),q("div",null,[e(S,null,{default:l(()=>[e(p,{closable:!1,"show-icon":"",title:"阿里云COS参数说明",description:"阿里云的对象存储oss服务、前往阿里云申请oss服务 https://oss.console.aliyun.com/ 、如果同时开启多个存储服务、腾讯云高于阿里云优先级!",type:"success"})]),_:1}),e(h,{style:{margin:"20px"}},{header:l(()=>[b("div",j,[E,e(k,{class:"button",text:"",onClick:x},{default:l(()=>[N(" 保存设置 ")]),_:1})])]),default:l(()=>[e(A,{ref_key:"formRef",ref:_,model:t,"label-width":"120px"},{default:l(()=>[e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"服务启用状态",prop:"aliOssStatus"},{default:l(()=>[e(K,{modelValue:t.aliOssStatus,"onUpdate:modelValue":s[0]||(s[0]=a=>t.aliOssStatus=a),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"accessKeyId",prop:"aliOssAccessKeyId",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssAccessKeyId,"onUpdate:modelValue":s[1]||(s[1]=a=>t.aliOssAccessKeyId=a),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"keySecret",prop:"aliOssAccessKeySecret",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssAccessKeySecret,"onUpdate:modelValue":s[2]||(s[2]=a=>t.aliOssAccessKeySecret=a),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"存储桶名称",prop:"aliOssBucket",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssBucket,"onUpdate:modelValue":s[3]||(s[3]=a=>t.aliOssBucket=a),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"所属地域",prop:"aliOssRegion",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssRegion,"onUpdate:modelValue":s[4]||(s[4]=a=>t.aliOssRegion=a),placeholder:"请填写所属地域(oss-cn-shanghai)",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}});typeof y=="function"&&y(M);export{M as default}; import{_ as v}from"./index-7911c6db.js";import{a as O}from"./config-b4a9e7c0.js";import{d as w,Q as B,r as C,B as I,x as R,o as U,c as q,e,f as l,a as b,k as N,b as m,E as g,h as o,q as y}from"./index-4eef28ae.js";const j={class:"flex justify-between"},E=b("b",null,"阿里云OSS参数设置",-1),M=w({__name:"ali",setup(Q){const t=B({aliOssStatus:"",aliOssAccessKeyId:"",aliOssAccessKeySecret:"",aliOssRegion:"",aliOssBucket:""}),_=C();async function f(){const n=await O.queryConfig({keys:["aliOssAccessKeySecret","aliOssRegion","aliOssBucket","aliOssAccessKeyId","aliOssStatus"]});Object.assign(t,n.data)}function x(){var n;(n=_.value)==null||n.validate(async s=>{if(s){try{await O.setConfig({settings:V(t)}),g.success("变更配置信息成功")}catch{}f()}else g.error("请填写完整信息")})}function V(n){return Object.keys(n).map(s=>({configKey:s,configVal:n[s]}))}const i=I(()=>[{required:Number(t.aliOssStatus)===1,message:"开启配置后请填写此项",trigger:"change"}]);return R(()=>{f()}),(n,s)=>{const p=o("el-alert"),S=v,k=o("el-button"),K=o("el-switch"),c=o("el-form-item"),u=o("el-col"),r=o("el-row"),d=o("el-input"),A=o("el-form"),h=o("el-card");return U(),q("div",null,[e(S,null,{default:l(()=>[e(p,{closable:!1,"show-icon":"",title:"阿里云COS参数说明",description:"阿里云的对象存储oss服务、前往阿里云申请oss服务 https://oss.console.aliyun.com/ 、如果同时开启多个存储服务、腾讯云高于阿里云优先级!",type:"success"})]),_:1}),e(h,{style:{margin:"20px"}},{header:l(()=>[b("div",j,[E,e(k,{class:"button",text:"",onClick:x},{default:l(()=>[N(" 保存设置 ")]),_:1})])]),default:l(()=>[e(A,{ref_key:"formRef",ref:_,model:t,"label-width":"120px"},{default:l(()=>[e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"服务启用状态",prop:"aliOssStatus"},{default:l(()=>[e(K,{modelValue:t.aliOssStatus,"onUpdate:modelValue":s[0]||(s[0]=a=>t.aliOssStatus=a),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"accessKeyId",prop:"aliOssAccessKeyId",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssAccessKeyId,"onUpdate:modelValue":s[1]||(s[1]=a=>t.aliOssAccessKeyId=a),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"keySecret",prop:"aliOssAccessKeySecret",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssAccessKeySecret,"onUpdate:modelValue":s[2]||(s[2]=a=>t.aliOssAccessKeySecret=a),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"存储桶名称",prop:"aliOssBucket",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssBucket,"onUpdate:modelValue":s[3]||(s[3]=a=>t.aliOssBucket=a),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(r,null,{default:l(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(c,{label:"所属地域",prop:"aliOssRegion",rules:m(i)},{default:l(()=>[e(d,{modelValue:t.aliOssRegion,"onUpdate:modelValue":s[4]||(s[4]=a=>t.aliOssRegion=a),placeholder:"请填写所属地域(oss-cn-shanghai)",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}});typeof y=="function"&&y(M);export{M as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{Y as o}from"./index-a4526b0d.js";const r={queryBadWords:(d={})=>o.get("badwords/query",{params:d}),queryViolation:(d={})=>o.get("badwords/violation",{params:d}),delBadWords:d=>o.post("badwords/del",d),addBadWords:d=>o.post("badwords/add",d),updateBadWords:d=>o.post("badwords/update",d)};export{r as A}; import{Y as o}from"./index-4eef28ae.js";const r={queryBadWords:(d={})=>o.get("badwords/query",{params:d}),queryViolation:(d={})=>o.get("badwords/violation",{params:d}),delBadWords:d=>o.post("badwords/del",d),addBadWords:d=>o.post("badwords/add",d),updateBadWords:d=>o.post("badwords/update",d)};export{r as A};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as C}from"./index-5e1cba81.js";import{a as m}from"./config-33902e1a.js";import{d as k,Q as q,r as f,x as U,o as j,c as B,e,f as t,a as y,k as E,E as b,h as o,q as x}from"./index-a4526b0d.js";const N={class:"flex justify-between"},I=y("b",null,"百度文本审核参数设置",-1),M=k({__name:"baiduSensitive",setup(O){const a=q({baiduTextStatus:"",baiduTextApiKey:"",baiduTextSecretKey:""}),g=f({baiduTextStatus:[{required:!0,trigger:"blur",message:"请选择是否启用百度文本审核"}],baiduTextSecretKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核SecretKey"}],baiduTextApiKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核APIKey"}]}),c=f();async function d(){const n=await m.queryConfig({keys:["baiduTextStatus","baiduTextSecretKey","baiduTextApiKey"]});Object.assign(a,n.data)}function K(){var n;(n=c.value)==null||n.validate(async l=>{if(l){try{await m.setConfig({settings:T(a)}),b.success("变更配置信息成功")}catch{}d()}else b.error("请填写完整信息")})}function T(n){return Object.keys(n).map(l=>({configKey:l,configVal:n[l]}))}return U(()=>{d()}),(n,l)=>{const _=o("el-alert"),S=C,v=o("el-button"),V=o("el-switch"),w=o("el-tooltip"),i=o("el-form-item"),r=o("el-col"),s=o("el-row"),p=o("el-input"),h=o("el-form"),A=o("el-card");return j(),B("div",null,[e(S,null,{default:t(()=>[e(_,{closable:!1,"show-icon":"",title:"百度文本审核参数说明",description:"接入原因、当前百度云免费5万条申请文档地址https://console.bce.baidu.com/ai/#/ai/antiporn/overview/index 、如果百度云敏感词与自定义敏感词都配置的情况、会先检测百度云后检测自定义的敏感词!",type:"success"})]),_:1}),e(A,{style:{margin:"20px"}},{header:t(()=>[y("div",N,[I,e(v,{class:"button",text:"",onClick:K},{default:t(()=>[E(" 保存设置 ")]),_:1})])]),default:t(()=>[e(h,{ref_key:"formRef",ref:c,rules:g.value,model:a,"label-width":"150px"},{default:t(()=>[e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"开启此敏感词设置",prop:"baiduTextStatus"},{default:t(()=>[e(w,{content:"开启将打开敏感词检测、如果同时开启其他敏感词将会通过菜单顺序仅同时开启一个!",placement:"top","show-after":500},{default:t(()=>[e(V,{modelValue:a.baiduTextStatus,"onUpdate:modelValue":l[0]||(l[0]=u=>a.baiduTextStatus=u),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"文本审核ApiKey",prop:"baiduTextApiKey"},{default:t(()=>[e(p,{modelValue:a.baiduTextApiKey,"onUpdate:modelValue":l[1]||(l[1]=u=>a.baiduTextApiKey=u),placeholder:"请填写百度文本审核ApiKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"文本审核SecretKey",prop:"baiduTextSecretKey"},{default:t(()=>[e(p,{modelValue:a.baiduTextSecretKey,"onUpdate:modelValue":l[2]||(l[2]=u=>a.baiduTextSecretKey=u),placeholder:"请填写百度文本审核SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof x=="function"&&x(M);export{M as default}; import{_ as C}from"./index-7911c6db.js";import{a as m}from"./config-b4a9e7c0.js";import{d as k,Q as q,r as f,x as U,o as j,c as B,e,f as t,a as y,k as E,E as b,h as o,q as x}from"./index-4eef28ae.js";const N={class:"flex justify-between"},I=y("b",null,"百度文本审核参数设置",-1),M=k({__name:"baiduSensitive",setup(O){const a=q({baiduTextStatus:"",baiduTextApiKey:"",baiduTextSecretKey:""}),g=f({baiduTextStatus:[{required:!0,trigger:"blur",message:"请选择是否启用百度文本审核"}],baiduTextSecretKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核SecretKey"}],baiduTextApiKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核APIKey"}]}),c=f();async function d(){const n=await m.queryConfig({keys:["baiduTextStatus","baiduTextSecretKey","baiduTextApiKey"]});Object.assign(a,n.data)}function K(){var n;(n=c.value)==null||n.validate(async l=>{if(l){try{await m.setConfig({settings:T(a)}),b.success("变更配置信息成功")}catch{}d()}else b.error("请填写完整信息")})}function T(n){return Object.keys(n).map(l=>({configKey:l,configVal:n[l]}))}return U(()=>{d()}),(n,l)=>{const _=o("el-alert"),S=C,v=o("el-button"),V=o("el-switch"),w=o("el-tooltip"),i=o("el-form-item"),r=o("el-col"),s=o("el-row"),p=o("el-input"),h=o("el-form"),A=o("el-card");return j(),B("div",null,[e(S,null,{default:t(()=>[e(_,{closable:!1,"show-icon":"",title:"百度文本审核参数说明",description:"接入原因、当前百度云免费5万条申请文档地址https://console.bce.baidu.com/ai/#/ai/antiporn/overview/index 、如果百度云敏感词与自定义敏感词都配置的情况、会先检测百度云后检测自定义的敏感词!",type:"success"})]),_:1}),e(A,{style:{margin:"20px"}},{header:t(()=>[y("div",N,[I,e(v,{class:"button",text:"",onClick:K},{default:t(()=>[E(" 保存设置 ")]),_:1})])]),default:t(()=>[e(h,{ref_key:"formRef",ref:c,rules:g.value,model:a,"label-width":"150px"},{default:t(()=>[e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"开启此敏感词设置",prop:"baiduTextStatus"},{default:t(()=>[e(w,{content:"开启将打开敏感词检测、如果同时开启其他敏感词将会通过菜单顺序仅同时开启一个!",placement:"top","show-after":500},{default:t(()=>[e(V,{modelValue:a.baiduTextStatus,"onUpdate:modelValue":l[0]||(l[0]=u=>a.baiduTextStatus=u),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"文本审核ApiKey",prop:"baiduTextApiKey"},{default:t(()=>[e(p,{modelValue:a.baiduTextApiKey,"onUpdate:modelValue":l[1]||(l[1]=u=>a.baiduTextApiKey=u),placeholder:"请填写百度文本审核ApiKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(i,{label:"文本审核SecretKey",prop:"baiduTextSecretKey"},{default:t(()=>[e(p,{modelValue:a.baiduTextSecretKey,"onUpdate:modelValue":l[2]||(l[2]=u=>a.baiduTextSecretKey=u),placeholder:"请填写百度文本审核SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof x=="function"&&x(M);export{M as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as C}from"./index-5e1cba81.js";import{a as f}from"./config-33902e1a.js";import{d as k,Q as v,r as m,x as S,o as q,c as j,e,f as t,a as g,k as D,E as b,h as n,q as y}from"./index-a4526b0d.js";const P={class:"flex justify-between"},B=g("b",null,"百度翻译参数设置",-1),E=k({__name:"baidufanyi",setup(N){const l=v({baiduFanyiAppId:"",baiduFanyiSecret:""}),x=m({baiduFanyiSecret:[{required:!0,trigger:"blur",message:"请填写应用ID"}],baiduFanyiAppId:[{required:!0,trigger:"blur",message:"请填写基础ID"}]}),i=m();async function s(){const o=await f.queryConfig({keys:["baiduFanyiSecret","baiduFanyiAppId"]});Object.assign(l,o.data)}function F(){var o;(o=i.value)==null||o.validate(async a=>{if(a){try{await f.setConfig({settings:I(l)}),b.success("变更配置信息成功")}catch{}s()}else b.error("请填写完整信息")})}function I(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return S(()=>{s()}),(o,a)=>{const u=n("el-alert"),A=C,V=n("el-button"),c=n("el-input"),d=n("el-form-item"),p=n("el-col"),_=n("el-row"),h=n("el-form"),w=n("el-card");return q(),j("div",null,[e(A,null,{default:t(()=>[e(u,{closable:!1,"show-icon":"",title:"百度翻译参数说明",description:"百度翻译为可选项、仅在mj描述词绘画中使用、当开启设置为百度翻译时会使用翻译、反之则使用AI翻译、如您需要、具体申请配置文档地址 https://api.fanyi.baidu.com/ 请开通通用文本翻译、别忘记填写你的服务器白名单才能使用!",type:"success"})]),_:1}),e(w,{style:{margin:"20px"}},{header:t(()=>[g("div",P,[B,e(V,{class:"button",text:"",onClick:F},{default:t(()=>[D(" 保存设置 ")]),_:1})])]),default:t(()=>[e(h,{ref_key:"formRef",ref:i,rules:x.value,model:l,"label-width":"130px"},{default:t(()=>[e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译APPID",prop:"baiduFanyiAppId"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiAppId,"onUpdate:modelValue":a[0]||(a[0]=r=>l.baiduFanyiAppId=r),placeholder:"请填写百度翻译APPID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译秘钥",prop:"baiduFanyiSecret"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiSecret,"onUpdate:modelValue":a[1]||(a[1]=r=>l.baiduFanyiSecret=r),placeholder:"请填写百度翻译秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default}; import{_ as C}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as k,Q as v,r as m,x as S,o as q,c as j,e,f as t,a as g,k as D,E as b,h as n,q as y}from"./index-4eef28ae.js";const P={class:"flex justify-between"},B=g("b",null,"百度翻译参数设置",-1),E=k({__name:"baidufanyi",setup(N){const l=v({baiduFanyiAppId:"",baiduFanyiSecret:""}),x=m({baiduFanyiSecret:[{required:!0,trigger:"blur",message:"请填写应用ID"}],baiduFanyiAppId:[{required:!0,trigger:"blur",message:"请填写基础ID"}]}),i=m();async function s(){const o=await f.queryConfig({keys:["baiduFanyiSecret","baiduFanyiAppId"]});Object.assign(l,o.data)}function F(){var o;(o=i.value)==null||o.validate(async a=>{if(a){try{await f.setConfig({settings:I(l)}),b.success("变更配置信息成功")}catch{}s()}else b.error("请填写完整信息")})}function I(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return S(()=>{s()}),(o,a)=>{const u=n("el-alert"),A=C,V=n("el-button"),c=n("el-input"),d=n("el-form-item"),p=n("el-col"),_=n("el-row"),h=n("el-form"),w=n("el-card");return q(),j("div",null,[e(A,null,{default:t(()=>[e(u,{closable:!1,"show-icon":"",title:"百度翻译参数说明",description:"百度翻译为可选项、仅在mj描述词绘画中使用、当开启设置为百度翻译时会使用翻译、反之则使用AI翻译、如您需要、具体申请配置文档地址 https://api.fanyi.baidu.com/ 请开通通用文本翻译、别忘记填写你的服务器白名单才能使用!",type:"success"})]),_:1}),e(w,{style:{margin:"20px"}},{header:t(()=>[g("div",P,[B,e(V,{class:"button",text:"",onClick:F},{default:t(()=>[D(" 保存设置 ")]),_:1})])]),default:t(()=>[e(h,{ref_key:"formRef",ref:i,rules:x.value,model:l,"label-width":"130px"},{default:t(()=>[e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译APPID",prop:"baiduFanyiAppId"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiAppId,"onUpdate:modelValue":a[0]||(a[0]=r=>l.baiduFanyiAppId=r),placeholder:"请填写百度翻译APPID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(_,null,{default:t(()=>[e(p,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"百度翻译秘钥",prop:"baiduFanyiSecret"},{default:t(()=>[e(c,{modelValue:l.baiduFanyiSecret,"onUpdate:modelValue":a[1]||(a[1]=r=>l.baiduFanyiSecret=r),placeholder:"请填写百度翻译秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as v}from"./index-5e1cba81.js";import{a as f}from"./config-33902e1a.js";import{d as M,Q as T,r as g,x as q,o as A,c as D,e,f as l,a as x,k as U,E as b,h as o,q as y}from"./index-a4526b0d.js";const h={class:"flex justify-between"},j=x("b",null,"分销系统基础设置",-1),E=M({__name:"base",setup(N){const a=T({salesBaseRatio:10,salesSeniorRatio:30,salesAllowDrawMoney:10,salesBaseTitle:"新秀分销商"}),w=g({salesBaseRatio:[{required:!0,trigger:"blur",message:"请填写默认佣金比例"}],salesSeniorRatio:[{required:!0,trigger:"blur",message:"请填写高级代理默认比例"}],salesBaseTitle:[{required:!0,trigger:"blur",message:"请填写默认用户推介等级名称"}]}),m=g();async function d(){const s=await f.queryConfig({keys:["salesBaseRatio","salesSeniorRatio","salesAllowDrawMoney","salesBaseTitle"]});Object.assign(a,s.data)}function V(){var s;(s=m.value)==null||s.validate(async t=>{if(t){try{await f.setConfig({settings:B(a)}),b.success("变更配置信息成功")}catch{}d()}else b.error("请填写完整信息")})}function B(s){return Object.keys(s).map(t=>({configKey:t,configVal:s[t]}))}return q(()=>{d()}),(s,t)=>{const c=o("el-alert"),R=v,C=o("el-button"),_=o("el-input-number"),r=o("el-form-item"),i=o("el-col"),u=o("el-row"),p=o("el-input"),S=o("el-form"),k=o("el-card");return A(),D("div",null,[e(R,null,{default:l(()=>[e(c,{closable:!1,"show-icon":"",title:"分销系统基础配置",description:"填写默认佣金比例和高级分销佣金比例会对应显示到客户端的分销页面、同时新用户将使用默认分销比例、允许提现额度限制用户最低提现金额、分销名称同样对应分销页面、高级代理可自定义名称!",type:"success"})]),_:1}),e(k,{style:{margin:"20px"}},{header:l(()=>[x("div",h,[j,e(C,{class:"button",text:"",onClick:V},{default:l(()=>[U(" 保存设置 ")]),_:1})])]),default:l(()=>[e(S,{ref_key:"formRef",ref:m,model:a,"label-width":"140px",rules:w.value},{default:l(()=>[e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认分销佣金比例",prop:"salesBaseRatio"},{default:l(()=>[e(_,{modelValue:a.salesBaseRatio,"onUpdate:modelValue":t[0]||(t[0]=n=>a.salesBaseRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"高级分销佣金比例",prop:"salesSeniorRatio"},{default:l(()=>[e(_,{modelValue:a.salesSeniorRatio,"onUpdate:modelValue":t[1]||(t[1]=n=>a.salesSeniorRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"允许最低提现金额",prop:"salesAllowDrawMoney"},{default:l(()=>[e(p,{modelValue:a.salesAllowDrawMoney,"onUpdate:modelValue":t[2]||(t[2]=n=>a.salesAllowDrawMoney=n),type:"number","step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认等级分销名称",prop:"salesBaseTitle"},{default:l(()=>[e(p,{modelValue:a.salesBaseTitle,"onUpdate:modelValue":t[3]||(t[3]=n=>a.salesBaseTitle=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default}; import{_ as v}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as M,Q as T,r as g,x as q,o as A,c as D,e,f as l,a as x,k as U,E as b,h as o,q as y}from"./index-4eef28ae.js";const h={class:"flex justify-between"},j=x("b",null,"分销系统基础设置",-1),E=M({__name:"base",setup(N){const a=T({salesBaseRatio:10,salesSeniorRatio:30,salesAllowDrawMoney:10,salesBaseTitle:"新秀分销商"}),w=g({salesBaseRatio:[{required:!0,trigger:"blur",message:"请填写默认佣金比例"}],salesSeniorRatio:[{required:!0,trigger:"blur",message:"请填写高级代理默认比例"}],salesBaseTitle:[{required:!0,trigger:"blur",message:"请填写默认用户推介等级名称"}]}),m=g();async function d(){const s=await f.queryConfig({keys:["salesBaseRatio","salesSeniorRatio","salesAllowDrawMoney","salesBaseTitle"]});Object.assign(a,s.data)}function V(){var s;(s=m.value)==null||s.validate(async t=>{if(t){try{await f.setConfig({settings:B(a)}),b.success("变更配置信息成功")}catch{}d()}else b.error("请填写完整信息")})}function B(s){return Object.keys(s).map(t=>({configKey:t,configVal:s[t]}))}return q(()=>{d()}),(s,t)=>{const c=o("el-alert"),R=v,C=o("el-button"),_=o("el-input-number"),r=o("el-form-item"),i=o("el-col"),u=o("el-row"),p=o("el-input"),S=o("el-form"),k=o("el-card");return A(),D("div",null,[e(R,null,{default:l(()=>[e(c,{closable:!1,"show-icon":"",title:"分销系统基础配置",description:"填写默认佣金比例和高级分销佣金比例会对应显示到客户端的分销页面、同时新用户将使用默认分销比例、允许提现额度限制用户最低提现金额、分销名称同样对应分销页面、高级代理可自定义名称!",type:"success"})]),_:1}),e(k,{style:{margin:"20px"}},{header:l(()=>[x("div",h,[j,e(C,{class:"button",text:"",onClick:V},{default:l(()=>[U(" 保存设置 ")]),_:1})])]),default:l(()=>[e(S,{ref_key:"formRef",ref:m,model:a,"label-width":"140px",rules:w.value},{default:l(()=>[e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认分销佣金比例",prop:"salesBaseRatio"},{default:l(()=>[e(_,{modelValue:a.salesBaseRatio,"onUpdate:modelValue":t[0]||(t[0]=n=>a.salesBaseRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"高级分销佣金比例",prop:"salesSeniorRatio"},{default:l(()=>[e(_,{modelValue:a.salesSeniorRatio,"onUpdate:modelValue":t[1]||(t[1]=n=>a.salesSeniorRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"允许最低提现金额",prop:"salesAllowDrawMoney"},{default:l(()=>[e(p,{modelValue:a.salesAllowDrawMoney,"onUpdate:modelValue":t[2]||(t[2]=n=>a.salesAllowDrawMoney=n),type:"number","step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认等级分销名称",prop:"salesBaseTitle"},{default:l(()=>[e(p,{modelValue:a.salesBaseTitle,"onUpdate:modelValue":t[3]||(t[3]=n=>a.salesBaseTitle=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as I}from"./index-5e1cba81.js";import{a as m}from"./config-33902e1a.js";import{d as S,Q as T,r as p,x as U,o as j,c as q,e,f as o,a as k,k as B,E as b,h as n,q as g}from"./index-a4526b0d.js";const E={class:"flex justify-between"},N=k("b",null,"系统基础设置",-1),M=S({__name:"base",setup(O){const t=T({baiduCode:"",baiduSiteId:"",baiduToken:""}),x=p({}),c=p();async function _(){const a=await m.queryConfig({keys:["baiduCode","baiduSiteId","baiduToken"]});Object.assign(t,a.data)}function y(){var a;(a=c.value)==null||a.validate(async l=>{if(l){try{await m.setConfig({settings:C(t)}),b.success("变更配置信息成功")}catch{}_()}else b.error("请填写完整信息")})}function C(a){return Object.keys(a).map(l=>({configKey:l,configVal:a[l]}))}return U(()=>{_()}),(a,l)=>{const f=n("el-alert"),V=I,w=n("el-button"),s=n("el-input"),u=n("el-form-item"),i=n("el-col"),r=n("el-row"),h=n("el-form"),v=n("el-card");return j(),q("div",null,[e(V,null,{default:o(()=>[e(f,{closable:!1,"show-icon":"",title:"基础设置说明",description:"百度统计默认使用的是demo数据、用于demo展示、最终数据在首页程呈现、请查看部署文档或前往百度统计申请自己的专属key与token、这是免费的服务、如果您不想使用将下面设置留空就行。",type:"success"})]),_:1}),e(v,{style:{margin:"20px"}},{header:o(()=>[k("div",E,[N,e(w,{class:"button",text:"",onClick:y},{default:o(()=>[B(" 保存设置 ")]),_:1})])]),default:o(()=>[e(h,{ref_key:"formRef",ref:c,rules:x.value,model:t,"label-width":"120px"},{default:o(()=>[e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计siteId",prop:"baiduSiteId"},{default:o(()=>[e(s,{modelValue:t.baiduSiteId,"onUpdate:modelValue":l[0]||(l[0]=d=>t.baiduSiteId=d),placeholder:"请填写百度site_id、不会请查看部署文档",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计token",prop:"baiduToken"},{default:o(()=>[e(s,{modelValue:t.baiduToken,"onUpdate:modelValue":l[1]||(l[1]=d=>t.baiduToken=d),placeholder:"请填写百度access_token、不会请查看部署文档",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计代码",prop:"baiduCode"},{default:o(()=>[e(s,{modelValue:t.baiduCode,"onUpdate:modelValue":l[2]||(l[2]=d=>t.baiduCode=d),placeholder:"填写百度统计代码可统计每日访问量详情,如果没有使用用请查看详细文档!",type:"textarea",rows:12,clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(M);export{M as default}; import{_ as I}from"./index-7911c6db.js";import{a as m}from"./config-b4a9e7c0.js";import{d as S,Q as T,r as p,x as U,o as j,c as q,e,f as o,a as k,k as B,E as b,h as n,q as g}from"./index-4eef28ae.js";const E={class:"flex justify-between"},N=k("b",null,"系统基础设置",-1),M=S({__name:"base",setup(O){const t=T({baiduCode:"",baiduSiteId:"",baiduToken:""}),x=p({}),c=p();async function _(){const a=await m.queryConfig({keys:["baiduCode","baiduSiteId","baiduToken"]});Object.assign(t,a.data)}function y(){var a;(a=c.value)==null||a.validate(async l=>{if(l){try{await m.setConfig({settings:C(t)}),b.success("变更配置信息成功")}catch{}_()}else b.error("请填写完整信息")})}function C(a){return Object.keys(a).map(l=>({configKey:l,configVal:a[l]}))}return U(()=>{_()}),(a,l)=>{const f=n("el-alert"),V=I,w=n("el-button"),s=n("el-input"),u=n("el-form-item"),i=n("el-col"),r=n("el-row"),h=n("el-form"),v=n("el-card");return j(),q("div",null,[e(V,null,{default:o(()=>[e(f,{closable:!1,"show-icon":"",title:"基础设置说明",description:"百度统计默认使用的是demo数据、用于demo展示、最终数据在首页程呈现、请查看部署文档或前往百度统计申请自己的专属key与token、这是免费的服务、如果您不想使用将下面设置留空就行。",type:"success"})]),_:1}),e(v,{style:{margin:"20px"}},{header:o(()=>[k("div",E,[N,e(w,{class:"button",text:"",onClick:y},{default:o(()=>[B(" 保存设置 ")]),_:1})])]),default:o(()=>[e(h,{ref_key:"formRef",ref:c,rules:x.value,model:t,"label-width":"120px"},{default:o(()=>[e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计siteId",prop:"baiduSiteId"},{default:o(()=>[e(s,{modelValue:t.baiduSiteId,"onUpdate:modelValue":l[0]||(l[0]=d=>t.baiduSiteId=d),placeholder:"请填写百度site_id、不会请查看部署文档",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计token",prop:"baiduToken"},{default:o(()=>[e(s,{modelValue:t.baiduToken,"onUpdate:modelValue":l[1]||(l[1]=d=>t.baiduToken=d),placeholder:"请填写百度access_token、不会请查看部署文档",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:o(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(u,{label:"百度统计代码",prop:"baiduCode"},{default:o(()=>[e(s,{modelValue:t.baiduCode,"onUpdate:modelValue":l[2]||(l[2]=d=>t.baiduCode=d),placeholder:"填写百度统计代码可统计每日访问量详情,如果没有使用用请查看详细文档!",type:"textarea",rows:12,clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(M);export{M as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as K}from"./index-5e1cba81.js";import{a as m}from"./config-33902e1a.js";import{d as C,Q as k,r as f,x as q,o as N,c as U,e,f as t,a as S,k as j,E as v,h as i,q as B}from"./index-a4526b0d.js";const E={class:"flex justify-between"},M=S("b",null,"百度文本审核参数设置",-1),O=C({__name:"builtIn",setup(R){const l=k({nineaiBuiltInSensitiveStatus:"",nineaiBuiltInSensitiveApiBase:"",nineaiBuiltInSensitiveAuthKey:""}),g=f({nineaiBuiltInSensitiveStatus:[{required:!0,trigger:"blur",message:"请选择是否启用官方敏感词审核"}],nineaiBuiltInSensitiveApiBase:[{required:!0,trigger:"blur",message:"请填写官方敏感词审核Api地址"}],nineaiBuiltInSensitiveAuthKey:[{required:!0,trigger:"blur",message:"请填写官方敏感词审核授权Key"}]}),c=f();async function _(){const a=await m.queryConfig({keys:["nineaiBuiltInSensitiveStatus","nineaiBuiltInSensitiveAuthKey","nineaiBuiltInSensitiveApiBase"]});Object.assign(l,a.data)}function y(){var a;(a=c.value)==null||a.validate(async n=>{if(n){try{await m.setConfig({settings:I(l)}),v.success("变更配置信息成功")}catch{}_()}else v.error("请填写完整信息")})}function I(a){return Object.keys(a).map(n=>({configKey:n,configVal:a[n]}))}return q(()=>{_()}),(a,n)=>{const p=i("el-alert"),b=K,A=i("el-button"),h=i("el-switch"),x=i("el-tooltip"),s=i("el-form-item"),u=i("el-col"),r=i("el-row"),d=i("el-input"),V=i("el-form"),w=i("el-card");return N(),U("div",null,[e(b,null,{default:t(()=>[e(p,{closable:!1,"show-icon":"",title:"NineAi敏感词说明",description:"官方提供的敏感词检测Api、价格相对实惠、如需使用请联系管理员购买、后续开通专有的通道",type:"success"})]),_:1}),e(w,{style:{margin:"20px"}},{header:t(()=>[S("div",E,[M,e(A,{class:"button",text:"",onClick:y},{default:t(()=>[j(" 保存设置 ")]),_:1})])]),default:t(()=>[e(V,{ref_key:"formRef",ref:c,rules:g.value,model:l,"label-width":"150px"},{default:t(()=>[e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"开启此敏感词设置",prop:"nineaiBuiltInSensitiveStatus"},{default:t(()=>[e(x,{content:"开启将打开敏感词检测、如果同时开启其他敏感词将会通过菜单顺序仅同时开启一个!",placement:"top","show-after":500},{default:t(()=>[e(h,{modelValue:l.nineaiBuiltInSensitiveStatus,"onUpdate:modelValue":n[0]||(n[0]=o=>l.nineaiBuiltInSensitiveStatus=o),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"文本审核ApiKey",prop:"nineaiBuiltInSensitiveApiBase"},{default:t(()=>[e(d,{modelValue:l.nineaiBuiltInSensitiveApiBase,"onUpdate:modelValue":n[1]||(n[1]=o=>l.nineaiBuiltInSensitiveApiBase=o),placeholder:"请填写官方敏感词审核Api地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"文本审核SecretKey",prop:"nineaiBuiltInSensitiveAuthKey"},{default:t(()=>[e(d,{modelValue:l.nineaiBuiltInSensitiveAuthKey,"onUpdate:modelValue":n[2]||(n[2]=o=>l.nineaiBuiltInSensitiveAuthKey=o),placeholder:"请填写官方敏感词审核授权Key",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof B=="function"&&B(O);export{O as default}; import{_ as K}from"./index-7911c6db.js";import{a as m}from"./config-b4a9e7c0.js";import{d as C,Q as k,r as f,x as q,o as N,c as U,e,f as t,a as S,k as j,E as v,h as i,q as B}from"./index-4eef28ae.js";const E={class:"flex justify-between"},M=S("b",null,"百度文本审核参数设置",-1),O=C({__name:"builtIn",setup(R){const l=k({nineaiBuiltInSensitiveStatus:"",nineaiBuiltInSensitiveApiBase:"",nineaiBuiltInSensitiveAuthKey:""}),g=f({nineaiBuiltInSensitiveStatus:[{required:!0,trigger:"blur",message:"请选择是否启用官方敏感词审核"}],nineaiBuiltInSensitiveApiBase:[{required:!0,trigger:"blur",message:"请填写官方敏感词审核Api地址"}],nineaiBuiltInSensitiveAuthKey:[{required:!0,trigger:"blur",message:"请填写官方敏感词审核授权Key"}]}),c=f();async function _(){const a=await m.queryConfig({keys:["nineaiBuiltInSensitiveStatus","nineaiBuiltInSensitiveAuthKey","nineaiBuiltInSensitiveApiBase"]});Object.assign(l,a.data)}function y(){var a;(a=c.value)==null||a.validate(async n=>{if(n){try{await m.setConfig({settings:I(l)}),v.success("变更配置信息成功")}catch{}_()}else v.error("请填写完整信息")})}function I(a){return Object.keys(a).map(n=>({configKey:n,configVal:a[n]}))}return q(()=>{_()}),(a,n)=>{const p=i("el-alert"),b=K,A=i("el-button"),h=i("el-switch"),x=i("el-tooltip"),s=i("el-form-item"),u=i("el-col"),r=i("el-row"),d=i("el-input"),V=i("el-form"),w=i("el-card");return N(),U("div",null,[e(b,null,{default:t(()=>[e(p,{closable:!1,"show-icon":"",title:"NineAi敏感词说明",description:"官方提供的敏感词检测Api、价格相对实惠、如需使用请联系管理员购买、后续开通专有的通道",type:"success"})]),_:1}),e(w,{style:{margin:"20px"}},{header:t(()=>[S("div",E,[M,e(A,{class:"button",text:"",onClick:y},{default:t(()=>[j(" 保存设置 ")]),_:1})])]),default:t(()=>[e(V,{ref_key:"formRef",ref:c,rules:g.value,model:l,"label-width":"150px"},{default:t(()=>[e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"开启此敏感词设置",prop:"nineaiBuiltInSensitiveStatus"},{default:t(()=>[e(x,{content:"开启将打开敏感词检测、如果同时开启其他敏感词将会通过菜单顺序仅同时开启一个!",placement:"top","show-after":500},{default:t(()=>[e(h,{modelValue:l.nineaiBuiltInSensitiveStatus,"onUpdate:modelValue":n[0]||(n[0]=o=>l.nineaiBuiltInSensitiveStatus=o),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"文本审核ApiKey",prop:"nineaiBuiltInSensitiveApiBase"},{default:t(()=>[e(d,{modelValue:l.nineaiBuiltInSensitiveApiBase,"onUpdate:modelValue":n[1]||(n[1]=o=>l.nineaiBuiltInSensitiveApiBase=o),placeholder:"请填写官方敏感词审核Api地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(r,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"文本审核SecretKey",prop:"nineaiBuiltInSensitiveAuthKey"},{default:t(()=>[e(d,{modelValue:l.nineaiBuiltInSensitiveAuthKey,"onUpdate:modelValue":n[2]||(n[2]=o=>l.nineaiBuiltInSensitiveAuthKey=o),placeholder:"请填写官方敏感词审核授权Key",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof B=="function"&&B(O);export{O as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{Y as t}from"./index-a4526b0d.js";const a={queryChatAll:r=>t.get("chatLog/chatAll",{params:r}),queryDrawAll:r=>t.get("chatLog/drawAll",{params:r}),recDrawImg:r=>t.post("chatLog/recDrawImg",r),queryMjDrawAll:r=>t.get("midjourney/getList",{params:r}),recMjDrawImg:r=>t.post("midjourney/rec",r),delChatLog:r=>t.post("midjourney/del",r)};export{a as A}; import{Y as t}from"./index-4eef28ae.js";const a={queryChatAll:r=>t.get("chatLog/chatAll",{params:r}),queryDrawAll:r=>t.get("chatLog/drawAll",{params:r}),recDrawImg:r=>t.post("chatLog/recDrawImg",r),queryMjDrawAll:r=>t.get("midjourney/getList",{params:r}),recMjDrawImg:r=>t.post("midjourney/rec",r),delChatLog:r=>t.post("midjourney/del",r)};export{a as A};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as j}from"./index-5e1cba81.js";import{d as K,r as u,Q as N,x as F,o as m,c as C,e as t,f as o,R as H,S as P,b as i,j as O,k as d,w as Q,I as T,t as _,a as x,P as X,h as l,X as $,l as G,q as A}from"./index-a4526b0d.js";import{m as g}from"./marked.esm-76161808.js";import{A as J}from"./chat-1da93106.js";import{u as W}from"./utcformatTime-e76e5157.js";const Z={class:"answer"},E=["innerHTML"],ee=K({__name:"chat",setup(te){const V=new g.Renderer;g.setOptions({renderer:V,gfm:!0,pedantic:!1,sanitize:!1});const c=u(!1),h=u([]),v=u(),b=u(0),a=N({userId:"",prompt:"",page:1,size:10}),y=u([]);async function p(){c.value=!0;try{const r=await J.queryChatAll(a);c.value=!1;const{rows:n,count:f}=r.data;b.value=f,y.value=n}catch{c.value=!1}}async function I(r){const n=await X.queryAllUser({size:30,username:r});h.value=n.data.rows}function U(r){r==null||r.resetFields(),p()}return F(()=>{p()}),(r,n)=>{const f=l("el-option"),D=l("el-select"),w=l("el-form-item"),M=l("el-input"),k=l("el-button"),S=l("el-form"),z=j,s=l("el-table-column"),L=l("el-popover"),R=l("el-table"),q=l("el-pagination"),B=l("el-row"),Y=$("loading");return m(),C("div",null,[t(z,null,{default:o(()=>[t(S,{ref_key:"formRef",ref:v,inline:!0,model:a},{default:o(()=>[t(w,{label:"用户名称",prop:"userId"},{default:o(()=>[t(D,{modelValue:a.userId,"onUpdate:modelValue":n[0]||(n[0]=e=>a.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"用户姓名[模糊搜索]","remote-show-suffix":"","remote-method":I},{default:o(()=>[(m(!0),C(H,null,P(i(h),e=>(m(),T(f,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(w,{label:"用户询问的问题",prop:"prompt"},{default:o(()=>[t(M,{modelValue:a.prompt,"onUpdate:modelValue":n[1]||(n[1]=e=>a.prompt=e),placeholder:"提问问题[模糊搜索]",onKeydown:O(G(p,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1}),t(w,null,{default:o(()=>[t(k,{type:"primary",onClick:p},{default:o(()=>[d(" 查询 ")]),_:1}),t(k,{onClick:n[2]||(n[2]=e=>U(i(v)))},{default:o(()=>[d(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(z,{style:{width:"100%"}},{default:o(()=>[Q((m(),T(R,{border:"",data:i(y),style:{width:"100%"},size:"large","tooltip-options":{}},{default:o(()=>[t(s,{fixed:"",prop:"username",label:"用户名称",width:"150"}),t(s,{prop:"createdAt",label:"角色",width:"80"},{default:o(e=>[d(_(e.row.role==="user"?"用户":"电脑"),1)]),_:1}),t(s,{prop:"email",label:"用户邮箱",width:"200"}),t(s,{prop:"answer",label:"用户询问/AI回复"},{default:o(e=>[t(L,{placement:"top",width:400,trigger:"click"},{reference:o(()=>[x("div",Z,_(e.row.role==="user"?e.row.prompt:e.row.answer),1)]),default:o(()=>[x("div",{class:"answer_container",innerHTML:i(g)(e.row.role==="user"?e.row.prompt:e.row.answer||"")},null,8,E)]),_:2},1024)]),_:1}),t(s,{prop:"completionTokens",label:"提问/回答Token",width:"140",align:"center"},{default:o(e=>[d(_(e.row.role==="user"?e.row.promptTokens:e.row.completionTokens),1)]),_:1}),t(s,{prop:"totalTokens",label:"总计Toekn",width:"110",align:"center"}),t(s,{prop:"model",label:"模型",width:"200"}),t(s,{prop:"createdAt",label:"提问时间",width:"200"},{default:o(e=>[d(_(i(W)(e.row.createdAt,"YYYY-MM-DD hh:mm:ss")),1)]),_:1})]),_:1},8,["data"])),[[Y,i(c)]]),t(B,{class:"flex justify-end mt-5"},{default:o(()=>[t(q,{"current-page":a.page,"onUpdate:currentPage":n[3]||(n[3]=e=>a.page=e),"page-size":a.size,"onUpdate:pageSize":n[4]||(n[4]=e=>a.size=e),class:"mr-5","page-sizes":[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",total:i(b),onSizeChange:p,onCurrentChange:p},null,8,["current-page","page-size","total"])]),_:1})]),_:1})])}}});typeof A=="function"&&A(ee);export{ee as default}; import{_ as j}from"./index-7911c6db.js";import{d as K,r as u,Q as N,x as F,o as m,c as C,e as t,f as o,R as H,S as P,b as i,j as O,k as d,w as Q,I as T,t as _,a as x,P as X,h as l,X as $,l as G,q as A}from"./index-4eef28ae.js";import{m as g}from"./marked.esm-76161808.js";import{A as J}from"./chat-8cf72149.js";import{u as W}from"./utcformatTime-e76e5157.js";const Z={class:"answer"},E=["innerHTML"],ee=K({__name:"chat",setup(te){const V=new g.Renderer;g.setOptions({renderer:V,gfm:!0,pedantic:!1,sanitize:!1});const c=u(!1),h=u([]),v=u(),b=u(0),a=N({userId:"",prompt:"",page:1,size:10}),y=u([]);async function p(){c.value=!0;try{const r=await J.queryChatAll(a);c.value=!1;const{rows:n,count:f}=r.data;b.value=f,y.value=n}catch{c.value=!1}}async function I(r){const n=await X.queryAllUser({size:30,username:r});h.value=n.data.rows}function U(r){r==null||r.resetFields(),p()}return F(()=>{p()}),(r,n)=>{const f=l("el-option"),D=l("el-select"),w=l("el-form-item"),M=l("el-input"),k=l("el-button"),S=l("el-form"),z=j,s=l("el-table-column"),L=l("el-popover"),R=l("el-table"),q=l("el-pagination"),B=l("el-row"),Y=$("loading");return m(),C("div",null,[t(z,null,{default:o(()=>[t(S,{ref_key:"formRef",ref:v,inline:!0,model:a},{default:o(()=>[t(w,{label:"用户名称",prop:"userId"},{default:o(()=>[t(D,{modelValue:a.userId,"onUpdate:modelValue":n[0]||(n[0]=e=>a.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"用户姓名[模糊搜索]","remote-show-suffix":"","remote-method":I},{default:o(()=>[(m(!0),C(H,null,P(i(h),e=>(m(),T(f,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(w,{label:"用户询问的问题",prop:"prompt"},{default:o(()=>[t(M,{modelValue:a.prompt,"onUpdate:modelValue":n[1]||(n[1]=e=>a.prompt=e),placeholder:"提问问题[模糊搜索]",onKeydown:O(G(p,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1}),t(w,null,{default:o(()=>[t(k,{type:"primary",onClick:p},{default:o(()=>[d(" 查询 ")]),_:1}),t(k,{onClick:n[2]||(n[2]=e=>U(i(v)))},{default:o(()=>[d(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(z,{style:{width:"100%"}},{default:o(()=>[Q((m(),T(R,{border:"",data:i(y),style:{width:"100%"},size:"large","tooltip-options":{}},{default:o(()=>[t(s,{fixed:"",prop:"username",label:"用户名称",width:"150"}),t(s,{prop:"createdAt",label:"角色",width:"80"},{default:o(e=>[d(_(e.row.role==="user"?"用户":"电脑"),1)]),_:1}),t(s,{prop:"email",label:"用户邮箱",width:"200"}),t(s,{prop:"answer",label:"用户询问/AI回复"},{default:o(e=>[t(L,{placement:"top",width:400,trigger:"click"},{reference:o(()=>[x("div",Z,_(e.row.role==="user"?e.row.prompt:e.row.answer),1)]),default:o(()=>[x("div",{class:"answer_container",innerHTML:i(g)(e.row.role==="user"?e.row.prompt:e.row.answer||"")},null,8,E)]),_:2},1024)]),_:1}),t(s,{prop:"completionTokens",label:"提问/回答Token",width:"140",align:"center"},{default:o(e=>[d(_(e.row.role==="user"?e.row.promptTokens:e.row.completionTokens),1)]),_:1}),t(s,{prop:"totalTokens",label:"总计Toekn",width:"110",align:"center"}),t(s,{prop:"model",label:"模型",width:"200"}),t(s,{prop:"createdAt",label:"提问时间",width:"200"},{default:o(e=>[d(_(i(W)(e.row.createdAt,"YYYY-MM-DD hh:mm:ss")),1)]),_:1})]),_:1},8,["data"])),[[Y,i(c)]]),t(B,{class:"flex justify-end mt-5"},{default:o(()=>[t(q,{"current-page":a.page,"onUpdate:currentPage":n[3]||(n[3]=e=>a.page=e),"page-size":a.size,"onUpdate:pageSize":n[4]||(n[4]=e=>a.size=e),class:"mr-5","page-sizes":[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",total:i(b),onSizeChange:p,onCurrentChange:p},null,8,["current-page","page-size","total"])]),_:1})]),_:1})])}}});typeof A=="function"&&A(ee);export{ee as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{Y as e}from"./index-a4526b0d.js";const p={queryKeyList:t=>e.get("chatgpt/keyList",{params:t}),queryKeyModelList:t=>e.get("chatgpt/keyModelList",{params:t}),queryKeyDetail:t=>e.get("chatgpt/keyDetail",{params:t}),addGptKey:t=>e.post("chatgpt/addKey",t),updateGptKey:t=>e.post("chatgpt/updateKey",t),addWhiteUser:t=>e.post("chatgpt/addWhiteUser",t),updateWhiteUser:t=>e.post("chatgpt/updateWhiteUser",t),queryWhiteUserList:t=>e.get("chatgpt/userWhiteList",{params:t}),deleteGptKey:t=>e.post("chatgpt/deleteKey",t),queryChatBoxTypes:()=>e.get("chatgpt/queryChatBoxTypes"),setChatBoxType:t=>e.post("chatgpt/setChatBoxType",t),delChatBoxType:t=>e.post("chatgpt/delChatBoxType",t),queryChatBoxs:()=>e.get("chatgpt/queryChatBoxs"),setChatBox:t=>e.post("chatgpt/setChatBox",t),delChatBox:t=>e.post("chatgpt/delChatBox",t),queryChatPreTypes:()=>e.get("chatgpt/queryChatPreTypes"),setChatPreType:t=>e.post("chatgpt/setChatPreType",t),delChatPreType:t=>e.post("chatgpt/delChatPreType",t),queryChatPres:()=>e.get("chatgpt/queryChatPres"),setChatPre:t=>e.post("chatgpt/setChatPre",t),delChatPre:t=>e.post("chatgpt/delChatPre",t)};export{p as A}; import{Y as e}from"./index-4eef28ae.js";const p={queryKeyList:t=>e.get("chatgpt/keyList",{params:t}),queryKeyModelList:t=>e.get("chatgpt/keyModelList",{params:t}),queryKeyDetail:t=>e.get("chatgpt/keyDetail",{params:t}),addGptKey:t=>e.post("chatgpt/addKey",t),updateGptKey:t=>e.post("chatgpt/updateKey",t),addWhiteUser:t=>e.post("chatgpt/addWhiteUser",t),updateWhiteUser:t=>e.post("chatgpt/updateWhiteUser",t),queryWhiteUserList:t=>e.get("chatgpt/userWhiteList",{params:t}),deleteGptKey:t=>e.post("chatgpt/deleteKey",t),queryChatBoxTypes:()=>e.get("chatgpt/queryChatBoxTypes"),setChatBoxType:t=>e.post("chatgpt/setChatBoxType",t),delChatBoxType:t=>e.post("chatgpt/delChatBoxType",t),queryChatBoxs:()=>e.get("chatgpt/queryChatBoxs"),setChatBox:t=>e.post("chatgpt/setChatBox",t),delChatBox:t=>e.post("chatgpt/delChatBox",t),queryChatPreTypes:()=>e.get("chatgpt/queryChatPreTypes"),setChatPreType:t=>e.post("chatgpt/setChatPreType",t),delChatPreType:t=>e.post("chatgpt/delChatPreType",t),queryChatPres:()=>e.get("chatgpt/queryChatPres"),setChatPre:t=>e.post("chatgpt/setChatPre",t),delChatPre:t=>e.post("chatgpt/delChatPre",t)};export{p as A};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as k}from"./index-5e1cba81.js";import{a as f}from"./config-33902e1a.js";import{d as S,Q as P,r as q,B,x as N,o as j,c as A,e,f as t,a as y,k as E,b as h,E as v,h as a,q as g}from"./index-a4526b0d.js";const R={class:"flex justify-between"},M=y("b",null,"chevereto图床参数设置",-1),O=S({__name:"chevereto",setup(I){const l=P({cheveretoStatus:"",cheveretoUploadPath:"",cheveretoKey:""}),d=q();async function i(){const n=await f.queryConfig({keys:["cheveretoKey","cheveretoUploadPath","cheveretoStatus"]});Object.assign(l,n.data)}function b(){var n;(n=d.value)==null||n.validate(async o=>{if(o){try{await f.setConfig({settings:x(l)}),v.success("变更配置信息成功")}catch{}i()}else v.error("请填写完整信息")})}function x(n){return Object.keys(n).map(o=>({configKey:o,configVal:n[o]}))}const p=B(()=>[{required:Number(l.cheveretoStatus)===1,message:"开启配置后请填写此项",trigger:"change"}]);return N(()=>{i()}),(n,o)=>{const _=a("el-alert"),V=k,w=a("el-button"),U=a("el-switch"),s=a("el-form-item"),c=a("el-col"),u=a("el-row"),m=a("el-input"),C=a("el-form"),K=a("el-card");return j(),A("div",null,[e(V,null,{default:t(()=>[e(_,{closable:!1,"show-icon":"",title:"chevereto图床配置说明",description:"chevereto图床官方文档 https://v4-docs.chevereto.com/developer/api/api-v1.html 同时开启多个存储会以菜单排序优先级开启使用",type:"success"})]),_:1}),e(K,{style:{margin:"20px"}},{header:t(()=>[y("div",R,[M,e(w,{class:"button",text:"",onClick:b},{default:t(()=>[E(" 保存设置 ")]),_:1})])]),default:t(()=>[e(C,{ref_key:"formRef",ref:d,model:l,"label-width":"100px"},{default:t(()=>[e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"服务启用状态",prop:"cheveretoStatus"},{default:t(()=>[e(U,{modelValue:l.cheveretoStatus,"onUpdate:modelValue":o[0]||(o[0]=r=>l.cheveretoStatus=r),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"上传地址",prop:"cheveretoUploadPath",rules:h(p)},{default:t(()=>[e(m,{modelValue:l.cheveretoUploadPath,"onUpdate:modelValue":o[1]||(o[1]=r=>l.cheveretoUploadPath=r),placeholder:"请填写您的图床上传地址",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"ApiKey",prop:"cheveretoKey",rules:h(p)},{default:t(()=>[e(m,{modelValue:l.cheveretoKey,"onUpdate:modelValue":o[2]||(o[2]=r=>l.cheveretoKey=r),placeholder:"请填写ApiKey",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}});typeof g=="function"&&g(O);export{O as default}; import{_ as k}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as S,Q as P,r as q,B,x as N,o as j,c as A,e,f as t,a as y,k as E,b as h,E as v,h as a,q as g}from"./index-4eef28ae.js";const R={class:"flex justify-between"},M=y("b",null,"chevereto图床参数设置",-1),O=S({__name:"chevereto",setup(I){const l=P({cheveretoStatus:"",cheveretoUploadPath:"",cheveretoKey:""}),d=q();async function i(){const n=await f.queryConfig({keys:["cheveretoKey","cheveretoUploadPath","cheveretoStatus"]});Object.assign(l,n.data)}function b(){var n;(n=d.value)==null||n.validate(async o=>{if(o){try{await f.setConfig({settings:x(l)}),v.success("变更配置信息成功")}catch{}i()}else v.error("请填写完整信息")})}function x(n){return Object.keys(n).map(o=>({configKey:o,configVal:n[o]}))}const p=B(()=>[{required:Number(l.cheveretoStatus)===1,message:"开启配置后请填写此项",trigger:"change"}]);return N(()=>{i()}),(n,o)=>{const _=a("el-alert"),V=k,w=a("el-button"),U=a("el-switch"),s=a("el-form-item"),c=a("el-col"),u=a("el-row"),m=a("el-input"),C=a("el-form"),K=a("el-card");return j(),A("div",null,[e(V,null,{default:t(()=>[e(_,{closable:!1,"show-icon":"",title:"chevereto图床配置说明",description:"chevereto图床官方文档 https://v4-docs.chevereto.com/developer/api/api-v1.html 同时开启多个存储会以菜单排序优先级开启使用",type:"success"})]),_:1}),e(K,{style:{margin:"20px"}},{header:t(()=>[y("div",R,[M,e(w,{class:"button",text:"",onClick:b},{default:t(()=>[E(" 保存设置 ")]),_:1})])]),default:t(()=>[e(C,{ref_key:"formRef",ref:d,model:l,"label-width":"100px"},{default:t(()=>[e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"服务启用状态",prop:"cheveretoStatus"},{default:t(()=>[e(U,{modelValue:l.cheveretoStatus,"onUpdate:modelValue":o[0]||(o[0]=r=>l.cheveretoStatus=r),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"上传地址",prop:"cheveretoUploadPath",rules:h(p)},{default:t(()=>[e(m,{modelValue:l.cheveretoUploadPath,"onUpdate:modelValue":o[1]||(o[1]=r=>l.cheveretoUploadPath=r),placeholder:"请填写您的图床上传地址",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(c,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(s,{label:"ApiKey",prop:"cheveretoKey",rules:h(p)},{default:t(()=>[e(m,{modelValue:l.cheveretoKey,"onUpdate:modelValue":o[2]||(o[2]=r=>l.cheveretoKey=r),placeholder:"请填写ApiKey",clearable:""},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})])}}});typeof g=="function"&&g(O);export{O as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{Y as o}from"./index-a4526b0d.js";const g={queryAllConfig:()=>o.get("config/queryAll"),queryGptKeys:()=>o.get("config/queryGptKeys"),setGptKeys:t=>o.post("config/setGptKeys",t),queryConfig:t=>o.post("config/query",t),copyright:()=>o.get("config/copyright"),setConfig:t=>o.post("config/set",t)};export{g as a}; import{Y as o}from"./index-4eef28ae.js";const g={queryAllConfig:()=>o.get("config/queryAll"),queryGptKeys:()=>o.get("config/queryGptKeys"),setGptKeys:t=>o.post("config/setGptKeys",t),queryConfig:t=>o.post("config/query",t),copyright:()=>o.get("config/copyright"),setConfig:t=>o.post("config/set",t)};export{g as a};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as v}from"./index-5e1cba81.js";import{a as d}from"./config-33902e1a.js";import{d as T,Q as q,r as m,x as j,o as B,c as E,e,f as t,a as h,k as N,E as g,h as n,q as y}from"./index-a4526b0d.js";const M={class:"flex justify-between"},O=h("b",null,"底部版权设置",-1),R=T({__name:"copyright",setup(A){const r=q({copyrightTitle:"",copyrightUrl:""}),b=m({copyrightUrl:[{required:!0,trigger:"blur",message:"请填写底部版权文字内容"}],copyrightTitle:[{required:!0,trigger:"blur",message:"请填写点击底部版本跳转的地址"}]}),s=m();async function c(){const l=await d.queryConfig({keys:["copyrightUrl","copyrightTitle"]});Object.assign(r,l.data)}function x(){var l;(l=s.value)==null||l.validate(async o=>{if(o){try{await d.setConfig({settings:V(r)}),g.success("变更配置信息成功")}catch{}c()}else g.error("请填写完整信息")})}function V(l){return Object.keys(l).map(o=>({configKey:o,configVal:l[o]}))}return j(()=>{c()}),(l,o)=>{const i=n("el-alert"),U=v,w=n("el-button"),u=n("el-input"),p=n("el-form-item"),_=n("el-col"),f=n("el-row"),C=n("el-form"),k=n("el-card");return B(),E("div",null,[e(U,null,{default:t(()=>[e(i,{closable:!1,"show-icon":"",title:"底部版本参数说明",description:"当前版本的后台版权信息、文字用于展示、地址用于点击文字的跳转地址",type:"success"})]),_:1}),e(k,{style:{margin:"20px"}},{header:t(()=>[h("div",M,[O,e(w,{class:"button",text:"",onClick:x},{default:t(()=>[N(" 保存设置 ")]),_:1})])]),default:t(()=>[e(C,{ref_key:"formRef",ref:s,rules:b.value,model:r,"label-width":"130px"},{default:t(()=>[e(f,null,{default:t(()=>[e(_,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(p,{label:"底部版权文字",prop:"copyrightTitle"},{default:t(()=>[e(u,{modelValue:r.copyrightTitle,"onUpdate:modelValue":o[0]||(o[0]=a=>r.copyrightTitle=a),placeholder:"请填写底部版权文字内容",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(f,null,{default:t(()=>[e(_,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(p,{label:"底部跳转地址",prop:"copyrightUrl"},{default:t(()=>[e(u,{modelValue:r.copyrightUrl,"onUpdate:modelValue":o[1]||(o[1]=a=>r.copyrightUrl=a),placeholder:"请填写点击底部版本跳转的地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof y=="function"&&y(R);export{R as default}; import{_ as v}from"./index-7911c6db.js";import{a as d}from"./config-b4a9e7c0.js";import{d as T,Q as q,r as m,x as j,o as B,c as E,e,f as t,a as h,k as N,E as g,h as n,q as y}from"./index-4eef28ae.js";const M={class:"flex justify-between"},O=h("b",null,"底部版权设置",-1),R=T({__name:"copyright",setup(A){const r=q({copyrightTitle:"",copyrightUrl:""}),b=m({copyrightUrl:[{required:!0,trigger:"blur",message:"请填写底部版权文字内容"}],copyrightTitle:[{required:!0,trigger:"blur",message:"请填写点击底部版本跳转的地址"}]}),s=m();async function c(){const l=await d.queryConfig({keys:["copyrightUrl","copyrightTitle"]});Object.assign(r,l.data)}function x(){var l;(l=s.value)==null||l.validate(async o=>{if(o){try{await d.setConfig({settings:V(r)}),g.success("变更配置信息成功")}catch{}c()}else g.error("请填写完整信息")})}function V(l){return Object.keys(l).map(o=>({configKey:o,configVal:l[o]}))}return j(()=>{c()}),(l,o)=>{const i=n("el-alert"),U=v,w=n("el-button"),u=n("el-input"),p=n("el-form-item"),_=n("el-col"),f=n("el-row"),C=n("el-form"),k=n("el-card");return B(),E("div",null,[e(U,null,{default:t(()=>[e(i,{closable:!1,"show-icon":"",title:"底部版本参数说明",description:"当前版本的后台版权信息、文字用于展示、地址用于点击文字的跳转地址",type:"success"})]),_:1}),e(k,{style:{margin:"20px"}},{header:t(()=>[h("div",M,[O,e(w,{class:"button",text:"",onClick:x},{default:t(()=>[N(" 保存设置 ")]),_:1})])]),default:t(()=>[e(C,{ref_key:"formRef",ref:s,rules:b.value,model:r,"label-width":"130px"},{default:t(()=>[e(f,null,{default:t(()=>[e(_,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(p,{label:"底部版权文字",prop:"copyrightTitle"},{default:t(()=>[e(u,{modelValue:r.copyrightTitle,"onUpdate:modelValue":o[0]||(o[0]=a=>r.copyrightTitle=a),placeholder:"请填写底部版权文字内容",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(f,null,{default:t(()=>[e(_,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(p,{label:"底部跳转地址",prop:"copyrightUrl"},{default:t(()=>[e(u,{modelValue:r.copyrightUrl,"onUpdate:modelValue":o[1]||(o[1]=a=>r.copyrightUrl=a),placeholder:"请填写点击底部版本跳转的地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof y=="function"&&y(R);export{R as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as B}from"./index-5e1cba81.js";import{a as f}from"./config-33902e1a.js";import{d as w,Q as R,r as p,x as h,o as q,c as v,e,f as o,a as S,k as O,E as g,h as a,q as b}from"./index-a4526b0d.js";const U={class:"flex justify-between"},j=S("b",null,"COS参数设置",-1),E=w({__name:"cos",setup(N){const t=R({cosSecretId:"",cosSecretKey:"",cosBucket:"",cosRegion:""}),y=p({cosSecretKey:[{required:!0,trigger:"blur",message:"请填写SecretKey"}],cosBucket:[{required:!0,trigger:"blur",message:"请填写存储桶名称"}],cosRegion:[{required:!0,trigger:"blur",message:"请填写存储桶所属地域"}],cosSecretId:[{required:!0,trigger:"blur",message:"请填写SecretId"}]}),i=p();async function m(){const r=await f.queryConfig({keys:["cosSecretKey","cosBucket","cosRegion","cosSecretId"]});Object.assign(t,r.data)}function x(){var r;(r=i.value)==null||r.validate(async l=>{if(l){try{await f.setConfig({settings:V(t)}),g.success("变更配置信息成功")}catch{}m()}else g.error("请填写完整信息")})}function V(r){return Object.keys(r).map(l=>({configKey:l,configVal:r[l]}))}return h(()=>{m()}),(r,l)=>{const _=a("el-alert"),k=B,C=a("el-button"),c=a("el-input"),s=a("el-form-item"),u=a("el-col"),d=a("el-row"),I=a("el-form"),K=a("el-card");return q(),v("div",null,[e(k,null,{default:o(()=>[e(_,{closable:!1,"show-icon":"",title:"COS参数说明",description:"当前默认使用腾讯云COS对象存储、如果您有特殊的对接通道、将为您开放API对接",type:"success"})]),_:1}),e(K,{style:{margin:"20px"}},{header:o(()=>[S("div",U,[j,e(C,{class:"button",text:"",onClick:x},{default:o(()=>[O(" 保存设置 ")]),_:1})])]),default:o(()=>[e(I,{ref_key:"formRef",ref:i,rules:y.value,model:t,"label-width":"120px"},{default:o(()=>[e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"SecretId",prop:"cosSecretId"},{default:o(()=>[e(c,{modelValue:t.cosSecretId,"onUpdate:modelValue":l[0]||(l[0]=n=>t.cosSecretId=n),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"SecretKey",prop:"cosSecretKey"},{default:o(()=>[e(c,{modelValue:t.cosSecretKey,"onUpdate:modelValue":l[1]||(l[1]=n=>t.cosSecretKey=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"存储桶名称",prop:"cosBucket"},{default:o(()=>[e(c,{modelValue:t.cosBucket,"onUpdate:modelValue":l[2]||(l[2]=n=>t.cosBucket=n),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"所属地域",prop:"cosRegion"},{default:o(()=>[e(c,{modelValue:t.cosRegion,"onUpdate:modelValue":l[3]||(l[3]=n=>t.cosRegion=n),placeholder:"请填写所属地域(ap-guangzhou)",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof b=="function"&&b(E);export{E as default}; import{_ as B}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as w,Q as R,r as p,x as h,o as q,c as v,e,f as o,a as S,k as O,E as g,h as a,q as b}from"./index-4eef28ae.js";const U={class:"flex justify-between"},j=S("b",null,"COS参数设置",-1),E=w({__name:"cos",setup(N){const t=R({cosSecretId:"",cosSecretKey:"",cosBucket:"",cosRegion:""}),y=p({cosSecretKey:[{required:!0,trigger:"blur",message:"请填写SecretKey"}],cosBucket:[{required:!0,trigger:"blur",message:"请填写存储桶名称"}],cosRegion:[{required:!0,trigger:"blur",message:"请填写存储桶所属地域"}],cosSecretId:[{required:!0,trigger:"blur",message:"请填写SecretId"}]}),i=p();async function m(){const r=await f.queryConfig({keys:["cosSecretKey","cosBucket","cosRegion","cosSecretId"]});Object.assign(t,r.data)}function x(){var r;(r=i.value)==null||r.validate(async l=>{if(l){try{await f.setConfig({settings:V(t)}),g.success("变更配置信息成功")}catch{}m()}else g.error("请填写完整信息")})}function V(r){return Object.keys(r).map(l=>({configKey:l,configVal:r[l]}))}return h(()=>{m()}),(r,l)=>{const _=a("el-alert"),k=B,C=a("el-button"),c=a("el-input"),s=a("el-form-item"),u=a("el-col"),d=a("el-row"),I=a("el-form"),K=a("el-card");return q(),v("div",null,[e(k,null,{default:o(()=>[e(_,{closable:!1,"show-icon":"",title:"COS参数说明",description:"当前默认使用腾讯云COS对象存储、如果您有特殊的对接通道、将为您开放API对接",type:"success"})]),_:1}),e(K,{style:{margin:"20px"}},{header:o(()=>[S("div",U,[j,e(C,{class:"button",text:"",onClick:x},{default:o(()=>[O(" 保存设置 ")]),_:1})])]),default:o(()=>[e(I,{ref_key:"formRef",ref:i,rules:y.value,model:t,"label-width":"120px"},{default:o(()=>[e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"SecretId",prop:"cosSecretId"},{default:o(()=>[e(c,{modelValue:t.cosSecretId,"onUpdate:modelValue":l[0]||(l[0]=n=>t.cosSecretId=n),placeholder:"请填写SecretId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"SecretKey",prop:"cosSecretKey"},{default:o(()=>[e(c,{modelValue:t.cosSecretKey,"onUpdate:modelValue":l[1]||(l[1]=n=>t.cosSecretKey=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"存储桶名称",prop:"cosBucket"},{default:o(()=>[e(c,{modelValue:t.cosBucket,"onUpdate:modelValue":l[2]||(l[2]=n=>t.cosBucket=n),placeholder:"请填写存储桶名称",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(s,{label:"所属地域",prop:"cosRegion"},{default:o(()=>[e(c,{modelValue:t.cosRegion,"onUpdate:modelValue":l[3]||(l[3]=n=>t.cosRegion=n),placeholder:"请填写所属地域(ap-guangzhou)",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof b=="function"&&b(E);export{E as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as O}from"./index-5e1cba81.js";import{d as $,y as j,r,Q as P,B as Q,x as X,o as s,c as g,e as l,f as t,b as n,ap as S,j as I,R as W,S as x,k as m,w as G,I as p,U as H,W as J,E as R,h as i,X as Y,l as Z,t as ee,q as K}from"./index-a4526b0d.js";import{A as k}from"./badWords-db7a3b1d.js";import{E as te}from"./index-20fc3802.js";const le=$({__name:"custom",setup(oe){const N=j(),V=r(),T=r(0),f=r(!1),u=P({word:"",status:"",page:1,size:500}),U=Q(()=>N.settings.app.colorScheme),h=r([]);async function d(){try{f.value=!0;const a=await k.queryBadWords(u),{rows:o,count:v}=a.data;f.value=!1,T.value=v,h.value=o}catch{f.value=!1}}function A(a){a==null||a.resetFields(),d()}X(()=>{d()});const c=r(""),_=r(!1),B=r();async function D(a){await k.delBadWords({id:a}),R.success("删除敏感词成功"),await d()}function L(){_.value=!0,J(()=>{B.value.input.focus()})}async function C(){c.value&&(await k.addBadWords({word:c.value}),R.success("添加敏感词成功"),u.status="",await d()),_.value=!1,c.value=""}return(a,o)=>{const v=i("el-alert"),y=O,w=i("el-form-item"),q=i("el-option"),z=i("el-select"),b=i("el-button"),E=i("el-form"),M=i("el-tag"),F=Y("loading");return s(),g("div",null,[l(y,null,{default:t(()=>[l(v,{closable:!1,"show-icon":"",title:"敏感词说明",description:"当前为自定义敏感词、触发敏感词将自动拦截、如配置过三方平台、自定义检测将在三方平台通过后最后进行检测!",type:"success"})]),_:1}),l(y,null,{default:t(()=>[l(E,{ref_key:"formRef",ref:V,inline:!0,model:u},{default:t(()=>[l(w,{label:"敏感词",prop:"word"},{default:t(()=>[l(n(S),{modelValue:u.word,"onUpdate:modelValue":o[0]||(o[0]=e=>u.word=e),placeholder:"敏感词[模糊搜索]",onKeydown:I(Z(d,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1}),l(w,{label:"敏感词状态",prop:"status"},{default:t(()=>[l(z,{modelValue:u.status,"onUpdate:modelValue":o[1]||(o[1]=e=>u.status=e),placeholder:"请选择敏感词状态",clearable:""},{default:t(()=>[(s(!0),g(W,null,x(n(te),e=>(s(),p(q,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(w,null,{default:t(()=>[l(b,{type:"primary",onClick:d},{default:t(()=>[m(" 查询 ")]),_:1}),l(b,{onClick:o[2]||(o[2]=e=>A(n(V)))},{default:t(()=>[m(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),G((s(),p(y,{style:{width:"100%"}},{default:t(()=>[(s(!0),g(W,null,x(n(h),e=>(s(),p(M,{key:e.id,type:"warning",class:"mr-3 mb-3",closable:"",hit:"",effect:n(U),"disable-transitions":!0,onClose:ae=>D(e.id)},{default:t(()=>[m(ee(e.word),1)]),_:2},1032,["effect","onClose"]))),128)),n(_)?(s(),p(n(S),{key:0,ref_key:"InputRef",ref:B,modelValue:n(c),"onUpdate:modelValue":o[3]||(o[3]=e=>H(c)?c.value=e:null),class:"ml-1",style:{width:"80px"},size:"small",onKeyup:I(C,["enter"]),onBlur:C},null,8,["modelValue","onKeyup"])):(s(),p(b,{key:1,class:"ml-1",size:"small",onClick:L},{default:t(()=>[m(" + New Word ")]),_:1}))]),_:1})),[[F,n(f)]])])}}});typeof K=="function"&&K(le);export{le as default}; import{_ as O}from"./index-7911c6db.js";import{d as $,y as j,r,Q as P,B as Q,x as X,o as s,c as g,e as l,f as t,b as n,ap as S,j as I,R as W,S as x,k as m,w as G,I as p,U as H,W as J,E as R,h as i,X as Y,l as Z,t as ee,q as K}from"./index-4eef28ae.js";import{A as k}from"./badWords-bb34c9e2.js";import{E as te}from"./index-66a830a3.js";const le=$({__name:"custom",setup(oe){const N=j(),V=r(),T=r(0),f=r(!1),u=P({word:"",status:"",page:1,size:500}),U=Q(()=>N.settings.app.colorScheme),h=r([]);async function d(){try{f.value=!0;const a=await k.queryBadWords(u),{rows:o,count:v}=a.data;f.value=!1,T.value=v,h.value=o}catch{f.value=!1}}function A(a){a==null||a.resetFields(),d()}X(()=>{d()});const c=r(""),_=r(!1),B=r();async function D(a){await k.delBadWords({id:a}),R.success("删除敏感词成功"),await d()}function L(){_.value=!0,J(()=>{B.value.input.focus()})}async function C(){c.value&&(await k.addBadWords({word:c.value}),R.success("添加敏感词成功"),u.status="",await d()),_.value=!1,c.value=""}return(a,o)=>{const v=i("el-alert"),y=O,w=i("el-form-item"),q=i("el-option"),z=i("el-select"),b=i("el-button"),E=i("el-form"),M=i("el-tag"),F=Y("loading");return s(),g("div",null,[l(y,null,{default:t(()=>[l(v,{closable:!1,"show-icon":"",title:"敏感词说明",description:"当前为自定义敏感词、触发敏感词将自动拦截、如配置过三方平台、自定义检测将在三方平台通过后最后进行检测!",type:"success"})]),_:1}),l(y,null,{default:t(()=>[l(E,{ref_key:"formRef",ref:V,inline:!0,model:u},{default:t(()=>[l(w,{label:"敏感词",prop:"word"},{default:t(()=>[l(n(S),{modelValue:u.word,"onUpdate:modelValue":o[0]||(o[0]=e=>u.word=e),placeholder:"敏感词[模糊搜索]",onKeydown:I(Z(d,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1}),l(w,{label:"敏感词状态",prop:"status"},{default:t(()=>[l(z,{modelValue:u.status,"onUpdate:modelValue":o[1]||(o[1]=e=>u.status=e),placeholder:"请选择敏感词状态",clearable:""},{default:t(()=>[(s(!0),g(W,null,x(n(te),e=>(s(),p(q,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(w,null,{default:t(()=>[l(b,{type:"primary",onClick:d},{default:t(()=>[m(" 查询 ")]),_:1}),l(b,{onClick:o[2]||(o[2]=e=>A(n(V)))},{default:t(()=>[m(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),G((s(),p(y,{style:{width:"100%"}},{default:t(()=>[(s(!0),g(W,null,x(n(h),e=>(s(),p(M,{key:e.id,type:"warning",class:"mr-3 mb-3",closable:"",hit:"",effect:n(U),"disable-transitions":!0,onClose:ae=>D(e.id)},{default:t(()=>[m(ee(e.word),1)]),_:2},1032,["effect","onClose"]))),128)),n(_)?(s(),p(n(S),{key:0,ref_key:"InputRef",ref:B,modelValue:n(c),"onUpdate:modelValue":o[3]||(o[3]=e=>H(c)?c.value=e:null),class:"ml-1",style:{width:"80px"},size:"small",onKeyup:I(C,["enter"]),onBlur:C},null,8,["modelValue","onKeyup"])):(s(),p(b,{key:1,class:"ml-1",size:"small",onClick:L},{default:t(()=>[m(" + New Word ")]),_:1}))]),_:1})),[[F,n(f)]])])}}});typeof K=="function"&&K(le);export{le as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{Y as i}from"./index-a4526b0d.js";const s={getBaseInfo:t=>i.get("/statistic/base",{params:t}),getChatStatistic:t=>i.get("/statistic/chatStatistic",{params:t}),getBaiduVisit:t=>i.get("/statistic/baiduVisit",{params:t})};export{s as default}; import{Y as i}from"./index-4eef28ae.js";const s={getBaseInfo:t=>i.get("/statistic/base",{params:t}),getChatStatistic:t=>i.get("/statistic/chatStatistic",{params:t}),getBaiduVisit:t=>i.get("/statistic/baiduVisit",{params:t})};export{s as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as $}from"./index-5e1cba81.js";import{A as I}from"./chat-1da93106.js";import{d as J,r as i,Q,x as W,o as s,c,e as l,f as t,R as m,S as f,b as A,k as v,w as X,I as d,a as h,P as G,h as o,X as H,t as L,J as S,E as K,q as U}from"./index-a4526b0d.js";import{R as Y,D as Z}from"./index-20fc3802.js";const ee={class:"flex draw_container"},le={class:"draw_head"},ae={class:"draw_footer flex mt-3 justify-between items-center"},te=J({__name:"draw",setup(oe){const _=i(!1),D=i(),x=i(0),C=i([]),n=Q({userId:"",rec:"",model:"DALL-E2",page:1,size:14}),V=i([]);async function u(){_.value=!0;try{const r=await I.queryDrawAll(n),{rows:a,count:g}=r.data;_.value=!1,x.value=g,V.value=a}catch{_.value=!1}}async function M(r){const a=await I.recDrawImg({id:r});K.success(a.data),u()}async function R(r){const a=await G.queryAllUser({size:30,username:r});C.value=a.data.rows}function N(r){r==null||r.resetFields(),u()}return W(()=>{u()}),(r,a)=>{const g=o("el-alert"),y=$,w=o("el-option"),b=o("el-select"),p=o("el-form-item"),k=o("el-button"),P=o("el-form"),T=o("el-image"),j=o("el-tag"),q=o("Plus"),z=o("el-icon"),B=o("Minus"),E=o("el-pagination"),O=o("el-row"),F=H("loading");return s(),c("div",null,[l(y,null,{default:t(()=>[l(g,{closable:!1,"show-icon":"",title:"DALL-E绘画说明",description:"此处的midjourney模型选择是老版本的历史数据、新版迁移至新菜单分开",type:"success"})]),_:1}),l(y,null,{default:t(()=>[l(P,{ref_key:"formRef",ref:D,inline:!0,model:n},{default:t(()=>[l(p,{label:"用户名称",prop:"userId"},{default:t(()=>[l(b,{modelValue:n.userId,"onUpdate:modelValue":a[0]||(a[0]=e=>n.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"用户姓名[模糊搜索]","remote-show-suffix":"","remote-method":R},{default:t(()=>[(s(!0),c(m,null,f(C.value,e=>(s(),d(w,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,{label:"图片状态",prop:"rec"},{default:t(()=>[l(b,{modelValue:n.rec,"onUpdate:modelValue":a[1]||(a[1]=e=>n.rec=e),placeholder:"请选择图片状态",clearable:""},{default:t(()=>[(s(!0),c(m,null,f(A(Y),e=>(s(),d(w,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,{label:"绘画模型",prop:"model"},{default:t(()=>[l(b,{modelValue:n.model,"onUpdate:modelValue":a[2]||(a[2]=e=>n.model=e),placeholder:"请选择绘画模型",clearable:""},{default:t(()=>[(s(!0),c(m,null,f(A(Z),e=>(s(),d(w,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,null,{default:t(()=>[l(k,{type:"primary",onClick:u},{default:t(()=>[v(" 查询 ")]),_:1}),l(k,{onClick:a[3]||(a[3]=e=>N(D.value))},{default:t(()=>[v(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),X((s(),d(y,{style:{width:"100%"}},{default:t(()=>[h("div",ee,[(s(!0),c(m,null,f(V.value,e=>(s(),c("div",{key:e.id,style:{height:"280px"},class:"draw_img_container flex border"},[h("div",le,[l(T,{fit:"contain","preview-src-list":[e.answer],src:e.thumbImg,lazy:"",class:"draw_img","hide-on-click-modal":""},null,8,["preview-src-list","src"])]),h("div",ae,[l(j,{class:"ml-2",type:e.rec?"success":"info"},{default:t(()=>[v(L(e.rec?"已推荐":"未推荐"),1)]),_:2},1032,["type"]),l(k,{type:"warning",plain:"",size:"small",onClick:ne=>M(e.id)},{default:t(()=>[v(L(e.rec?"取消推荐":"加入推荐")+" ",1),e.rec?S("",!0):(s(),d(z,{key:0},{default:t(()=>[l(q)]),_:1})),e.rec?(s(),d(z,{key:1},{default:t(()=>[l(B)]),_:1})):S("",!0)]),_:2},1032,["onClick"])])]))),128))]),l(O,{class:"flex justify-end mt-5"},{default:t(()=>[l(E,{"current-page":n.page,"onUpdate:currentPage":a[4]||(a[4]=e=>n.page=e),"page-size":n.size,"onUpdate:pageSize":a[5]||(a[5]=e=>n.size=e),class:"mr-5","page-sizes":[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",total:x.value,onSizeChange:u,onCurrentChange:u},null,8,["current-page","page-size","total"])]),_:1})]),_:1})),[[F,_.value]])])}}});typeof U=="function"&&U(te);export{te as default}; import{_ as $}from"./index-7911c6db.js";import{A as I}from"./chat-8cf72149.js";import{d as J,r as i,Q,x as W,o as s,c,e as l,f as t,R as m,S as f,b as A,k as v,w as X,I as d,a as h,P as G,h as o,X as H,t as L,J as S,E as K,q as U}from"./index-4eef28ae.js";import{R as Y,D as Z}from"./index-66a830a3.js";const ee={class:"flex draw_container"},le={class:"draw_head"},ae={class:"draw_footer flex mt-3 justify-between items-center"},te=J({__name:"draw",setup(oe){const _=i(!1),D=i(),x=i(0),C=i([]),n=Q({userId:"",rec:"",model:"DALL-E2",page:1,size:14}),V=i([]);async function u(){_.value=!0;try{const r=await I.queryDrawAll(n),{rows:a,count:g}=r.data;_.value=!1,x.value=g,V.value=a}catch{_.value=!1}}async function M(r){const a=await I.recDrawImg({id:r});K.success(a.data),u()}async function R(r){const a=await G.queryAllUser({size:30,username:r});C.value=a.data.rows}function N(r){r==null||r.resetFields(),u()}return W(()=>{u()}),(r,a)=>{const g=o("el-alert"),y=$,w=o("el-option"),b=o("el-select"),p=o("el-form-item"),k=o("el-button"),P=o("el-form"),T=o("el-image"),j=o("el-tag"),q=o("Plus"),z=o("el-icon"),B=o("Minus"),E=o("el-pagination"),O=o("el-row"),F=H("loading");return s(),c("div",null,[l(y,null,{default:t(()=>[l(g,{closable:!1,"show-icon":"",title:"DALL-E绘画说明",description:"此处的midjourney模型选择是老版本的历史数据、新版迁移至新菜单分开",type:"success"})]),_:1}),l(y,null,{default:t(()=>[l(P,{ref_key:"formRef",ref:D,inline:!0,model:n},{default:t(()=>[l(p,{label:"用户名称",prop:"userId"},{default:t(()=>[l(b,{modelValue:n.userId,"onUpdate:modelValue":a[0]||(a[0]=e=>n.userId=e),filterable:"",clearable:"",remote:"","reserve-keyword":"",placeholder:"用户姓名[模糊搜索]","remote-show-suffix":"","remote-method":R},{default:t(()=>[(s(!0),c(m,null,f(C.value,e=>(s(),d(w,{key:e.id,label:e.username,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,{label:"图片状态",prop:"rec"},{default:t(()=>[l(b,{modelValue:n.rec,"onUpdate:modelValue":a[1]||(a[1]=e=>n.rec=e),placeholder:"请选择图片状态",clearable:""},{default:t(()=>[(s(!0),c(m,null,f(A(Y),e=>(s(),d(w,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,{label:"绘画模型",prop:"model"},{default:t(()=>[l(b,{modelValue:n.model,"onUpdate:modelValue":a[2]||(a[2]=e=>n.model=e),placeholder:"请选择绘画模型",clearable:""},{default:t(()=>[(s(!0),c(m,null,f(A(Z),e=>(s(),d(w,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,null,{default:t(()=>[l(k,{type:"primary",onClick:u},{default:t(()=>[v(" 查询 ")]),_:1}),l(k,{onClick:a[3]||(a[3]=e=>N(D.value))},{default:t(()=>[v(" 重置 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),X((s(),d(y,{style:{width:"100%"}},{default:t(()=>[h("div",ee,[(s(!0),c(m,null,f(V.value,e=>(s(),c("div",{key:e.id,style:{height:"280px"},class:"draw_img_container flex border"},[h("div",le,[l(T,{fit:"contain","preview-src-list":[e.answer],src:e.thumbImg,lazy:"",class:"draw_img","hide-on-click-modal":""},null,8,["preview-src-list","src"])]),h("div",ae,[l(j,{class:"ml-2",type:e.rec?"success":"info"},{default:t(()=>[v(L(e.rec?"已推荐":"未推荐"),1)]),_:2},1032,["type"]),l(k,{type:"warning",plain:"",size:"small",onClick:ne=>M(e.id)},{default:t(()=>[v(L(e.rec?"取消推荐":"加入推荐")+" ",1),e.rec?S("",!0):(s(),d(z,{key:0},{default:t(()=>[l(q)]),_:1})),e.rec?(s(),d(z,{key:1},{default:t(()=>[l(B)]),_:1})):S("",!0)]),_:2},1032,["onClick"])])]))),128))]),l(O,{class:"flex justify-end mt-5"},{default:t(()=>[l(E,{"current-page":n.page,"onUpdate:currentPage":a[4]||(a[4]=e=>n.page=e),"page-size":n.size,"onUpdate:pageSize":a[5]||(a[5]=e=>n.size=e),class:"mr-5","page-sizes":[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",total:x.value,onSizeChange:u,onCurrentChange:u},null,8,["current-page","page-size","total"])]),_:1})]),_:1})),[[F,_.value]])])}}});typeof U=="function"&&U(te);export{te as default};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as _,r as m,x as N,F as R,o as w,c as f,N as b,G as T,b as s,n as k,O as M,a as y,t as x,J as z,k as E,u as A,e,f as n,P as F,E as I,h as u,g as L,m as D,q as V}from"./index-a4526b0d.js";import{_ as G}from"./index-5e1cba81.js";const J=_({name:"FixedActionBar"}),O=_({...J,setup(i){const a=m(!1);N(()=>{l(),window.addEventListener("scroll",l)}),R(()=>{window.removeEventListener("scroll",l)});function l(){const r=document.documentElement.scrollTop||document.body.scrollTop,d=document.documentElement.clientHeight||document.body.clientHeight,o=document.documentElement.scrollHeight||document.body.scrollHeight;a.value=Math.ceil(r+d)>=o}return(r,d)=>(w(),f("div",{class:T(["actionbar",{shadow:!s(a)}]),"data-fixed-calc-width":""},[b(r.$slots,"default",{},void 0,!0)],2))}});const j=k(O,[["__scopeId","data-v-63511cc5"]]),K={class:"header"},Q={class:"main"},W={class:"title"},X={class:"content"},Y={key:0,class:"sub"},Z=_({name:"PageHeader"}),ee=_({...Z,props:{title:{type:String,required:!0},content:{type:String,default:""}},setup(i){const a=M();return(l,r)=>(w(),f("div",K,[y("div",Q,[y("div",W,x(i.title),1),y("div",X,[b(l.$slots,"content",{},()=>[E(x(i.content),1)],!0)])]),s(a).default?(w(),f("div",Y,[b(l.$slots,"default",{},void 0,!0)])):z("",!0)]))}});const oe=k(ee,[["__scopeId","data-v-24ce26ee"]]),te=_({name:"PersonalEditPassword"}),se=_({...te,setup(i){const a=L(),l=D(),r=A(),d=m(),o=m({password:"",newpassword:"",checkpassword:""}),S=m({password:[{required:!0,message:"请输入原密码",trigger:"blur"}],newpassword:[{required:!0,message:"请输入新密码",trigger:"blur"},{min:6,max:18,trigger:"blur",message:"密码长度为6到18位"}],checkpassword:[{required:!0,message:"请输入新密码",trigger:"blur"},{validator:(g,t,c)=>{t!==o.value.newpassword?c(new Error("两次密码不一致!")):c()}}]});function $(){d.value&&d.value.validate(g=>{if(g){const{password:t,newpassword:c}=o.value;F.updatePassword({oldPassword:t,password:c}).then(()=>{I({type:"success",message:"修改密码成功,请重新登录"}),r.logout().then(()=>{l.push({name:"login",query:{redirect:a.fullPath}})})})}})}return(g,t)=>{const c=oe,h=u("el-input"),v=u("el-form-item"),H=u("el-form"),P=u("el-col"),q=u("el-row"),C=G,U=u("el-button"),B=j;return w(),f("div",null,[e(c,{title:"修改密码",content:"定期修改密码可以提高帐号安全性噢~"}),e(C,null,{default:n(()=>[e(q,null,{default:n(()=>[e(P,{md:24,lg:12},{default:n(()=>[e(H,{ref_key:"formRef",ref:d,model:s(o),rules:s(S),"label-width":"120px"},{default:n(()=>[e(v,{label:"原密码",prop:"password"},{default:n(()=>[e(h,{modelValue:s(o).password,"onUpdate:modelValue":t[0]||(t[0]=p=>s(o).password=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1}),e(v,{label:"新密码",prop:"newpassword"},{default:n(()=>[e(h,{modelValue:s(o).newpassword,"onUpdate:modelValue":t[1]||(t[1]=p=>s(o).newpassword=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1}),e(v,{label:"确认新密码",prop:"checkpassword"},{default:n(()=>[e(h,{modelValue:s(o).checkpassword,"onUpdate:modelValue":t[2]||(t[2]=p=>s(o).checkpassword=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})]),_:1}),e(B,null,{default:n(()=>[e(U,{type:"primary",size:"large",onClick:$},{default:n(()=>[E(" 提交 ")]),_:1})]),_:1})])}}});typeof V=="function"&&V(se);export{se as default}; import{d as _,r as m,x as N,F as R,o as w,c as f,N as b,G as T,b as s,n as k,O as M,a as y,t as x,J as z,k as E,u as A,e,f as n,P as F,E as I,h as u,g as L,m as D,q as V}from"./index-4eef28ae.js";import{_ as G}from"./index-7911c6db.js";const J=_({name:"FixedActionBar"}),O=_({...J,setup(i){const a=m(!1);N(()=>{l(),window.addEventListener("scroll",l)}),R(()=>{window.removeEventListener("scroll",l)});function l(){const r=document.documentElement.scrollTop||document.body.scrollTop,d=document.documentElement.clientHeight||document.body.clientHeight,o=document.documentElement.scrollHeight||document.body.scrollHeight;a.value=Math.ceil(r+d)>=o}return(r,d)=>(w(),f("div",{class:T(["actionbar",{shadow:!s(a)}]),"data-fixed-calc-width":""},[b(r.$slots,"default",{},void 0,!0)],2))}});const j=k(O,[["__scopeId","data-v-63511cc5"]]),K={class:"header"},Q={class:"main"},W={class:"title"},X={class:"content"},Y={key:0,class:"sub"},Z=_({name:"PageHeader"}),ee=_({...Z,props:{title:{type:String,required:!0},content:{type:String,default:""}},setup(i){const a=M();return(l,r)=>(w(),f("div",K,[y("div",Q,[y("div",W,x(i.title),1),y("div",X,[b(l.$slots,"content",{},()=>[E(x(i.content),1)],!0)])]),s(a).default?(w(),f("div",Y,[b(l.$slots,"default",{},void 0,!0)])):z("",!0)]))}});const oe=k(ee,[["__scopeId","data-v-24ce26ee"]]),te=_({name:"PersonalEditPassword"}),se=_({...te,setup(i){const a=L(),l=D(),r=A(),d=m(),o=m({password:"",newpassword:"",checkpassword:""}),S=m({password:[{required:!0,message:"请输入原密码",trigger:"blur"}],newpassword:[{required:!0,message:"请输入新密码",trigger:"blur"},{min:6,max:18,trigger:"blur",message:"密码长度为6到18位"}],checkpassword:[{required:!0,message:"请输入新密码",trigger:"blur"},{validator:(g,t,c)=>{t!==o.value.newpassword?c(new Error("两次密码不一致!")):c()}}]});function $(){d.value&&d.value.validate(g=>{if(g){const{password:t,newpassword:c}=o.value;F.updatePassword({oldPassword:t,password:c}).then(()=>{I({type:"success",message:"修改密码成功,请重新登录"}),r.logout().then(()=>{l.push({name:"login",query:{redirect:a.fullPath}})})})}})}return(g,t)=>{const c=oe,h=u("el-input"),v=u("el-form-item"),H=u("el-form"),P=u("el-col"),q=u("el-row"),C=G,U=u("el-button"),B=j;return w(),f("div",null,[e(c,{title:"修改密码",content:"定期修改密码可以提高帐号安全性噢~"}),e(C,null,{default:n(()=>[e(q,null,{default:n(()=>[e(P,{md:24,lg:12},{default:n(()=>[e(H,{ref_key:"formRef",ref:d,model:s(o),rules:s(S),"label-width":"120px"},{default:n(()=>[e(v,{label:"原密码",prop:"password"},{default:n(()=>[e(h,{modelValue:s(o).password,"onUpdate:modelValue":t[0]||(t[0]=p=>s(o).password=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1}),e(v,{label:"新密码",prop:"newpassword"},{default:n(()=>[e(h,{modelValue:s(o).newpassword,"onUpdate:modelValue":t[1]||(t[1]=p=>s(o).newpassword=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1}),e(v,{label:"确认新密码",prop:"checkpassword"},{default:n(()=>[e(h,{modelValue:s(o).checkpassword,"onUpdate:modelValue":t[2]||(t[2]=p=>s(o).checkpassword=p),type:"password",placeholder:"请输入原密码","show-password":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})]),_:1}),e(B,null,{default:n(()=>[e(U,{type:"primary",size:"large",onClick:$},{default:n(()=>[E(" 提交 ")]),_:1})]),_:1})])}}});typeof V=="function"&&V(se);export{se as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as v}from"./index-5e1cba81.js";import{a as _}from"./config-33902e1a.js";import{d as V,Q as q,r as i,x as j,o as B,c as E,e,f as o,a as f,k as N,E as m,h as s,q as u}from"./index-a4526b0d.js";const A={class:"flex justify-between"},O=f("b",null,"模型系统消息预设",-1),R=V({__name:"globalPre",setup(U){const l=q({systemPreMessage:""}),p=i({systemPreMessage:[{required:!0,trigger:"blur",message:"请填写全局预设信息、用于模型预设词"}]}),a=i();async function r(){const t=await _.queryConfig({keys:["systemPreMessage"]});Object.assign(l,t.data)}function d(){var t;(t=a.value)==null||t.validate(async n=>{if(n){try{await _.setConfig({settings:g(l)}),m.success("变更配置信息成功")}catch{}r()}else m.error("请填写完整信息")})}function g(t){return Object.keys(t).map(n=>({configKey:n,configVal:t[n]}))}return j(()=>{r()}),(t,n)=>{const c=s("el-alert"),y=v,b=s("el-button"),x=s("el-input"),h=s("el-form-item"),w=s("el-col"),P=s("el-row"),C=s("el-form"),M=s("el-card");return B(),E("div",null,[e(y,null,{default:o(()=>[e(c,{closable:!1,"show-icon":"",title:"模型全局头部预设说明",description:"当前消息将会被追加到对话模型的全局预设当中、对应用APP无效、对其他所有绘画生效",type:"success"})]),_:1}),e(M,{style:{margin:"20px"}},{header:o(()=>[f("div",A,[O,e(b,{class:"button",text:"",onClick:d},{default:o(()=>[N(" 保存设置 ")]),_:1})])]),default:o(()=>[e(C,{ref_key:"formRef",ref:a,rules:p.value,model:l,"label-width":"140px"},{default:o(()=>[e(P,null,{default:o(()=>[e(w,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(h,{label:"模型全局头部预设",prop:"systemPreMessage"},{default:o(()=>[e(x,{modelValue:l.systemPreMessage,"onUpdate:modelValue":n[0]||(n[0]=k=>l.systemPreMessage=k),type:"textarea",rows:5,placeholder:"请填写模型全局头部预设信息!",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof u=="function"&&u(R);export{R as default}; import{_ as v}from"./index-7911c6db.js";import{a as _}from"./config-b4a9e7c0.js";import{d as V,Q as q,r as i,x as j,o as B,c as E,e,f as o,a as f,k as N,E as m,h as s,q as u}from"./index-4eef28ae.js";const A={class:"flex justify-between"},O=f("b",null,"模型系统消息预设",-1),R=V({__name:"globalPre",setup(U){const l=q({systemPreMessage:""}),p=i({systemPreMessage:[{required:!0,trigger:"blur",message:"请填写全局预设信息、用于模型预设词"}]}),a=i();async function r(){const t=await _.queryConfig({keys:["systemPreMessage"]});Object.assign(l,t.data)}function d(){var t;(t=a.value)==null||t.validate(async n=>{if(n){try{await _.setConfig({settings:g(l)}),m.success("变更配置信息成功")}catch{}r()}else m.error("请填写完整信息")})}function g(t){return Object.keys(t).map(n=>({configKey:n,configVal:t[n]}))}return j(()=>{r()}),(t,n)=>{const c=s("el-alert"),y=v,b=s("el-button"),x=s("el-input"),h=s("el-form-item"),w=s("el-col"),P=s("el-row"),C=s("el-form"),M=s("el-card");return B(),E("div",null,[e(y,null,{default:o(()=>[e(c,{closable:!1,"show-icon":"",title:"模型全局头部预设说明",description:"当前消息将会被追加到对话模型的全局预设当中、对应用APP无效、对其他所有绘画生效",type:"success"})]),_:1}),e(M,{style:{margin:"20px"}},{header:o(()=>[f("div",A,[O,e(b,{class:"button",text:"",onClick:d},{default:o(()=>[N(" 保存设置 ")]),_:1})])]),default:o(()=>[e(C,{ref_key:"formRef",ref:a,rules:p.value,model:l,"label-width":"140px"},{default:o(()=>[e(P,null,{default:o(()=>[e(w,{xs:24,md:20,lg:15,xl:12},{default:o(()=>[e(h,{label:"模型全局头部预设",prop:"systemPreMessage"},{default:o(()=>[e(x,{modelValue:l.systemPreMessage,"onUpdate:modelValue":n[0]||(n[0]=k=>l.systemPreMessage=k),type:"textarea",rows:5,placeholder:"请填写模型全局头部预设信息!",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof u=="function"&&u(R);export{R as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as h}from"./index-5e1cba81.js";import{a as f}from"./config-33902e1a.js";import{d as I,Q as q,r as y,x as C,o as N,c as k,e,f as l,a as H,k as G,E as _,h as u,q as g}from"./index-a4526b0d.js";const R={class:"flex justify-between"},j=H("b",null,"虎皮椒支付参数设置",-1),B=I({__name:"hupijiao",setup(E){const t=q({payHupiStatus:"",payHupiAppId:"",payHupiSecret:"",payHupiGatewayUrl:"",payHupiNotifyUrl:"",payHupiReturnUrl:""}),b=y({payHupiStatus:[{required:!0,trigger:"change",message:"请选择当前支付开启状态"}],payHupiSecret:[{required:!0,trigger:"blur",message:"请填写支付秘钥"}],payHupiGatewayUrl:[{required:!0,trigger:"blur",message:"请填写网关"}],payHupiAppId:[{required:!0,trigger:"blur",message:"请填写Appid"}],payHupiNotifyUrl:[{required:!0,trigger:"blur",message:"请填写支付通知地址"}]}),d=y();async function c(){const o=await f.queryConfig({keys:["payHupiSecret","payHupiNotifyUrl","payHupiGatewayUrl","payHupiReturnUrl","payHupiAppId","payHupiStatus"]});Object.assign(t,o.data)}function x(){var o;(o=d.value)==null||o.validate(async a=>{if(a){try{await f.setConfig({settings:U(t)}),_.success("变更配置信息成功")}catch{}c()}else _.error("请填写完整信息")})}function U(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return C(()=>{c()}),(o,a)=>{const m=u("el-alert"),V=h,w=u("el-button"),S=u("el-switch"),r=u("el-form-item"),n=u("el-col"),i=u("el-row"),s=u("el-input"),v=u("el-form"),A=u("el-card");return N(),k("div",null,[e(V,null,{default:l(()=>[e(m,{closable:!1,"show-icon":"",title:"虎皮椒支付参数说明",description:"虎皮椒支付为三方支付、接入请购买微信渠道、详细参数参照 https://www.xunhupay.com/ 目前优先开通微信支付渠道、同时开启开启多种支付、我们将优先按照菜单顺序调用、所有的支付通知地址统一为 https://域名/api/pay/notify 将域名修改为您的域名即可!",type:"success"})]),_:1}),e(A,{style:{margin:"20px"}},{header:l(()=>[H("div",R,[j,e(w,{class:"button",text:"",onClick:x},{default:l(()=>[G(" 保存设置 ")]),_:1})])]),default:l(()=>[e(v,{ref_key:"formRef",ref:d,rules:b.value,model:t,"label-width":"120px"},{default:l(()=>[e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"启用当前支付",prop:"payHupiAppId"},{default:l(()=>[e(S,{modelValue:t.payHupiStatus,"onUpdate:modelValue":a[0]||(a[0]=p=>t.payHupiStatus=p),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付AppId",prop:"payHupiAppId"},{default:l(()=>[e(s,{modelValue:t.payHupiAppId,"onUpdate:modelValue":a[1]||(a[1]=p=>t.payHupiAppId=p),placeholder:"请填写AppId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付网关地址",prop:"payHupiGatewayUrl"},{default:l(()=>[e(s,{modelValue:t.payHupiGatewayUrl,"onUpdate:modelValue":a[2]||(a[2]=p=>t.payHupiGatewayUrl=p),placeholder:"请填写支付网关地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"Secret秘钥",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiSecret,"onUpdate:modelValue":a[3]||(a[3]=p=>t.payHupiSecret=p),placeholder:"请填写支付秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付通知地址",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiNotifyUrl,"onUpdate:modelValue":a[4]||(a[4]=p=>t.payHupiNotifyUrl=p),placeholder:"请填写支付通知地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付回调地址",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiReturnUrl,"onUpdate:modelValue":a[5]||(a[5]=p=>t.payHupiReturnUrl=p),placeholder:"请填写支付成功后的回跳地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(B);export{B as default}; import{_ as h}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as I,Q as q,r as y,x as C,o as N,c as k,e,f as l,a as H,k as G,E as _,h as u,q as g}from"./index-4eef28ae.js";const R={class:"flex justify-between"},j=H("b",null,"虎皮椒支付参数设置",-1),B=I({__name:"hupijiao",setup(E){const t=q({payHupiStatus:"",payHupiAppId:"",payHupiSecret:"",payHupiGatewayUrl:"",payHupiNotifyUrl:"",payHupiReturnUrl:""}),b=y({payHupiStatus:[{required:!0,trigger:"change",message:"请选择当前支付开启状态"}],payHupiSecret:[{required:!0,trigger:"blur",message:"请填写支付秘钥"}],payHupiGatewayUrl:[{required:!0,trigger:"blur",message:"请填写网关"}],payHupiAppId:[{required:!0,trigger:"blur",message:"请填写Appid"}],payHupiNotifyUrl:[{required:!0,trigger:"blur",message:"请填写支付通知地址"}]}),d=y();async function c(){const o=await f.queryConfig({keys:["payHupiSecret","payHupiNotifyUrl","payHupiGatewayUrl","payHupiReturnUrl","payHupiAppId","payHupiStatus"]});Object.assign(t,o.data)}function x(){var o;(o=d.value)==null||o.validate(async a=>{if(a){try{await f.setConfig({settings:U(t)}),_.success("变更配置信息成功")}catch{}c()}else _.error("请填写完整信息")})}function U(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return C(()=>{c()}),(o,a)=>{const m=u("el-alert"),V=h,w=u("el-button"),S=u("el-switch"),r=u("el-form-item"),n=u("el-col"),i=u("el-row"),s=u("el-input"),v=u("el-form"),A=u("el-card");return N(),k("div",null,[e(V,null,{default:l(()=>[e(m,{closable:!1,"show-icon":"",title:"虎皮椒支付参数说明",description:"虎皮椒支付为三方支付、接入请购买微信渠道、详细参数参照 https://www.xunhupay.com/ 目前优先开通微信支付渠道、同时开启开启多种支付、我们将优先按照菜单顺序调用、所有的支付通知地址统一为 https://域名/api/pay/notify 将域名修改为您的域名即可!",type:"success"})]),_:1}),e(A,{style:{margin:"20px"}},{header:l(()=>[H("div",R,[j,e(w,{class:"button",text:"",onClick:x},{default:l(()=>[G(" 保存设置 ")]),_:1})])]),default:l(()=>[e(v,{ref_key:"formRef",ref:d,rules:b.value,model:t,"label-width":"120px"},{default:l(()=>[e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"启用当前支付",prop:"payHupiAppId"},{default:l(()=>[e(S,{modelValue:t.payHupiStatus,"onUpdate:modelValue":a[0]||(a[0]=p=>t.payHupiStatus=p),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付AppId",prop:"payHupiAppId"},{default:l(()=>[e(s,{modelValue:t.payHupiAppId,"onUpdate:modelValue":a[1]||(a[1]=p=>t.payHupiAppId=p),placeholder:"请填写AppId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付网关地址",prop:"payHupiGatewayUrl"},{default:l(()=>[e(s,{modelValue:t.payHupiGatewayUrl,"onUpdate:modelValue":a[2]||(a[2]=p=>t.payHupiGatewayUrl=p),placeholder:"请填写支付网关地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"Secret秘钥",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiSecret,"onUpdate:modelValue":a[3]||(a[3]=p=>t.payHupiSecret=p),placeholder:"请填写支付秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付通知地址",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiNotifyUrl,"onUpdate:modelValue":a[4]||(a[4]=p=>t.payHupiNotifyUrl=p),placeholder:"请填写支付通知地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"支付回调地址",prop:"payHupiSecret"},{default:l(()=>[e(s,{modelValue:t.payHupiReturnUrl,"onUpdate:modelValue":a[5]||(a[5]=p=>t.payHupiReturnUrl=p),placeholder:"请填写支付成功后的回跳地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(B);export{B as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{s as S,t as r,v as s,L as P,r as q,p as i,a as u,b as c,E as p}from"./notice-03602d5e.js";import"./index-5e1cba81.js";import"./index-a4526b0d.js";import"./config-33902e1a.js";const R=1,g=33,$=34,b=35,m=36,v=new p(O=>{let e=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>e&&O.acceptToken(R)});function n(O,e,a){return new p(t=>{let Q=t.pos;for(;t.next!=O&&t.next>=0&&(a||t.next!=38&&(t.next!=123||t.peek(1)!=123));)t.advance();t.pos>Q&&t.acceptToken(e)})}const x=n(39,g,!1),W=n(34,$,!1),d=n(39,b,!0),C=n(34,m,!0),T=c.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<<GrOOQO<<Gr<<GrOOQO1G/[1G/[OOOS-E6x-E6xOOQO1G.}1G.}OOOQ-E6y-E6yOOQOAN=^AN=^",stateData:"&d~OvOS~OPROSQOVROWRO~OZTO[XO^VOaUOhWO~OR]OU^O~O[`O^aO~O[bO~O[cO~O[dO~ObeO~ObfO~ObgO~ORhO~O]kOwiO~O[lO~O_mO~OynOzoO~OysOztO~O[uO~O]wOwiO~O_yOwiO~OtzO~Os|O~OSQOV!OOW!OOr!OOy!QO~OSQOV!ROW!ROq!ROz!QO~O_!TOwiO~O]!UO~Oy!VO~Oz!VO~OSQOV!OOW!OOr!OOy!XO~OSQOV!ROW!ROq!ROz!XO~O]!ZO~O",goto:"#dyPPPPPzPPPP!WPPPPP!WPP!Z!^!a!d!dP!g!j!m!p!v#Q#WPPPPPPPP#^SROSS!Os!PT!Rt!SRYPRqeR{nR}oRZPRqfR[PRqgQSOR_SQj`SvjxRxlQ!PsR!W!PQ!StR!Y!SQpeRrf",nodeNames:"⚠ Text Content }} {{ Interpolation InterpolationContent Entity InvalidEntity Attribute BoundAttributeName [ Identifier ] ( ) ReferenceName # Is ExpressionAttributeValue AttributeInterpolation AttributeInterpolation EventName DirectiveName * StatementAttributeValue AttributeName AttributeValue",maxTerm:42,nodeProps:[["openedBy",3,"{{",15,"("],["closedBy",4,"}}",14,")"]],skippedNodes:[0],repeatNodeCount:4,tokenData:"0r~RyOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mqr#rrs%jst&Qtv#rvw&hwx)zxy*byz*xz{+`{}#r}!O+v!O!P-]!P!Q#r!Q![+v![!]+v!]!_#r!_!`-s!`!c#r!c!}+v!}#O.Z#O#P#r#P#Q.q#Q#R#r#R#S+v#S#T#r#T#o+v#o#p/X#p#q#r#q#r0Z#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vQ#wTUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rQ$ZSO#q#r#r;'S#r;'S;=`$g<%lO#rQ$jP;=`<%l#rR$t[UQvPOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mq#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR%qTyPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&XTaPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&oXUQWPOp'[pq#rq!]'[!]!^#r!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R'aXUQOp'[pq#rq!]'[!]!^'|!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R(TTVPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR(gXOp'[pq#rq!]'[!]!^'|!^#q'[#q#r)S#r;'S'[;'S;=`)t<%lO'[P)VUOp)Sq!])S!]!^)i!^;'S)S;'S;=`)n<%lO)SP)nOVPP)qP;=`<%l)SR)wP;=`<%l'[R*RTzPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR*iT^PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+PT_PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+gThPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+}b[PUQO}#r}!O+v!O!Q#r!Q![+v![!]+v!]!c#r!c!}+v!}#R#r#R#S+v#S#T#r#T#o+v#o#q#r#q#r$W#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vR-YP;=`<%l+vR-dTwPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR-zTUQbPO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.bTZPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.xT]PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/^VUQO#o#r#o#p/s#p#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/zTSPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#r~0^TO#q#r#q#r0m#r;'S#r;'S;=`$g<%lO#r~0rOR~",tokenizers:[v,x,W,d,C,0,1],topRules:{Content:[0,2],Attribute:[1,9]},tokenPrec:0}),f=s.parser.configure({top:"SingleExpression"}),l=T.configure({props:[S({Text:r.content,Is:r.definitionOperator,AttributeName:r.attributeName,"AttributeValue ExpressionAttributeValue StatementAttributeValue":r.attributeValue,Entity:r.character,InvalidEntity:r.invalid,"BoundAttributeName/Identifier":r.attributeName,"EventName/Identifier":r.special(r.attributeName),"ReferenceName/Identifier":r.variableName,"DirectiveName/Identifier":r.keyword,"{{ }}":r.brace,"( )":r.paren,"[ ]":r.bracket,"# '*'":r.punctuation})]}),o={parser:f},V={parser:s.parser},A=l.configure({wrap:i((O,e)=>O.name=="InterpolationContent"?o:null)}),U=l.configure({wrap:i((O,e)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?V:o}),top:"Attribute"}),w={parser:A},y={parser:U},E=P.define({name:"angular",parser:q.parser.configure({wrap:i(N)}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function N(O,e){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(e.read(O.from,O.to))?y:null;case"Text":return w}return null}function Z(){return new u(E)}export{Z as angular,E as angularLanguage}; import{s as S,t as r,v as s,L as P,r as q,p as i,a as u,b as c,E as p}from"./notice-a7476b53.js";import"./index-7911c6db.js";import"./index-4eef28ae.js";import"./config-b4a9e7c0.js";const R=1,g=33,$=34,b=35,m=36,v=new p(O=>{let e=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>e&&O.acceptToken(R)});function n(O,e,a){return new p(t=>{let Q=t.pos;for(;t.next!=O&&t.next>=0&&(a||t.next!=38&&(t.next!=123||t.peek(1)!=123));)t.advance();t.pos>Q&&t.acceptToken(e)})}const x=n(39,g,!1),W=n(34,$,!1),d=n(39,b,!0),C=n(34,m,!0),T=c.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<<GrOOQO<<Gr<<GrOOQO1G/[1G/[OOOS-E6x-E6xOOQO1G.}1G.}OOOQ-E6y-E6yOOQOAN=^AN=^",stateData:"&d~OvOS~OPROSQOVROWRO~OZTO[XO^VOaUOhWO~OR]OU^O~O[`O^aO~O[bO~O[cO~O[dO~ObeO~ObfO~ObgO~ORhO~O]kOwiO~O[lO~O_mO~OynOzoO~OysOztO~O[uO~O]wOwiO~O_yOwiO~OtzO~Os|O~OSQOV!OOW!OOr!OOy!QO~OSQOV!ROW!ROq!ROz!QO~O_!TOwiO~O]!UO~Oy!VO~Oz!VO~OSQOV!OOW!OOr!OOy!XO~OSQOV!ROW!ROq!ROz!XO~O]!ZO~O",goto:"#dyPPPPPzPPPP!WPPPPP!WPP!Z!^!a!d!dP!g!j!m!p!v#Q#WPPPPPPPP#^SROSS!Os!PT!Rt!SRYPRqeR{nR}oRZPRqfR[PRqgQSOR_SQj`SvjxRxlQ!PsR!W!PQ!StR!Y!SQpeRrf",nodeNames:"⚠ Text Content }} {{ Interpolation InterpolationContent Entity InvalidEntity Attribute BoundAttributeName [ Identifier ] ( ) ReferenceName # Is ExpressionAttributeValue AttributeInterpolation AttributeInterpolation EventName DirectiveName * StatementAttributeValue AttributeName AttributeValue",maxTerm:42,nodeProps:[["openedBy",3,"{{",15,"("],["closedBy",4,"}}",14,")"]],skippedNodes:[0],repeatNodeCount:4,tokenData:"0r~RyOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mqr#rrs%jst&Qtv#rvw&hwx)zxy*byz*xz{+`{}#r}!O+v!O!P-]!P!Q#r!Q![+v![!]+v!]!_#r!_!`-s!`!c#r!c!}+v!}#O.Z#O#P#r#P#Q.q#Q#R#r#R#S+v#S#T#r#T#o+v#o#p/X#p#q#r#q#r0Z#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vQ#wTUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rQ$ZSO#q#r#r;'S#r;'S;=`$g<%lO#rQ$jP;=`<%l#rR$t[UQvPOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mq#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR%qTyPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&XTaPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&oXUQWPOp'[pq#rq!]'[!]!^#r!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R'aXUQOp'[pq#rq!]'[!]!^'|!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R(TTVPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR(gXOp'[pq#rq!]'[!]!^'|!^#q'[#q#r)S#r;'S'[;'S;=`)t<%lO'[P)VUOp)Sq!])S!]!^)i!^;'S)S;'S;=`)n<%lO)SP)nOVPP)qP;=`<%l)SR)wP;=`<%l'[R*RTzPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR*iT^PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+PT_PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+gThPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+}b[PUQO}#r}!O+v!O!Q#r!Q![+v![!]+v!]!c#r!c!}+v!}#R#r#R#S+v#S#T#r#T#o+v#o#q#r#q#r$W#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vR-YP;=`<%l+vR-dTwPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR-zTUQbPO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.bTZPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.xT]PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/^VUQO#o#r#o#p/s#p#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/zTSPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#r~0^TO#q#r#q#r0m#r;'S#r;'S;=`$g<%lO#r~0rOR~",tokenizers:[v,x,W,d,C,0,1],topRules:{Content:[0,2],Attribute:[1,9]},tokenPrec:0}),f=s.parser.configure({top:"SingleExpression"}),l=T.configure({props:[S({Text:r.content,Is:r.definitionOperator,AttributeName:r.attributeName,"AttributeValue ExpressionAttributeValue StatementAttributeValue":r.attributeValue,Entity:r.character,InvalidEntity:r.invalid,"BoundAttributeName/Identifier":r.attributeName,"EventName/Identifier":r.special(r.attributeName),"ReferenceName/Identifier":r.variableName,"DirectiveName/Identifier":r.keyword,"{{ }}":r.brace,"( )":r.paren,"[ ]":r.bracket,"# '*'":r.punctuation})]}),o={parser:f},V={parser:s.parser},A=l.configure({wrap:i((O,e)=>O.name=="InterpolationContent"?o:null)}),U=l.configure({wrap:i((O,e)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?V:o}),top:"Attribute"}),w={parser:A},y={parser:U},E=P.define({name:"angular",parser:q.parser.configure({wrap:i(N)}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function N(O,e){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(e.read(O.from,O.to))?y:null;case"Text":return w}return null}function Z(){return new u(E)}export{Z as angular,E as angularLanguage};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as D}from"./index-5e1cba81.js";import{a as c}from"./config-33902e1a.js";import{d as q,Q as v,r as _,x as U,o as w,c as k,e,f as l,a as g,k as z,E as j,h as d,q as I}from"./index-a4526b0d.js";const S={class:"flex justify-between"},G=g("b",null,"MJ参数设置",-1),R=q({__name:"index",setup(N){const t=v({mjId:"",mjApplicationId:"",mjGuildId:"",mjChannelId:"",mjSessionId:"",mjVersion:"",mjAuthorization:"",mjRateLimit:""}),b=_({mjApplicationId:[{required:!0,trigger:"blur",message:"请填写应用ID"}],mjGuildId:[{required:!0,trigger:"blur",message:"请填写工会ID"}],mjChannelId:[{required:!0,trigger:"blur",message:"请填写通道ID"}],mjSessionId:[{required:!0,trigger:"blur",message:"请填写绘画ID"}],mjVersion:[{required:!0,trigger:"blur",message:"请填写版本ID"}],mjId:[{required:!0,trigger:"blur",message:"请填写基础ID"}],mjAuthorization:[{required:!0,trigger:"blur",message:"请填写授权令牌"}]}),s=_();async function p(){const n=await c.queryConfig({keys:["mjApplicationId","mjGuildId","mjChannelId","mjId","mjSessionId","mjVersion","mjAuthorization","mjRateLimit"]});Object.assign(t,n.data)}function V(){var n;(n=s.value)==null||n.validate(async o=>{if(o){try{await c.setConfig({settings:x(t)}),j.success("变更配置信息成功")}catch{}p()}else j.error("请填写完整信息")})}function x(n){return Object.keys(n).map(o=>({configKey:o,configVal:n[o]}))}return U(()=>{p()}),(n,o)=>{const f=d("el-alert"),h=D,C=d("el-button"),r=d("el-input"),u=d("el-form-item"),m=d("el-col"),i=d("el-row"),A=d("el-form"),y=d("el-card");return w(),k("div",null,[e(h,null,{default:l(()=>[e(f,{closable:!1,"show-icon":"",title:"MJ参数说明",description:"详细配置请参考说明文档、当前暂未开放卡池、单个账号并发默认为三、如果您是更高的等级账号请在.env文件下添加 CONCURRENCY=3 此环境变量修改并发数、我们会为您默认开启队列、人数超过限制将需要进行排队!",type:"success"})]),_:1}),e(y,{style:{margin:"20px"}},{header:l(()=>[g("div",S,[G,e(C,{class:"button",text:"",onClick:V},{default:l(()=>[z(" 保存设置 ")]),_:1})])]),default:l(()=>[e(A,{ref_key:"formRef",ref:s,rules:b.value,model:t,"label-width":"130px"},{default:l(()=>[e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"id",prop:"mjId"},{default:l(()=>[e(r,{modelValue:t.mjId,"onUpdate:modelValue":o[0]||(o[0]=a=>t.mjId=a),placeholder:"请填写ID信息",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"guildId",prop:"mjGuildId"},{default:l(()=>[e(r,{modelValue:t.mjGuildId,"onUpdate:modelValue":o[1]||(o[1]=a=>t.mjGuildId=a),placeholder:"请填写工会ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"channelId",prop:"mjChannelId"},{default:l(()=>[e(r,{modelValue:t.mjChannelId,"onUpdate:modelValue":o[2]||(o[2]=a=>t.mjChannelId=a),placeholder:"请填写通道ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"sessionId",prop:"mjSessionId"},{default:l(()=>[e(r,{modelValue:t.mjSessionId,"onUpdate:modelValue":o[3]||(o[3]=a=>t.mjSessionId=a),placeholder:"请填写会话ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"version",prop:"mjVersion"},{default:l(()=>[e(r,{modelValue:t.mjVersion,"onUpdate:modelValue":o[4]||(o[4]=a=>t.mjVersion=a),placeholder:"请填写版本信息",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"authorization",prop:"mjAuthorization"},{default:l(()=>[e(r,{modelValue:t.mjAuthorization,"onUpdate:modelValue":o[5]||(o[5]=a=>t.mjAuthorization=a),placeholder:"请填写授权令牌",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"applicationId",prop:"mjApplicationId"},{default:l(()=>[e(r,{modelValue:t.mjApplicationId,"onUpdate:modelValue":o[6]||(o[6]=a=>t.mjApplicationId=a),placeholder:"请填写应用程序ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof I=="function"&&I(R);export{R as default}; import{_ as D}from"./index-7911c6db.js";import{a as c}from"./config-b4a9e7c0.js";import{d as q,Q as v,r as _,x as U,o as w,c as k,e,f as l,a as g,k as z,E as j,h as d,q as I}from"./index-4eef28ae.js";const S={class:"flex justify-between"},G=g("b",null,"MJ参数设置",-1),R=q({__name:"index",setup(N){const t=v({mjId:"",mjApplicationId:"",mjGuildId:"",mjChannelId:"",mjSessionId:"",mjVersion:"",mjAuthorization:"",mjRateLimit:""}),b=_({mjApplicationId:[{required:!0,trigger:"blur",message:"请填写应用ID"}],mjGuildId:[{required:!0,trigger:"blur",message:"请填写工会ID"}],mjChannelId:[{required:!0,trigger:"blur",message:"请填写通道ID"}],mjSessionId:[{required:!0,trigger:"blur",message:"请填写绘画ID"}],mjVersion:[{required:!0,trigger:"blur",message:"请填写版本ID"}],mjId:[{required:!0,trigger:"blur",message:"请填写基础ID"}],mjAuthorization:[{required:!0,trigger:"blur",message:"请填写授权令牌"}]}),s=_();async function p(){const n=await c.queryConfig({keys:["mjApplicationId","mjGuildId","mjChannelId","mjId","mjSessionId","mjVersion","mjAuthorization","mjRateLimit"]});Object.assign(t,n.data)}function V(){var n;(n=s.value)==null||n.validate(async o=>{if(o){try{await c.setConfig({settings:x(t)}),j.success("变更配置信息成功")}catch{}p()}else j.error("请填写完整信息")})}function x(n){return Object.keys(n).map(o=>({configKey:o,configVal:n[o]}))}return U(()=>{p()}),(n,o)=>{const f=d("el-alert"),h=D,C=d("el-button"),r=d("el-input"),u=d("el-form-item"),m=d("el-col"),i=d("el-row"),A=d("el-form"),y=d("el-card");return w(),k("div",null,[e(h,null,{default:l(()=>[e(f,{closable:!1,"show-icon":"",title:"MJ参数说明",description:"详细配置请参考说明文档、当前暂未开放卡池、单个账号并发默认为三、如果您是更高的等级账号请在.env文件下添加 CONCURRENCY=3 此环境变量修改并发数、我们会为您默认开启队列、人数超过限制将需要进行排队!",type:"success"})]),_:1}),e(y,{style:{margin:"20px"}},{header:l(()=>[g("div",S,[G,e(C,{class:"button",text:"",onClick:V},{default:l(()=>[z(" 保存设置 ")]),_:1})])]),default:l(()=>[e(A,{ref_key:"formRef",ref:s,rules:b.value,model:t,"label-width":"130px"},{default:l(()=>[e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"id",prop:"mjId"},{default:l(()=>[e(r,{modelValue:t.mjId,"onUpdate:modelValue":o[0]||(o[0]=a=>t.mjId=a),placeholder:"请填写ID信息",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"guildId",prop:"mjGuildId"},{default:l(()=>[e(r,{modelValue:t.mjGuildId,"onUpdate:modelValue":o[1]||(o[1]=a=>t.mjGuildId=a),placeholder:"请填写工会ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"channelId",prop:"mjChannelId"},{default:l(()=>[e(r,{modelValue:t.mjChannelId,"onUpdate:modelValue":o[2]||(o[2]=a=>t.mjChannelId=a),placeholder:"请填写通道ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"sessionId",prop:"mjSessionId"},{default:l(()=>[e(r,{modelValue:t.mjSessionId,"onUpdate:modelValue":o[3]||(o[3]=a=>t.mjSessionId=a),placeholder:"请填写会话ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"version",prop:"mjVersion"},{default:l(()=>[e(r,{modelValue:t.mjVersion,"onUpdate:modelValue":o[4]||(o[4]=a=>t.mjVersion=a),placeholder:"请填写版本信息",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"authorization",prop:"mjAuthorization"},{default:l(()=>[e(r,{modelValue:t.mjAuthorization,"onUpdate:modelValue":o[5]||(o[5]=a=>t.mjAuthorization=a),placeholder:"请填写授权令牌",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(i,null,{default:l(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"applicationId",prop:"mjApplicationId"},{default:l(()=>[e(r,{modelValue:t.mjApplicationId,"onUpdate:modelValue":o[6]||(o[6]=a=>t.mjApplicationId=a),placeholder:"请填写应用程序ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof I=="function"&&I(R);export{R as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
.title[data-v-3c2d5fb6]{position:fixed;z-index:1000;top:0;width:inherit;padding:0 10px;display:flex;align-items:center;justify-content:center;height:var(--g-sidebar-logo-height);text-align:center;overflow:hidden;text-decoration:none}.title.is-link[data-v-3c2d5fb6]{cursor:pointer}.title .logo[data-v-3c2d5fb6]{width:30px;height:30px;-o-object-fit:contain;object-fit:contain}.title .logo+span[data-v-3c2d5fb6]{margin-left:10px}.title span[data-v-3c2d5fb6]{display:block;font-weight:700;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .title[data-v-574cceb4]{position:fixed;z-index:1000;top:0;width:inherit;padding:0 10px;display:flex;align-items:center;justify-content:center;height:var(--g-sidebar-logo-height);text-align:center;overflow:hidden;text-decoration:none}.title.is-link[data-v-574cceb4]{cursor:pointer}.title .logo[data-v-574cceb4]{width:30px;height:30px;-o-object-fit:contain;object-fit:contain}.title .logo+span[data-v-574cceb4]{margin-left:10px}.title span[data-v-574cceb4]{display:block;font-weight:700;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

File diff suppressed because one or more lines are too long

View File

@ -1,9 +0,0 @@
/**
* Fantastic-admin 提供技术支持
* Powered by Fantastic-admin
* Gitee https://gitee.com/hooray/fantastic-admin
* Github https://github.com/hooray/fantastic-admin
*/
const l=[{value:0,label:"待激活"},{value:1,label:"正常"},{value:2,label:"已封禁"},{value:3,label:"黑名单"}],a={0:"待激活",1:"正常",2:"已封禁",3:"黑名单"},e={0:"info",1:"success",2:"danger",3:"danger"},t={1:"注册赠送",2:"受邀请赠送",3:"邀请人赠送",4:"购买套餐赠送",5:"管理员赠送",6:"扫码支付",7:"绘画失败退款",8:"签到奖励"},u=[{value:1,label:"注册赠送"},{value:2,label:"受邀请赠送"},{value:3,label:"邀请人赠送"},{value:4,label:"购买套餐赠送"},{value:5,label:"管理员赠送"},{value:6,label:"扫码支付"},{value:7,label:"绘画失败退款"},{value:8,label:"签到奖励"}],s={0:"关闭",1:"开启"},b={0:"danger",1:"success"},T=[{value:0,label:"禁用"},{value:1,label:"启动"}],_=[{value:0,label:"未使用"},{value:1,label:"已使用"}],o=[{value:0,label:"未推荐"},{value:1,label:"已推荐"}],v=[{value:0,label:"禁用"},{value:1,label:"启用"},{value:3,label:"待审核"},{value:4,label:"拒绝共享"},{value:5,label:"通过共享"}],n=[{value:"0",label:"未启用"},{value:"1",label:"已启用"}],S=[{value:0,label:"待审核"},{value:1,label:"已通过"},{value:-1,label:"已拒绝"}],c=[{value:0,label:"未推荐"},{value:1,label:"已推荐"}],E=[{value:1,label:"支付宝"},{value:2,label:"微信"}],A=[{value:1,label:"正在排队"},{value:2,label:"正在绘制"},{value:3,label:"绘制完成"},{value:4,label:"绘制失败"},{value:5,label:"绘制超时"}],p={0:"danger",1:"success"},P={"-1":"欠费锁定",0:"未启用",1:"已启用",3:"待审核",4:"拒绝共享",5:"通过共享"},I=["gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k","gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-all","gpt-4-0125-preview","claude-2.0","claude-2.1","gemini-pro","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","qwen-turbo","qwen-plus","qwen-max","qwen-max-lingcontext","hunyuan","chatglm_turbo","chatglm_pro","chatglm_std","chatglm_lite","360GPT_S2_V9","SparkDesk"],O=[{value:"mj",label:"MidjourneyAi"},{value:"DALL-E2",label:"DALL-E"}],g=[{value:0,label:"未支付"},{value:1,label:"已支付"},{value:2,label:"支付失败"},{value:3,label:"支付超时"}],i={0:"未支付",1:"已支付",2:"支付失败",3:"支付超时"},r=[{value:"epay",label:"易支付"},{value:"hupi",label:"虎皮椒"},{value:"wechat",label:"微信支付"},{value:"mpay",label:"码支付"}],N={epay:"易支付",hupi:"虎皮椒",wechat:"微信支付",mpay:"码支付"},R=[{value:1,label:"等待中"},{value:2,label:"绘制中"},{value:3,label:"绘制完成"},{value:4,label:"绘制失败"},{value:5,label:"绘制超时"}],L=[{value:"system",label:"系统"},{value:"user",label:"用户"}],M={1:"排队中",2:"绘制中",3:"绘制完成",4:"绘制失败",5:"绘制超时"},m=[{value:"百度云检测",label:"百度云检测"},{value:"自定义检测",label:"自定义检测"},{value:"NineAI检测",label:"NineAI检测"}],h=[{value:1,label:"OpenAi - [chatGpt]"},{value:2,label:"百度 - [千帆大模型]"},{value:3,label:"清华 - [智谱大模型]"}],U={1:"OPENAI",2:"百度文心",3:"清华智谱"},D={1:["gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k","gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-all","gpt-4-0125-preview","claude-2.0","claude-2.1","gemini-pro","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","qwen-turbo","qwen-plus","qwen-max","qwen-max-lingcontext","hunyuan","chatglm_turbo","chatglm_pro","chatglm_std","chatglm_lite","360GPT_S2_V9","SparkDesk"],2:["ERNIE-Bot","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","BLOOMZ-7B","Llama-2-7b-chat","Llama-2-13b-chat","Qianfan-BLOOMZ-7B-compressed","Qianfan-Chinese-Llama-2-7B","AquilaChat-7B"],3:["chatglm_pro","chatglm_std","chatglm_lite","chatglm_lite_32k"]},B=[{value:1,label:"普通余额"},{value:2,label:"高级余额"}],d={1:"APIKey",2:"client_id",3:"AppKey"};export{L as A,_ as C,O as D,v as E,b as I,I as M,S as O,r as P,P as Q,o as R,m as T,e as U,A as W,R as a,n as b,p as c,c as d,M as e,D as f,d as g,h,U as i,B as j,g as k,N as l,i as m,T as n,s as o,E as p,a as q,l as r,u as s,t};

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{s,t as r,b as n,L as o,i as P,c as a,f as Q,k as i,a as p}from"./notice-03602d5e.js";import"./index-5e1cba81.js";import"./index-a4526b0d.js";import"./config-33902e1a.js";const c=s({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=n.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[c],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),h=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=u(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function u(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const m=o.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),Q.add({"Object Array":i})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function k(){return new p(m)}export{k as json,m as jsonLanguage,h as jsonParseLinter}; import{s,t as r,b as n,L as o,i as P,c as a,f as Q,k as i,a as p}from"./notice-a7476b53.js";import"./index-7911c6db.js";import"./index-4eef28ae.js";import"./config-b4a9e7c0.js";const c=s({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,",":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),g=n.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[c],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),h=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=u(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function u(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const m=o.define({name:"json",parser:g.configure({props:[P.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),Q.add({"Object Array":i})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function k(){return new p(m)}export{k as json,m as jsonLanguage,h as jsonParseLinter};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as c,r as d,y as g,x as h,o as a,c as n,b as s,t as u,J as l,p as y,i as f,a as r,g as m,n as S}from"./index-a4526b0d.js";import{a as x}from"./config-33902e1a.js";const i=e=>(y("data-v-183a3e32"),e=e(),f(),e),C={class:"copyright"},v=i(()=>r("span",null,"Copyright",-1)),k=i(()=>r("span",{class:"icon"},"©",-1)),I=["href"],b=c({name:"Copyright"}),B=c({...b,setup(e){const t=d({copyrightTitle:"NineAi Admin",copyrightUrl:"/"});async function _(){const o=await x.copyright();o.success&&(t.value=o.data)}m();const p=g();return h(()=>{_()}),(o,N)=>(a(),n("footer",C,[v,k,s(p).settings.copyright.beian?(a(),n("a",{key:0,href:s(t).copyrightUrl,target:"_blank",rel:"noopener"},u(s(t).copyrightTitle),9,I)):l("",!0)]))}});const T=S(B,[["__scopeId","data-v-183a3e32"]]);export{T as _}; import{d as c,r as d,y as g,x as h,o as a,c as n,b as s,t as u,J as l,p as y,i as f,a as r,g as m,n as S}from"./index-4eef28ae.js";import{a as x}from"./config-b4a9e7c0.js";const i=e=>(y("data-v-183a3e32"),e=e(),f(),e),C={class:"copyright"},v=i(()=>r("span",null,"Copyright",-1)),k=i(()=>r("span",{class:"icon"},"©",-1)),I=["href"],b=c({name:"Copyright"}),B=c({...b,setup(e){const t=d({copyrightTitle:"NineAi Admin",copyrightUrl:"/"});async function _(){const o=await x.copyright();o.success&&(t.value=o.data)}m();const p=g();return h(()=>{_()}),(o,N)=>(a(),n("footer",C,[v,k,s(p).settings.copyright.beian?(a(),n("a",{key:0,href:s(t).copyrightUrl,target:"_blank",rel:"noopener"},u(s(t).copyrightTitle),9,I)):l("",!0)]))}});const T=S(B,[["__scopeId","data-v-183a3e32"]]);export{T as _};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{L as o,i as r,j as O,f as t,k as n,s as a,t as e,a as s,b as Q}from"./notice-03602d5e.js";import"./index-5e1cba81.js";import"./index-a4526b0d.js";import"./config-33902e1a.js";const $={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},i=Q.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"/Q~R^XY}YZ}]^}pq}rs!Stu!qxy&Vyz'S{|'X}!O'X!Q!R'b!R![)_!]!^,{#T#o-^~!SO_~~!VTOr!Srs!fs#O!S#O#P!k#P~!S~!kOZ~~!nPO~!S~!tiqr$cst$ctu$cuv$cvw$cwx$cz{$c{|$c}!O$c!O!P$c!P!Q$c!Q![$c![!]$c!^!_$c!_!`$c!`!a$c!a!b$c!b!c$c!c!}$c#Q#R$c#R#S$c#S#T$c#T#o$c#p#q$c#r#s$c~$hiV~qr$cst$ctu$cuv$cvw$cwx$cz{$c{|$c}!O$c!O!P$c!P!Q$c!Q![$c![!]$c!^!_$c!_!`$c!`!a$c!a!b$c!b!c$c!c!}$c#Q#R$c#R#S$c#S#T$c#T#o$c#p#q$c#r#s$c~&[PT~!]!^&_~&bRO!]&_!]!^&k!^~&_~&nTOy&_yz&}z!]&_!]!^&k!^~&_~'SOQ~~'XOS~~'[Q!Q!R'b!R![)_~'gUY~!O!P'y!Q![)_!g!h(j#R#S)s#X#Y(j#l#m)y~(ORY~!Q![(X!g!h(j#X#Y(j~(^SY~!Q![(X!g!h(j#R#S)X#X#Y(j~(mR{|(v}!O(v!Q![(|~(yP!Q![(|~)RQY~!Q![(|#R#S(v~)[P!Q![(X~)dTY~!O!P'y!Q![)_!g!h(j#R#S)s#X#Y(j~)vP!Q![)_~)|R!Q![*V!c!i*V#T#Z*V~*[VY~!O!P*q!Q![*V!c!i*V!r!s+n#R#S)y#T#Z*V#d#e+n~*vTY~!Q![+V!c!i+V!r!s+n#T#Z+V#d#e+n~+[UY~!Q![+V!c!i+V!r!s+n#R#S,o#T#Z+V#d#e+n~+qT{|,Q}!O,Q!Q![,^!c!i,^#T#Z,^~,TR!Q![,^!c!i,^#T#Z,^~,cSY~!Q![,^!c!i,^#R#S,Q#T#Z,^~,rR!Q![+V!c!i+V#T#Z+V~-OP!]!^-R~-WQP~OY-RZ~-R~-ciX~qr-^st-^tu-^uv-^vw-^wx-^z{-^{|-^}!O-^!O!P-^!P!Q-^!Q![-^![!]-^!^!_-^!_!`-^!`!a-^!a!b-^!b!c-^!c!}-^#Q#R-^#R#S-^#S#T-^#T#o-^#p#q-^#r#s-^",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:c=>$[c]||-1}],tokenPrec:0}),P=o.define({name:"wast",parser:i.configure({props:[r.add({App:O({closing:")",align:!1})}),t.add({App:n,BlockComment(c){return{from:c.from+2,to:c.to-2}}}),a({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function S(){return new s(P)}export{S as wast,P as wastLanguage}; import{L as o,i as r,j as O,f as t,k as n,s as a,t as e,a as s,b as Q}from"./notice-a7476b53.js";import"./index-7911c6db.js";import"./index-4eef28ae.js";import"./config-b4a9e7c0.js";const $={__proto__:null,anyref:34,dataref:34,eqref:34,externref:34,i31ref:34,funcref:34,i8:34,i16:34,i32:34,i64:34,f32:34,f64:34},i=Q.deserialize({version:14,states:"!^Q]QPOOOqQPO'#CbOOQO'#Cd'#CdOOQO'#Cl'#ClOOQO'#Ch'#ChQ]QPOOOOQO,58|,58|OxQPO,58|OOQO-E6f-E6fOOQO1G.h1G.h",stateData:"!P~O_OSPOSQOS~OTPOVROXROYROZROaQO~OSUO~P]OSXO~P]O",goto:"xaPPPPPPbPbPPPhPPPrXROPTVQTOQVPTWTVXSOPTV",nodeNames:"⚠ LineComment BlockComment Module ) ( App Identifier Type Keyword Number String",maxTerm:17,nodeProps:[["openedBy",4,"("],["closedBy",5,")"],["group",-6,6,7,8,9,10,11,"Expression"]],skippedNodes:[0,1,2],repeatNodeCount:1,tokenData:"/Q~R^XY}YZ}]^}pq}rs!Stu!qxy&Vyz'S{|'X}!O'X!Q!R'b!R![)_!]!^,{#T#o-^~!SO_~~!VTOr!Srs!fs#O!S#O#P!k#P~!S~!kOZ~~!nPO~!S~!tiqr$cst$ctu$cuv$cvw$cwx$cz{$c{|$c}!O$c!O!P$c!P!Q$c!Q![$c![!]$c!^!_$c!_!`$c!`!a$c!a!b$c!b!c$c!c!}$c#Q#R$c#R#S$c#S#T$c#T#o$c#p#q$c#r#s$c~$hiV~qr$cst$ctu$cuv$cvw$cwx$cz{$c{|$c}!O$c!O!P$c!P!Q$c!Q![$c![!]$c!^!_$c!_!`$c!`!a$c!a!b$c!b!c$c!c!}$c#Q#R$c#R#S$c#S#T$c#T#o$c#p#q$c#r#s$c~&[PT~!]!^&_~&bRO!]&_!]!^&k!^~&_~&nTOy&_yz&}z!]&_!]!^&k!^~&_~'SOQ~~'XOS~~'[Q!Q!R'b!R![)_~'gUY~!O!P'y!Q![)_!g!h(j#R#S)s#X#Y(j#l#m)y~(ORY~!Q![(X!g!h(j#X#Y(j~(^SY~!Q![(X!g!h(j#R#S)X#X#Y(j~(mR{|(v}!O(v!Q![(|~(yP!Q![(|~)RQY~!Q![(|#R#S(v~)[P!Q![(X~)dTY~!O!P'y!Q![)_!g!h(j#R#S)s#X#Y(j~)vP!Q![)_~)|R!Q![*V!c!i*V#T#Z*V~*[VY~!O!P*q!Q![*V!c!i*V!r!s+n#R#S)y#T#Z*V#d#e+n~*vTY~!Q![+V!c!i+V!r!s+n#T#Z+V#d#e+n~+[UY~!Q![+V!c!i+V!r!s+n#R#S,o#T#Z+V#d#e+n~+qT{|,Q}!O,Q!Q![,^!c!i,^#T#Z,^~,TR!Q![,^!c!i,^#T#Z,^~,cSY~!Q![,^!c!i,^#R#S,Q#T#Z,^~,rR!Q![+V!c!i+V#T#Z+V~-OP!]!^-R~-WQP~OY-RZ~-R~-ciX~qr-^st-^tu-^uv-^vw-^wx-^z{-^{|-^}!O-^!O!P-^!P!Q-^!Q![-^![!]-^!^!_-^!_!`-^!`!a-^!a!b-^!b!c-^!c!}-^#Q#R-^#R#S-^#S#T-^#T#o-^#p#q-^#r#s-^",tokenizers:[0],topRules:{Module:[0,3]},specialized:[{term:9,get:c=>$[c]||-1}],tokenPrec:0}),P=o.define({name:"wast",parser:i.configure({props:[r.add({App:O({closing:")",align:!1})}),t.add({App:n,BlockComment(c){return{from:c.from+2,to:c.to-2}}}),a({Keyword:e.keyword,Type:e.typeName,Number:e.number,String:e.string,Identifier:e.variableName,LineComment:e.lineComment,BlockComment:e.blockComment,"( )":e.paren})]}),languageData:{commentTokens:{line:";;",block:{open:"(;",close:";)"}},closeBrackets:{brackets:["(",'"']}}});function S(){return new s(P)}export{S as wast,P as wastLanguage};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{s as i,t as O,L as s,r as p,p as a,a as u,b as l,u as e,v as m}from"./notice-03602d5e.js";import"./index-5e1cba81.js";import"./index-a4526b0d.js";import"./config-33902e1a.js";const S=l.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new e("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new e("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new e("[~RPwxU~ZOp~~",11,15),new e("[~RPrsU~ZOn~~",11,14),new e("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new e("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),c=m.parser.configure({top:"SingleExpression"}),n=S.configure({props:[i({Text:O.content,Is:O.definitionOperator,AttributeName:O.attributeName,VueAttributeName:O.keyword,Identifier:O.variableName,"AttributeValue ScriptAttributeValue":O.attributeValue,Entity:O.character,"{{ }}":O.brace,"@ :":O.punctuation})]}),o={parser:c},b=n.configure({wrap:a((t,r)=>t.name=="InterpolationContent"?o:null)}),P=n.configure({wrap:a((t,r)=>t.name=="AttributeScript"?o:null),top:"Attribute"}),Q={parser:b},y={parser:P},R=s.define({name:"vue",parser:p.parser.configure({dialect:"selfClosing",wrap:a(X)}),languageData:{closeBrackets:{brackets:["{",'"']}}});function X(t,r){switch(t.name){case"Attribute":return/^(@|:|v-)/.test(r.read(t.from,t.from+2))?y:null;case"Text":return Q}return null}function x(){return new u(R)}export{x as vue,R as vueLanguage}; import{s as i,t as O,L as s,r as p,p as a,a as u,b as l,u as e,v as m}from"./notice-a7476b53.js";import"./index-7911c6db.js";import"./index-4eef28ae.js";import"./config-b4a9e7c0.js";const S=l.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new e("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new e("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new e("[~RPwxU~ZOp~~",11,15),new e("[~RPrsU~ZOn~~",11,14),new e("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new e("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),c=m.parser.configure({top:"SingleExpression"}),n=S.configure({props:[i({Text:O.content,Is:O.definitionOperator,AttributeName:O.attributeName,VueAttributeName:O.keyword,Identifier:O.variableName,"AttributeValue ScriptAttributeValue":O.attributeValue,Entity:O.character,"{{ }}":O.brace,"@ :":O.punctuation})]}),o={parser:c},b=n.configure({wrap:a((t,r)=>t.name=="InterpolationContent"?o:null)}),P=n.configure({wrap:a((t,r)=>t.name=="AttributeScript"?o:null),top:"Attribute"}),Q={parser:b},y={parser:P},R=s.define({name:"vue",parser:p.parser.configure({dialect:"selfClosing",wrap:a(X)}),languageData:{closeBrackets:{brackets:["{",'"']}}});function X(t,r){switch(t.name){case"Attribute":return/^(@|:|v-)/.test(r.read(t.from,t.from+2))?y:null;case"Text":return Q}return null}function x(){return new u(R)}export{x as vue,R as vueLanguage};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{B as w,r as y,aj as q,ak as S,al as h,am as A,C as R,an as C,ao as z,x as _}from"./index-a4526b0d.js";function g(a){var u;const n=S(a);return(u=n==null?void 0:n.$el)!=null?u:n}const D=h?window:void 0,T=h?window.document:void 0,B=h?window.navigator:void 0;function E(...a){let u,n,f,l;if(typeof a[0]=="string"||Array.isArray(a[0])?([n,f,l]=a,u=D):[u,n,f,l]=a,!u)return A;Array.isArray(n)||(n=[n]),Array.isArray(f)||(f=[f]);const i=[],d=()=>{i.forEach(r=>r()),i.length=0},o=(r,m,p,c)=>(r.addEventListener(m,p,c),()=>r.removeEventListener(m,p,c)),s=R(()=>[g(u),S(l)],([r,m])=>{d(),r&&i.push(...n.flatMap(p=>f.map(c=>o(r,p,c,m))))},{immediate:!0,flush:"post"}),v=()=>{s(),d()};return C(v),v}function L(){const a=y(!1);return z()&&_(()=>{a.value=!0}),a}function M(a){const u=L();return w(()=>(u.value,!!a()))}function V(a={}){const{navigator:u=B,read:n=!1,source:f,copiedDuring:l=1500,legacy:i=!1}=a,d=["copy","cut"],o=M(()=>u&&"clipboard"in u),s=w(()=>o.value||i),v=y(""),r=y(!1),m=q(()=>r.value=!1,l);function p(){o.value?u.clipboard.readText().then(t=>{v.value=t}):v.value=b()}if(s.value&&n)for(const t of d)E(t,p);async function c(t=S(f)){s.value&&t!=null&&(o.value?await u.clipboard.writeText(t):F(t),v.value=t,r.value=!0,m.start())}function F(t){const e=document.createElement("textarea");e.value=t??"",e.style.position="absolute",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),e.remove()}function b(){var t,e,x;return(x=(e=(t=document==null?void 0:document.getSelection)==null?void 0:t.call(document))==null?void 0:e.toString())!=null?x:""}return{isSupported:s,text:v,copied:r,copy:c}}const k=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function W(a,u={}){const{document:n=T,autoExit:f=!1}=u,l=w(()=>{var e;return(e=g(a))!=null?e:n==null?void 0:n.querySelector("html")}),i=y(!1),d=w(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(e=>n&&e in n||l.value&&e in l.value)),o=w(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(e=>n&&e in n||l.value&&e in l.value)),s=w(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(e=>n&&e in n||l.value&&e in l.value)),v=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(e=>n&&e in n),r=M(()=>l.value&&n&&d.value!==void 0&&o.value!==void 0&&s.value!==void 0),m=()=>v?(n==null?void 0:n[v])===l.value:!1,p=()=>{if(s.value){if(n&&n[s.value]!=null)return n[s.value];{const e=l.value;if((e==null?void 0:e[s.value])!=null)return!!e[s.value]}}return!1};async function c(){if(r.value){if(o.value)if((n==null?void 0:n[o.value])!=null)await n[o.value]();else{const e=l.value;(e==null?void 0:e[o.value])!=null&&await e[o.value]()}i.value=!1}}async function F(){if(!r.value)return;p()&&await c();const e=l.value;d.value&&(e==null?void 0:e[d.value])!=null&&(await e[d.value](),i.value=!0)}async function b(){await(i.value?c():F())}const t=()=>{const e=p();(!e||e&&m())&&(i.value=e)};return E(n,k,t,!1),E(()=>g(l),k,t,!1),f&&C(c),{isSupported:r,isFullscreen:i,enter:F,exit:c,toggle:b}}export{W as a,V as u}; import{B as w,r as y,aj as q,ak as S,al as h,am as A,C as R,an as C,ao as z,x as _}from"./index-4eef28ae.js";function g(a){var u;const n=S(a);return(u=n==null?void 0:n.$el)!=null?u:n}const D=h?window:void 0,T=h?window.document:void 0,B=h?window.navigator:void 0;function E(...a){let u,n,f,l;if(typeof a[0]=="string"||Array.isArray(a[0])?([n,f,l]=a,u=D):[u,n,f,l]=a,!u)return A;Array.isArray(n)||(n=[n]),Array.isArray(f)||(f=[f]);const i=[],d=()=>{i.forEach(r=>r()),i.length=0},o=(r,m,p,c)=>(r.addEventListener(m,p,c),()=>r.removeEventListener(m,p,c)),s=R(()=>[g(u),S(l)],([r,m])=>{d(),r&&i.push(...n.flatMap(p=>f.map(c=>o(r,p,c,m))))},{immediate:!0,flush:"post"}),v=()=>{s(),d()};return C(v),v}function L(){const a=y(!1);return z()&&_(()=>{a.value=!0}),a}function M(a){const u=L();return w(()=>(u.value,!!a()))}function V(a={}){const{navigator:u=B,read:n=!1,source:f,copiedDuring:l=1500,legacy:i=!1}=a,d=["copy","cut"],o=M(()=>u&&"clipboard"in u),s=w(()=>o.value||i),v=y(""),r=y(!1),m=q(()=>r.value=!1,l);function p(){o.value?u.clipboard.readText().then(t=>{v.value=t}):v.value=b()}if(s.value&&n)for(const t of d)E(t,p);async function c(t=S(f)){s.value&&t!=null&&(o.value?await u.clipboard.writeText(t):F(t),v.value=t,r.value=!0,m.start())}function F(t){const e=document.createElement("textarea");e.value=t??"",e.style.position="absolute",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),e.remove()}function b(){var t,e,x;return(x=(e=(t=document==null?void 0:document.getSelection)==null?void 0:t.call(document))==null?void 0:e.toString())!=null?x:""}return{isSupported:s,text:v,copied:r,copy:c}}const k=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function W(a,u={}){const{document:n=T,autoExit:f=!1}=u,l=w(()=>{var e;return(e=g(a))!=null?e:n==null?void 0:n.querySelector("html")}),i=y(!1),d=w(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(e=>n&&e in n||l.value&&e in l.value)),o=w(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(e=>n&&e in n||l.value&&e in l.value)),s=w(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(e=>n&&e in n||l.value&&e in l.value)),v=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(e=>n&&e in n),r=M(()=>l.value&&n&&d.value!==void 0&&o.value!==void 0&&s.value!==void 0),m=()=>v?(n==null?void 0:n[v])===l.value:!1,p=()=>{if(s.value){if(n&&n[s.value]!=null)return n[s.value];{const e=l.value;if((e==null?void 0:e[s.value])!=null)return!!e[s.value]}}return!1};async function c(){if(r.value){if(o.value)if((n==null?void 0:n[o.value])!=null)await n[o.value]();else{const e=l.value;(e==null?void 0:e[o.value])!=null&&await e[o.value]()}i.value=!1}}async function F(){if(!r.value)return;p()&&await c();const e=l.value;d.value&&(e==null?void 0:e[d.value])!=null&&(await e[d.value](),i.value=!0)}async function b(){await(i.value?c():F())}const t=()=>{const e=p();(!e||e&&m())&&(i.value=e)};return E(n,k,t,!1),E(()=>g(l),k,t,!1),f&&C(c),{isSupported:r,isFullscreen:i,enter:F,exit:c,toggle:b}}export{W as a,V as u};

View File

@ -0,0 +1,9 @@
/**
* Fantastic-admin 提供技术支持
* Powered by Fantastic-admin
* Gitee https://gitee.com/hooray/fantastic-admin
* Github https://github.com/hooray/fantastic-admin
*/
const l=[{value:0,label:"待激活"},{value:1,label:"正常"},{value:2,label:"已封禁"},{value:3,label:"黑名单"}],a={0:"待激活",1:"正常",2:"已封禁",3:"黑名单"},e={0:"info",1:"success",2:"danger",3:"danger"},t={1:"注册赠送",2:"受邀请赠送",3:"邀请人赠送",4:"购买套餐赠送",5:"管理员赠送",6:"扫码支付",7:"绘画失败退款",8:"签到奖励"},u=[{value:1,label:"注册赠送"},{value:2,label:"受邀请赠送"},{value:3,label:"邀请人赠送"},{value:4,label:"购买套餐赠送"},{value:5,label:"管理员赠送"},{value:6,label:"扫码支付"},{value:7,label:"绘画失败退款"},{value:8,label:"签到奖励"}],s={0:"关闭",1:"开启"},b={0:"danger",1:"success"},T=[{value:0,label:"禁用"},{value:1,label:"启动"}],o=[{value:0,label:"未使用"},{value:1,label:"已使用"}],_=[{value:0,label:"未推荐"},{value:1,label:"已推荐"}],v=[{value:0,label:"禁用"},{value:1,label:"启用"},{value:3,label:"待审核"},{value:4,label:"拒绝共享"},{value:5,label:"通过共享"}],n=[{value:"0",label:"未启用"},{value:"1",label:"已启用"}],S=[{value:0,label:"待审核"},{value:1,label:"已通过"},{value:-1,label:"已拒绝"}],c=[{value:0,label:"未推荐"},{value:1,label:"已推荐"}],E=[{value:1,label:"支付宝"},{value:2,label:"微信"}],p=[{value:1,label:"正在排队"},{value:2,label:"正在绘制"},{value:3,label:"绘制完成"},{value:4,label:"绘制失败"},{value:5,label:"绘制超时"}],A={0:"danger",1:"success"},g={"-1":"欠费锁定",0:"未启用",1:"已启用",3:"待审核",4:"拒绝共享",5:"通过共享"},P=["gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k","gpt-3.5-turbo-0125","gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-all","gpt-4-0125-preview","dall-e-3","claude-2.0","claude-2.1","gemini-pro","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","qwen-turbo","qwen-plus","qwen-max","qwen-max-lingcontext","hunyuan","chatglm_turbo","chatglm_pro","chatglm_std","chatglm_lite","360GPT_S2_V9","SparkDesk"],O=[{value:"mj",label:"MidjourneyAi"},{value:"DALL-E2",label:"DALL-E"}],I=[{value:0,label:"未支付"},{value:1,label:"已支付"},{value:2,label:"支付失败"},{value:3,label:"支付超时"}],r={0:"未支付",1:"已支付",2:"支付失败",3:"支付超时"},i=[{value:"epay",label:"易支付"},{value:"hupi",label:"虎皮椒"},{value:"wechat",label:"微信支付"},{value:"mpay",label:"码支付"}],R={epay:"易支付",hupi:"虎皮椒",wechat:"微信支付",mpay:"码支付"},N=[{value:1,label:"等待中"},{value:2,label:"绘制中"},{value:3,label:"绘制完成"},{value:4,label:"绘制失败"},{value:5,label:"绘制超时"}],L=[{value:"system",label:"系统"},{value:"user",label:"用户"}],M={1:"排队中",2:"绘制中",3:"绘制完成",4:"绘制失败",5:"绘制超时"},m=[{value:"百度云检测",label:"百度云检测"},{value:"自定义检测",label:"自定义检测"}],h=[{value:1,label:"OpenAi - [chatGpt]"}],U={1:["gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-3.5-turbo-16k","gpt-3.5-turbo-0125","gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-all","gpt-4-0125-preview","dall-e-3","claude-2.0","claude-2.1","gemini-pro","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","qwen-turbo","qwen-plus","qwen-max","qwen-max-lingcontext","hunyuan","chatglm_turbo","chatglm_pro","chatglm_std","chatglm_lite","360GPT_S2_V9","SparkDesk"],2:["ERNIE-Bot","ERNIE-Bot","ERNIE-Bot-4","ERNIE-Bot-turbo","BLOOMZ-7B","Llama-2-7b-chat","Llama-2-13b-chat","Qianfan-BLOOMZ-7B-compressed","Qianfan-Chinese-Llama-2-7B","AquilaChat-7B"],3:["chatglm_pro","chatglm_std","chatglm_lite","chatglm_lite_32k"]},D=[{value:1,label:"普通余额"},{value:2,label:"高级余额"}],d={1:"APIKey",2:"client_id",3:"AppKey"};export{L as A,o as C,O as D,v as E,b as I,P as M,S as O,i as P,g as Q,_ as R,m as T,e as U,p as W,N as a,n as b,A as c,c as d,M as e,U as f,d as g,h,D as i,I as j,R as k,r as l,T as m,s as n,E as o,a as p,l as q,u as r,t as s};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as v,y as C,A as M,r as B,o as e,I as f,f as p,b as s,c as o,a as n,e as i,l as T,R as h,S as x,J as a,T as w,h as N,G as R,t as V,_ as H,n as I}from"./index-a4526b0d.js";import L from"./index-a1dd4585.js";import{T as W}from"./index-55ae7eb6.js";import{u as $}from"./useMenu-92afd7a0.js";import"./index-4cf9b11c.js";const b={key:0},z={class:"header-container"},A={class:"main"},D=["onWheel"],E=["onClick"],F={key:1},G=v({name:"Header"}),J=v({...G,setup(Y){const l=C(),_=M(),{switchTo:k}=$(),d=B();function y(r){d.value.scrollBy({left:(r.deltaY||r.detail)>0?50:-50})}return(r,j)=>{const g=H,S=N("el-icon");return e(),f(w,{name:"header"},{default:p(()=>[s(l).mode==="pc"&&s(l).settings.menu.menuMode==="head"?(e(),o("header",b,[n("div",z,[n("div",A,[i(L),n("div",{ref_key:"navRef",ref:d,class:"nav",onWheel:T(y,["prevent"])},[(e(!0),o(h,null,x(s(_).allMenus,(t,c)=>{var u,m;return e(),o(h,{key:c},[t.children&&t.children.length!==0?(e(),o("div",{key:0,class:R(["item-container",{active:c===s(_).actived}])},[n("div",{class:"item",onClick:q=>s(k)(c)},[(u=t.meta)!=null&&u.icon?(e(),f(S,{key:0},{default:p(()=>[i(g,{name:t.meta.icon},null,8,["name"])]),_:2},1024)):a("",!0),(m=t.meta)!=null&&m.title?(e(),o("span",F,V(t.meta.title),1)):a("",!0)],8,E)],2)):a("",!0)],64)}),128))],40,D)]),i(W)])])):a("",!0)]),_:1})}}});const X=I(J,[["__scopeId","data-v-381f1d85"]]);export{X as default}; import{d as v,y as C,A as M,r as B,o as e,I as f,f as p,b as s,c as o,a as n,e as i,l as T,R as h,S as x,J as a,T as w,h as N,G as R,t as V,_ as H,n as I}from"./index-4eef28ae.js";import L from"./index-517f4c75.js";import{T as W}from"./index-fcbba52e.js";import{u as $}from"./useMenu-328121e0.js";import"./index-626bf66d.js";const b={key:0},z={class:"header-container"},A={class:"main"},D=["onWheel"],E=["onClick"],F={key:1},G=v({name:"Header"}),J=v({...G,setup(Y){const l=C(),_=M(),{switchTo:k}=$(),d=B();function y(r){d.value.scrollBy({left:(r.deltaY||r.detail)>0?50:-50})}return(r,j)=>{const g=H,S=N("el-icon");return e(),f(w,{name:"header"},{default:p(()=>[s(l).mode==="pc"&&s(l).settings.menu.menuMode==="head"?(e(),o("header",b,[n("div",z,[n("div",A,[i(L),n("div",{ref_key:"navRef",ref:d,class:"nav",onWheel:T(y,["prevent"])},[(e(!0),o(h,null,x(s(_).allMenus,(t,c)=>{var u,m;return e(),o(h,{key:c},[t.children&&t.children.length!==0?(e(),o("div",{key:0,class:R(["item-container",{active:c===s(_).actived}])},[n("div",{class:"item",onClick:q=>s(k)(c)},[(u=t.meta)!=null&&u.icon?(e(),f(S,{key:0},{default:p(()=>[i(g,{name:t.meta.icon},null,8,["name"])]),_:2},1024)):a("",!0),(m=t.meta)!=null&&m.title?(e(),o("span",F,V(t.meta.title),1)):a("",!0)],8,E)],2)):a("",!0)],64)}),128))],40,D)]),i(W)])])):a("",!0)]),_:1})}}});const X=I(J,[["__scopeId","data-v-381f1d85"]]);export{X as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as _,O as f,r as g,o as a,c as s,N as c,R as y,k as v,t as h,J as i,b as o,e as r,f as k,G as C,H as S,_ as x,h as N,n as w}from"./index-a4526b0d.js";const B={key:0,class:"title-container"},V=_({name:"PageMain"}),$=_({...V,props:{title:{type:String,default:""},collaspe:{type:Boolean,default:!1},height:{type:String,default:""}},setup(e){const d=e,n=!!f().title,t=g(d.collaspe);function p(){t.value=!1}return(l,z)=>{const u=x,m=N("el-icon");return a(),s("div",{class:C(["page-main",{"is-collaspe":o(t)}]),style:S({height:o(t)?e.height:""})},[n||e.title?(a(),s("div",B,[n?c(l.$slots,"title",{key:0},void 0,!0):(a(),s(y,{key:1},[v(h(e.title),1)],64))])):i("",!0),c(l.$slots,"default",{},void 0,!0),o(t)?(a(),s("div",{key:1,class:"collaspe",title:"展开",onClick:p},[r(m,null,{default:k(()=>[r(u,{name:"ep:arrow-down"})]),_:1})])):i("",!0)],6)}}});const b=w($,[["__scopeId","data-v-847d7a8d"]]);export{b as _}; import{d as _,O as f,r as g,o as a,c as s,N as c,R as y,k as v,t as h,J as i,b as o,e as r,f as k,G as C,H as S,_ as x,h as N,n as w}from"./index-4eef28ae.js";const B={key:0,class:"title-container"},V=_({name:"PageMain"}),$=_({...V,props:{title:{type:String,default:""},collaspe:{type:Boolean,default:!1},height:{type:String,default:""}},setup(e){const d=e,n=!!f().title,t=g(d.collaspe);function p(){t.value=!1}return(l,z)=>{const u=x,m=N("el-icon");return a(),s("div",{class:C(["page-main",{"is-collaspe":o(t)}]),style:S({height:o(t)?e.height:""})},[n||e.title?(a(),s("div",B,[n?c(l.$slots,"title",{key:0},void 0,!0):(a(),s(y,{key:1},[v(h(e.title),1)],64))])):i("",!0),c(l.$slots,"default",{},void 0,!0),o(t)?(a(),s("div",{key:1,class:"collaspe",title:"展开",onClick:p},[r(m,null,{default:k(()=>[r(u,{name:"ep:arrow-down"})]),_:1})])):i("",!0)],6)}}});const b=w($,[["__scopeId","data-v-847d7a8d"]]);export{b as _};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as P,y as z,B as D,o as a,c as u,b as i,I as c,f as s,a as r,e as f,J as h,t as B,ai as d,G as E,R as I,S as F,_ as G,h as m,n as L}from"./index-a4526b0d.js";const $={class:"sidebar-item"},A=["href","target","onClick"],H={class:"title"},K={class:"title"},M=P({name:"SidebarItem"}),Q=P({...M,props:{item:{type:Object,required:!0},basePath:{type:String,default:""}},setup(e){const _=e,N=z(),O=D(()=>{let o=!0;return _.item.children?_.item.children.every(b=>{var l;return((l=b.meta)==null?void 0:l.sidebar)===!1})&&(o=!1):o=!1,o});return(o,b)=>{var y;const l=G,k=m("el-icon"),V=m("el-menu-item"),J=m("router-link"),R=m("SidebarItem"),j=m("el-sub-menu");return a(),u("div",$,[i(O)?(a(),c(j,{key:1,title:((y=e.item.meta)==null?void 0:y.title)??"[ 无标题 ]",index:i(N).settings.app.routeBaseOn!=="filesystem"?i(d)(e.basePath,e.item.path):JSON.stringify(e.item)},{title:s(()=>{var t,n;return[(t=e.item.meta)!=null&&t.icon?(a(),c(k,{key:0,class:"title-icon"},{default:s(()=>[f(l,{name:e.item.meta.icon},null,8,["name"])]),_:1})):h("",!0),r("span",K,B(((n=e.item.meta)==null?void 0:n.title)??"[ 无标题 ]"),1)]}),default:s(()=>[(a(!0),u(I,null,F(e.item.children,t=>{var n;return a(),u(I,null,[((n=t.meta)==null?void 0:n.sidebar)!==!1?(a(),c(R,{key:t.path,item:t,"base-path":i(d)(e.basePath,e.item.path)},null,8,["item","base-path"])):h("",!0)],64)}),256))]),_:1},8,["title","index"])):(a(),c(J,{key:0,custom:"",to:i(d)(e.basePath,e.item.path)},{default:s(({href:t,navigate:n,isActive:q,isExactActive:w})=>{var g,x,v;return[r("a",{href:(g=e.item.meta)!=null&&g.link?e.item.meta.link:t,class:E([q&&"router-link-active",w&&"router-link-exact-active"]),target:(x=e.item.meta)!=null&&x.link?"_blank":"_self",onClick:n},[f(V,{title:((v=e.item.meta)==null?void 0:v.title)??"[ 无标题 ]",index:i(d)(e.basePath,e.item.path||"")},{default:s(()=>{var S,C;return[(S=e.item.meta)!=null&&S.icon?(a(),c(k,{key:0,class:"title-icon"},{default:s(()=>[f(l,{name:e.item.meta.icon},null,8,["name"])]),_:1})):h("",!0),r("span",H,B(((C=e.item.meta)==null?void 0:C.title)??"[ 无标题 ]"),1)]}),_:1},8,["title","index"])],10,A)]}),_:1},8,["to"]))])}}});const U=L(Q,[["__scopeId","data-v-a9cfdc56"]]);export{U as default}; import{d as P,y as z,B as D,o as a,c as u,b as i,I as c,f as s,a as r,e as f,J as h,t as B,ai as d,G as E,R as I,S as F,_ as G,h as m,n as L}from"./index-4eef28ae.js";const $={class:"sidebar-item"},A=["href","target","onClick"],H={class:"title"},K={class:"title"},M=P({name:"SidebarItem"}),Q=P({...M,props:{item:{type:Object,required:!0},basePath:{type:String,default:""}},setup(e){const _=e,N=z(),O=D(()=>{let o=!0;return _.item.children?_.item.children.every(b=>{var l;return((l=b.meta)==null?void 0:l.sidebar)===!1})&&(o=!1):o=!1,o});return(o,b)=>{var y;const l=G,k=m("el-icon"),V=m("el-menu-item"),J=m("router-link"),R=m("SidebarItem"),j=m("el-sub-menu");return a(),u("div",$,[i(O)?(a(),c(j,{key:1,title:((y=e.item.meta)==null?void 0:y.title)??"[ 无标题 ]",index:i(N).settings.app.routeBaseOn!=="filesystem"?i(d)(e.basePath,e.item.path):JSON.stringify(e.item)},{title:s(()=>{var t,n;return[(t=e.item.meta)!=null&&t.icon?(a(),c(k,{key:0,class:"title-icon"},{default:s(()=>[f(l,{name:e.item.meta.icon},null,8,["name"])]),_:1})):h("",!0),r("span",K,B(((n=e.item.meta)==null?void 0:n.title)??"[ 无标题 ]"),1)]}),default:s(()=>[(a(!0),u(I,null,F(e.item.children,t=>{var n;return a(),u(I,null,[((n=t.meta)==null?void 0:n.sidebar)!==!1?(a(),c(R,{key:t.path,item:t,"base-path":i(d)(e.basePath,e.item.path)},null,8,["item","base-path"])):h("",!0)],64)}),256))]),_:1},8,["title","index"])):(a(),c(J,{key:0,custom:"",to:i(d)(e.basePath,e.item.path)},{default:s(({href:t,navigate:n,isActive:q,isExactActive:w})=>{var g,x,v;return[r("a",{href:(g=e.item.meta)!=null&&g.link?e.item.meta.link:t,class:E([q&&"router-link-active",w&&"router-link-exact-active"]),target:(x=e.item.meta)!=null&&x.link?"_blank":"_self",onClick:n},[f(V,{title:((v=e.item.meta)==null?void 0:v.title)??"[ 无标题 ]",index:i(d)(e.basePath,e.item.path||"")},{default:s(()=>{var S,C;return[(S=e.item.meta)!=null&&S.icon?(a(),c(k,{key:0,class:"title-icon"},{default:s(()=>[f(l,{name:e.item.meta.icon},null,8,["name"])]),_:1})):h("",!0),r("span",H,B(((C=e.item.meta)==null?void 0:C.title)??"[ 无标题 ]"),1)]}),_:1},8,["title","index"])],10,A)]}),_:1},8,["to"]))])}}});const U=L(Q,[["__scopeId","data-v-a9cfdc56"]]);export{U as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as g,y as h,A as S,B as M,r as v,b as e,o as t,c as o,e as l,G as u,f as d,ac as C,R as p,S as y,J as m,h as k,I as q,n as w}from"./index-a4526b0d.js";import x from"./index-a1dd4585.js";import B from"./index-6bec1272.js";const I=g({name:"SubSidebar"}),T=g({...I,setup(G){const s=h(),i=S();M(()=>s.settings.app.colorScheme==="dark"?"https://public-1300678944.cos.ap-shanghai.myqcloud.com/ai/f6d0d3596.png":"https://public-1300678944.cos.ap-shanghai.myqcloud.com/blog/1681895253740image.png");const c=v(0);function b(a){c.value=a.target.scrollTop}return(a,L)=>{const _=k("el-menu");return["side","head","single"].includes(e(s).settings.menu.menuMode)||e(s).mode==="mobile"?(t(),o("div",{key:0,class:u(["sub-sidebar-container",{"is-collapse":e(s).mode==="pc"&&e(s).settings.menu.subMenuCollapse}]),onScroll:b},[l(x,{"show-logo":e(s).settings.menu.menuMode==="single",class:u(["sidebar-logo",{"sidebar-logo-bg":e(s).settings.menu.menuMode==="single",shadow:e(c)}])},null,8,["show-logo","class"]),l(_,{"unique-opened":e(s).settings.menu.subMenuUniqueOpened,"default-openeds":e(i).defaultOpenedPaths,"default-active":a.$route.meta.activeMenu||a.$route.path,collapse:e(s).mode==="pc"&&e(s).settings.menu.subMenuCollapse,"collapse-transition":!1,class:u({"is-collapse-without-logo":e(s).settings.menu.menuMode!=="single"&&e(s).settings.menu.subMenuCollapse})},{default:d(()=>[l(C,{name:"sub-sidebar"},{default:d(()=>[(t(!0),o(p,null,y(e(i).sidebarMenus,(n,f)=>{var r;return t(),o(p,null,[((r=n.meta)==null?void 0:r.sidebar)!==!1?(t(),q(B,{key:n.path||f,item:n,"base-path":n.path},null,8,["item","base-path"])):m("",!0)],64)}),256))]),_:1})]),_:1},8,["unique-opened","default-openeds","default-active","collapse","class"])],34)):m("",!0)}}});const $=w(T,[["__scopeId","data-v-859c71ea"]]);export{$ as default}; import{d as g,y as h,A as S,B as M,r as v,b as e,o as t,c as o,e as l,G as u,f as d,ac as C,R as p,S as y,J as m,h as k,I as q,n as w}from"./index-4eef28ae.js";import x from"./index-517f4c75.js";import B from"./index-89092077.js";const I=g({name:"SubSidebar"}),T=g({...I,setup(G){const s=h(),i=S();M(()=>s.settings.app.colorScheme==="dark"?"https://public-1300678944.cos.ap-shanghai.myqcloud.com/ai/f6d0d3596.png":"https://public-1300678944.cos.ap-shanghai.myqcloud.com/blog/1681895253740image.png");const c=v(0);function b(a){c.value=a.target.scrollTop}return(a,L)=>{const _=k("el-menu");return["side","head","single"].includes(e(s).settings.menu.menuMode)||e(s).mode==="mobile"?(t(),o("div",{key:0,class:u(["sub-sidebar-container",{"is-collapse":e(s).mode==="pc"&&e(s).settings.menu.subMenuCollapse}]),onScroll:b},[l(x,{"show-logo":e(s).settings.menu.menuMode==="single",class:u(["sidebar-logo",{"sidebar-logo-bg":e(s).settings.menu.menuMode==="single",shadow:e(c)}])},null,8,["show-logo","class"]),l(_,{"unique-opened":e(s).settings.menu.subMenuUniqueOpened,"default-openeds":e(i).defaultOpenedPaths,"default-active":a.$route.meta.activeMenu||a.$route.path,collapse:e(s).mode==="pc"&&e(s).settings.menu.subMenuCollapse,"collapse-transition":!1,class:u({"is-collapse-without-logo":e(s).settings.menu.menuMode!=="single"&&e(s).settings.menu.subMenuCollapse})},{default:d(()=>[l(C,{name:"sub-sidebar"},{default:d(()=>[(t(!0),o(p,null,y(e(i).sidebarMenus,(n,f)=>{var r;return t(),o(p,null,[((r=n.meta)==null?void 0:r.sidebar)!==!1?(t(),q(B,{key:n.path||f,item:n,"base-path":n.path},null,8,["item","base-path"])):m("",!0)],64)}),256))]),_:1})]),_:1},8,["unique-opened","default-openeds","default-active","collapse","class"])],34)):m("",!0)}}});const $=w(T,[["__scopeId","data-v-859c71ea"]]);export{$ as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as h,y as x,z as A,A as L,B as D,C as b,x as $,D as r,F as H,o as n,c as g,a,e as o,G as v,b as t,H as I,I as l,J as u,f as d,T,w as V,v as z,K,L as N,M as P,g as R,h as c,_ as E,n as F}from"./index-a4526b0d.js";import{_ as G}from"./index-9bb8cb40.js";import J from"./link-2c09c62d.js";import U from"./index-773a5308.js";import j from"./index-4a97d0a1.js";import q from"./index-c941ad23.js";import O from"./index-91a8f0f1.js";import Q from"./index-139e6705.js";import W from"./index-38f732b4.js";import X from"./index-c23161fc.js";import{u as Y}from"./index-55ae7eb6.js";import{u as Z}from"./useMenu-92afd7a0.js";import"./config-33902e1a.js";import"./index-5e1cba81.js";import"./index-a1dd4585.js";import"./index-6bec1272.js";import"./index-4cf9b11c.js";const ee={class:"layout"},te={id:"app-main"},oe={class:"wrapper"},se={class:"main"},ne={key:0},ae=h({name:"Layout"}),ie=h({...ae,setup(re){const _=R(),e=x(),k=A(),m=L(),f=D(()=>!!_.meta.link);return b(()=>e.settings.menu.subMenuCollapse,s=>{e.mode==="mobile"&&(s?document.body.classList.remove("overflow-hidden"):document.body.classList.add("overflow-hidden"))}),b(()=>_.path,()=>{e.mode==="mobile"&&e.$patch(s=>{s.settings.menu.subMenuCollapse=!0})}),$(()=>{r("f5",s=>{e.settings.toolbar.enablePageReload&&(s.preventDefault(),Y().reload())}),r("alt+`",s=>{e.settings.menu.enableHotkeys&&(s.preventDefault(),Z().switchTo(m.actived+1<m.allMenus.length?m.actived+1:0))})}),H(()=>{r.unbind("f5"),r.unbind("alt+`")}),(s,i)=>{const y=c("router-view"),S=G,C=c("el-backtop"),w=E,M=c("el-icon");return n(),g("div",ee,[a("div",te,[o(U),a("div",oe,[a("div",{class:v(["sidebar-container",{show:t(e).mode==="mobile"&&!t(e).settings.menu.subMenuCollapse}])},[o(j),o(q)],2),a("div",{class:v(["sidebar-mask",{show:t(e).mode==="mobile"&&!t(e).settings.menu.subMenuCollapse}]),onClick:i[0]||(i[0]=p=>t(e).toggleSidebarCollapse())},null,2),a("div",{class:"main-container",style:I({"padding-bottom":s.$route.meta.paddingBottom})},[t(e).settings.menu.menuMode==="head"&&!t(e).settings.menu.enableSubMenuCollapseButton&&!t(e).settings.breadcrumb.enable?u("",!0):(n(),l(O,{key:0})),a("div",se,[o(y,null,{default:d(({Component:p,route:B})=>[o(T,{name:"main",mode:"out-in",appear:""},{default:d(()=>[(n(),l(N,{include:t(k).list},[V((n(),l(K(p),{key:B.fullPath})),[[z,!t(f)]])],1032,["include"]))]),_:2},1024)]),_:1}),t(f)?(n(),l(J,{key:0})):u("",!0)]),o(S)],4)]),o(C,{right:20,bottom:20,title:"回到顶部"})]),o(Q),o(W),t(e).settings.app.enableAppSetting?(n(),g("div",ne,[o(M,{class:"app-setting",onClick:i[1]||(i[1]=p=>t(P).emit("global-app-setting-toggle"))},{default:d(()=>[o(w,{name:"ep:setting"})]),_:1}),o(X)])):u("",!0)])}}});const Me=F(ie,[["__scopeId","data-v-096f3f7e"]]);export{Me as default}; import{d as h,y as x,z as A,A as L,B as D,C as b,x as $,D as r,F as H,o as n,c as g,a,e as o,G as v,b as t,H as I,I as l,J as u,f as d,T,w as V,v as z,K,L as N,M as P,g as R,h as c,_ as E,n as F}from"./index-4eef28ae.js";import{_ as G}from"./index-4f1ad461.js";import J from"./link-3e20e299.js";import U from"./index-71c7823d.js";import j from"./index-b06918ff.js";import q from"./index-94c3c0f1.js";import O from"./index-e51a44eb.js";import Q from"./index-46ad6a05.js";import W from"./index-c9fecdd2.js";import X from"./index-2604b602.js";import{u as Y}from"./index-fcbba52e.js";import{u as Z}from"./useMenu-328121e0.js";import"./config-b4a9e7c0.js";import"./index-7911c6db.js";import"./index-517f4c75.js";import"./index-89092077.js";import"./index-626bf66d.js";const ee={class:"layout"},te={id:"app-main"},oe={class:"wrapper"},se={class:"main"},ne={key:0},ae=h({name:"Layout"}),ie=h({...ae,setup(re){const _=R(),e=x(),k=A(),m=L(),f=D(()=>!!_.meta.link);return b(()=>e.settings.menu.subMenuCollapse,s=>{e.mode==="mobile"&&(s?document.body.classList.remove("overflow-hidden"):document.body.classList.add("overflow-hidden"))}),b(()=>_.path,()=>{e.mode==="mobile"&&e.$patch(s=>{s.settings.menu.subMenuCollapse=!0})}),$(()=>{r("f5",s=>{e.settings.toolbar.enablePageReload&&(s.preventDefault(),Y().reload())}),r("alt+`",s=>{e.settings.menu.enableHotkeys&&(s.preventDefault(),Z().switchTo(m.actived+1<m.allMenus.length?m.actived+1:0))})}),H(()=>{r.unbind("f5"),r.unbind("alt+`")}),(s,i)=>{const y=c("router-view"),S=G,C=c("el-backtop"),w=E,M=c("el-icon");return n(),g("div",ee,[a("div",te,[o(U),a("div",oe,[a("div",{class:v(["sidebar-container",{show:t(e).mode==="mobile"&&!t(e).settings.menu.subMenuCollapse}])},[o(j),o(q)],2),a("div",{class:v(["sidebar-mask",{show:t(e).mode==="mobile"&&!t(e).settings.menu.subMenuCollapse}]),onClick:i[0]||(i[0]=p=>t(e).toggleSidebarCollapse())},null,2),a("div",{class:"main-container",style:I({"padding-bottom":s.$route.meta.paddingBottom})},[t(e).settings.menu.menuMode==="head"&&!t(e).settings.menu.enableSubMenuCollapseButton&&!t(e).settings.breadcrumb.enable?u("",!0):(n(),l(O,{key:0})),a("div",se,[o(y,null,{default:d(({Component:p,route:B})=>[o(T,{name:"main",mode:"out-in",appear:""},{default:d(()=>[(n(),l(N,{include:t(k).list},[V((n(),l(K(p),{key:B.fullPath})),[[z,!t(f)]])],1032,["include"]))]),_:2},1024)]),_:1}),t(f)?(n(),l(J,{key:0})):u("",!0)]),o(S)],4)]),o(C,{right:20,bottom:20,title:"回到顶部"})]),o(Q),o(W),t(e).settings.app.enableAppSetting?(n(),g("div",ne,[o(M,{class:"app-setting",onClick:i[1]||(i[1]=p=>t(P).emit("global-app-setting-toggle"))},{default:d(()=>[o(w,{name:"ep:setting"})]),_:1}),o(X)])):u("",!0)])}}});const Me=F(ie,[["__scopeId","data-v-096f3f7e"]]);export{Me as default};

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as g,y as k,A as b,o as t,I as d,f as u,b as s,c as n,e as m,a as p,R as f,S as y,J as c,T as C,h as M,G as x,t as B,_ as w,n as N}from"./index-a4526b0d.js";import T from"./index-a1dd4585.js";import{u as V}from"./useMenu-92afd7a0.js";const I={key:0,class:"main-sidebar-container"},L={class:"nav"},$=["title","onClick"],z=g({name:"MainSidebar"}),A=g({...z,setup(D){const a=k(),i=b(),{switchTo:v}=V();return(E,F)=>{const h=w,S=M("el-icon");return t(),d(C,{name:"main-sidebar"},{default:u(()=>[s(a).settings.menu.menuMode==="side"||s(a).mode==="mobile"&&s(a).settings.menu.menuMode!=="single"?(t(),n("div",I,[m(T,{"show-title":!1,class:"sidebar-logo"}),p("div",L,[(t(!0),n(f,null,y(s(i).allMenus,(e,o)=>{var l,r,_;return t(),n(f,null,[e.children&&e.children.length!==0?(t(),n("div",{key:o,class:x(["item",{active:o===s(i).actived}]),title:((l=e.meta)==null?void 0:l.title)??"[ 无标题 ]",onClick:G=>s(v)(o)},[(r=e.meta)!=null&&r.icon?(t(),d(S,{key:0},{default:u(()=>[m(h,{name:e.meta.icon},null,8,["name"])]),_:2},1024)):c("",!0),p("span",null,B(((_=e.meta)==null?void 0:_.title)??"[ 无标题 ]"),1)],10,$)):c("",!0)],64)}),256))])])):c("",!0)]),_:1})}}});const q=N(A,[["__scopeId","data-v-27edc889"]]);export{q as default}; import{d as g,y as k,A as b,o as t,I as d,f as u,b as s,c as n,e as m,a as p,R as f,S as y,J as c,T as C,h as M,G as x,t as B,_ as w,n as N}from"./index-4eef28ae.js";import T from"./index-517f4c75.js";import{u as V}from"./useMenu-328121e0.js";const I={key:0,class:"main-sidebar-container"},L={class:"nav"},$=["title","onClick"],z=g({name:"MainSidebar"}),A=g({...z,setup(D){const a=k(),i=b(),{switchTo:v}=V();return(E,F)=>{const h=w,S=M("el-icon");return t(),d(C,{name:"main-sidebar"},{default:u(()=>[s(a).settings.menu.menuMode==="side"||s(a).mode==="mobile"&&s(a).settings.menu.menuMode!=="single"?(t(),n("div",I,[m(T,{"show-title":!1,class:"sidebar-logo"}),p("div",L,[(t(!0),n(f,null,y(s(i).allMenus,(e,o)=>{var l,r,_;return t(),n(f,null,[e.children&&e.children.length!==0?(t(),n("div",{key:o,class:x(["item",{active:o===s(i).actived}]),title:((l=e.meta)==null?void 0:l.title)??"[ 无标题 ]",onClick:G=>s(v)(o)},[(r=e.meta)!=null&&r.icon?(t(),d(S,{key:0},{default:u(()=>[m(h,{name:e.meta.icon},null,8,["name"])]),_:2},1024)):c("",!0),p("span",null,B(((_=e.meta)==null?void 0:_.title)??"[ 无标题 ]"),1)],10,$)):c("",!0)],64)}),256))])])):c("",!0)]),_:1})}}});const q=N(A,[["__scopeId","data-v-27edc889"]]);export{q as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as g,r as v,y as b,x as k,M as y,o as l,c as x,e as n,f as s,k as r,t as c,b as e,I as u,J as m,U as S,h as d,n as h}from"./index-a4526b0d.js";const V=g({__name:"index",setup(w){const o=v(!1),t=b();return k(()=>{y.on("global-hotkeys-intro-toggle",()=>{o.value=!o.value})}),(B,i)=>{const a=d("el-descriptions-item"),_=d("el-descriptions"),p=d("el-drawer");return l(),x("div",null,[n(p,{modelValue:e(o),"onUpdate:modelValue":i[0]||(i[0]=f=>S(o)?o.value=f:null),title:"快捷键介绍",direction:"rtl",size:360},{default:s(()=>[n(_,{title:"全局",column:1,border:""},{default:s(()=>[n(a,{label:"查看系统信息"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + I ",1)]),_:1}),e(t).settings.navSearch.enable&&e(t).settings.navSearch.enableHotkeys?(l(),u(a,{key:0,label:"唤起导航搜索"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + S ",1)]),_:1})):m("",!0)]),_:1}),e(t).settings.menu.enableHotkeys&&["side","head"].includes(e(t).settings.menu.menuMode)?(l(),u(_,{key:0,title:"主导航",column:1,border:""},{default:s(()=>[n(a,{label:"激活下一个主导航"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + ` ",1)]),_:1})]),_:1})):m("",!0)]),_:1},8,["modelValue"])])}}});const I=h(V,[["__scopeId","data-v-59fcc97e"]]);export{I as default}; import{d as g,r as v,y as b,x as k,M as y,o as l,c as x,e as n,f as s,k as r,t as c,b as e,I as u,J as m,U as S,h as d,n as h}from"./index-4eef28ae.js";const V=g({__name:"index",setup(w){const o=v(!1),t=b();return k(()=>{y.on("global-hotkeys-intro-toggle",()=>{o.value=!o.value})}),(B,i)=>{const a=d("el-descriptions-item"),_=d("el-descriptions"),p=d("el-drawer");return l(),x("div",null,[n(p,{modelValue:e(o),"onUpdate:modelValue":i[0]||(i[0]=f=>S(o)?o.value=f:null),title:"快捷键介绍",direction:"rtl",size:360},{default:s(()=>[n(_,{title:"全局",column:1,border:""},{default:s(()=>[n(a,{label:"查看系统信息"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + I ",1)]),_:1}),e(t).settings.navSearch.enable&&e(t).settings.navSearch.enableHotkeys?(l(),u(a,{key:0,label:"唤起导航搜索"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + S ",1)]),_:1})):m("",!0)]),_:1}),e(t).settings.menu.enableHotkeys&&["side","head"].includes(e(t).settings.menu.menuMode)?(l(),u(_,{key:0,title:"主导航",column:1,border:""},{default:s(()=>[n(a,{label:"激活下一个主导航"},{default:s(()=>[r(c(e(t).os==="mac"?"⌥":"Alt")+" + ` ",1)]),_:1})]),_:1})):m("",!0)]),_:1},8,["modelValue"])])}}});const I=h(V,[["__scopeId","data-v-59fcc97e"]]);export{I as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{ah as z,d as x,y as F,u as M,o as l,c as u,a as k,b as e,M as v,e as t,f as o,J as c,w as y,v as S,I as w,k as d,t as C,_ as j,h as i,m as D,n as I}from"./index-a4526b0d.js";import{a as O}from"./index-4cf9b11c.js";function R(){function g(){z.push({name:"reload"})}return{reload:g}}const A={class:"tools"},E={class:"buttons"},J={class:"user-wrapper"},U=x({name:"Tools"}),q=x({...U,setup(g){const p=D(),n=F(),f=M(),B=R(),{isFullscreen:N,toggle:h}=O();function T(b){switch(b){case"home":p.push({name:"home"});break;case"setting":p.push({name:"personalSetting"});break;case"hotkeys":v.emit("global-hotkeys-intro-toggle");break;case"logout":f.logout().then(()=>{p.push({name:"login"})});break}}return(b,s)=>{const a=j,r=i("el-icon"),$=i("el-avatar"),m=i("el-dropdown-item"),P=i("el-dropdown-menu"),V=i("el-dropdown");return l(),u("div",A,[k("div",E,[e(n).settings.navSearch.enable?(l(),u("span",{key:0,class:"item",onClick:s[0]||(s[0]=_=>e(v).emit("global-search-toggle"))},[t(r,null,{default:o(()=>[t(a,{name:"ep:search"})]),_:1})])):c("",!0),e(n).mode==="pc"&&e(n).settings.toolbar.enableFullscreen?(l(),u("span",{key:1,class:"item",onClick:s[1]||(s[1]=(..._)=>e(h)&&e(h)(..._))},[t(r,null,{default:o(()=>[t(a,{name:e(N)?"fullscreen-exit":"fullscreen"},null,8,["name"])]),_:1})])):c("",!0),e(n).settings.toolbar.enablePageReload?(l(),u("span",{key:2,class:"item",onClick:s[2]||(s[2]=_=>e(B).reload())},[t(r,null,{default:o(()=>[t(a,{name:"ep:refresh-right"})]),_:1})])):c("",!0),e(n).settings.toolbar.enableColorScheme?(l(),u("span",{key:3,class:"item",onClick:s[3]||(s[3]=_=>e(n).setColorScheme(e(n).settings.app.colorScheme==="dark"?"light":"dark"))},[t(r,null,{default:o(()=>[y(t(a,{name:"ep:sunny"},null,512),[[S,e(n).settings.app.colorScheme==="light"]]),y(t(a,{name:"ep:moon"},null,512),[[S,e(n).settings.app.colorScheme==="dark"]])]),_:1})])):c("",!0)]),t(V,{class:"user-container",size:"default",onCommand:T},{dropdown:o(()=>[t(P,{class:"user-dropdown"},{default:o(()=>[e(n).settings.home.enable?(l(),w(m,{key:0,command:"home"},{default:o(()=>[d(C(e(n).settings.home.title),1)]),_:1})):c("",!0),t(m,{command:"setting"},{default:o(()=>[d(" 个人设置 ")]),_:1}),e(n).mode==="pc"?(l(),w(m,{key:1,divided:"",command:"hotkeys"},{default:o(()=>[d(" 快捷键介绍 ")]),_:1})):c("",!0),t(m,{divided:"",command:"logout"},{default:o(()=>[d(" 退出登录 ")]),_:1})]),_:1})]),default:o(()=>[k("div",J,[t($,{size:"small"},{default:o(()=>[t(r,null,{default:o(()=>[t(a,{name:"ep:user-filled"})]),_:1})]),_:1}),d(" "+C(`${e(f).username||"Nine Ai"} `)+" ",1),t(r,null,{default:o(()=>[t(a,{name:"ep:caret-bottom"})]),_:1})])]),_:1})])}}});const G=I(q,[["__scopeId","data-v-ad60bb95"]]),L=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{G as T,L as i,R as u}; import{ah as z,d as x,y as F,u as M,o as l,c as u,a as k,b as e,M as v,e as t,f as o,J as c,w as y,v as S,I as w,k as d,t as C,_ as j,h as i,m as D,n as I}from"./index-4eef28ae.js";import{a as O}from"./index-626bf66d.js";function R(){function g(){z.push({name:"reload"})}return{reload:g}}const A={class:"tools"},E={class:"buttons"},J={class:"user-wrapper"},U=x({name:"Tools"}),q=x({...U,setup(g){const p=D(),n=F(),f=M(),B=R(),{isFullscreen:N,toggle:h}=O();function T(b){switch(b){case"home":p.push({name:"home"});break;case"setting":p.push({name:"personalSetting"});break;case"hotkeys":v.emit("global-hotkeys-intro-toggle");break;case"logout":f.logout().then(()=>{p.push({name:"login"})});break}}return(b,s)=>{const a=j,r=i("el-icon"),$=i("el-avatar"),m=i("el-dropdown-item"),P=i("el-dropdown-menu"),V=i("el-dropdown");return l(),u("div",A,[k("div",E,[e(n).settings.navSearch.enable?(l(),u("span",{key:0,class:"item",onClick:s[0]||(s[0]=_=>e(v).emit("global-search-toggle"))},[t(r,null,{default:o(()=>[t(a,{name:"ep:search"})]),_:1})])):c("",!0),e(n).mode==="pc"&&e(n).settings.toolbar.enableFullscreen?(l(),u("span",{key:1,class:"item",onClick:s[1]||(s[1]=(..._)=>e(h)&&e(h)(..._))},[t(r,null,{default:o(()=>[t(a,{name:e(N)?"fullscreen-exit":"fullscreen"},null,8,["name"])]),_:1})])):c("",!0),e(n).settings.toolbar.enablePageReload?(l(),u("span",{key:2,class:"item",onClick:s[2]||(s[2]=_=>e(B).reload())},[t(r,null,{default:o(()=>[t(a,{name:"ep:refresh-right"})]),_:1})])):c("",!0),e(n).settings.toolbar.enableColorScheme?(l(),u("span",{key:3,class:"item",onClick:s[3]||(s[3]=_=>e(n).setColorScheme(e(n).settings.app.colorScheme==="dark"?"light":"dark"))},[t(r,null,{default:o(()=>[y(t(a,{name:"ep:sunny"},null,512),[[S,e(n).settings.app.colorScheme==="light"]]),y(t(a,{name:"ep:moon"},null,512),[[S,e(n).settings.app.colorScheme==="dark"]])]),_:1})])):c("",!0)]),t(V,{class:"user-container",size:"default",onCommand:T},{dropdown:o(()=>[t(P,{class:"user-dropdown"},{default:o(()=>[e(n).settings.home.enable?(l(),w(m,{key:0,command:"home"},{default:o(()=>[d(C(e(n).settings.home.title),1)]),_:1})):c("",!0),t(m,{command:"setting"},{default:o(()=>[d(" 个人设置 ")]),_:1}),e(n).mode==="pc"?(l(),w(m,{key:1,divided:"",command:"hotkeys"},{default:o(()=>[d(" 快捷键介绍 ")]),_:1})):c("",!0),t(m,{divided:"",command:"logout"},{default:o(()=>[d(" 退出登录 ")]),_:1})]),_:1})]),default:o(()=>[k("div",J,[t($,{size:"small"},{default:o(()=>[t(r,null,{default:o(()=>[t(a,{name:"ep:user-filled"})]),_:1})]),_:1}),d(" "+C(`${e(f).username||"Nine Ai"} `)+" ",1),t(r,null,{default:o(()=>[t(a,{name:"ep:caret-bottom"})]),_:1})])]),_:1})])}}});const G=I(q,[["__scopeId","data-v-ad60bb95"]]),L=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{G as T,L as i,R as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{d as o,Z as c,B as a,o as r,I as i,$ as l,b as e,a0 as m}from"./index-a4526b0d.js";const d=o({__name:"index",props:{icon:null},setup(t){const s=c(),n=a(()=>({class:s.class||"",style:s.style||"width: 2em, height: 2em"}));return(p,u)=>(r(),i(e(m),l({icon:t.icon},e(n)),null,16,["icon"]))}});export{d as _}; import{d as o,Z as c,B as a,o as r,I as i,$ as l,b as e,a0 as m}from"./index-4eef28ae.js";const d=o({__name:"index",props:{icon:null},setup(t){const s=c(),n=a(()=>({class:s.class||"",style:s.style||"width: 2em, height: 2em"}));return(p,u)=>(r(),i(e(m),l({icon:t.icon},e(n)),null,16,["icon"]))}});export{d as _};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as m}from"./index-5e1cba81.js";import{d as i,o as a,c as k,e as t,f as e,I as f,a as s,t as v,b as _,k as h,T as b,g as w,_ as g,h as c,p as x,i as y,n as I}from"./index-a4526b0d.js";const V=n=>(x("data-v-7b059d41"),n=n(),y(),n),B={class:"link-view"},C={class:"container"},S=V(()=>s("div",{class:"title"}," 是否访问此链接 ",-1)),N={class:"link"},T=i({name:"LinkView"}),L=i({...T,setup(n){const o=w();function l(){window.open(o.meta.link,"_blank")}return(D,E)=>{const p=g,d=c("el-icon"),r=c("el-button"),u=m;return a(),k("div",B,[t(b,{name:"link",mode:"out-in",appear:""},{default:e(()=>[(a(),f(u,{key:_(o).meta.link,title:"⚠️访问提醒"},{default:e(()=>[s("div",C,[S,s("div",N,v(_(o).meta.link),1),t(r,{type:"primary",plain:"",round:"",onClick:l},{icon:e(()=>[t(d,null,{default:e(()=>[t(p,{name:"ep:link"})]),_:1})]),default:e(()=>[h(" 立即访问 ")]),_:1})])]),_:1}))]),_:1})])}}});const j=I(L,[["__scopeId","data-v-7b059d41"]]);export{j as default}; import{_ as m}from"./index-7911c6db.js";import{d as i,o as a,c as k,e as t,f as e,I as f,a as s,t as v,b as _,k as h,T as b,g as w,_ as g,h as c,p as x,i as y,n as I}from"./index-4eef28ae.js";const V=n=>(x("data-v-7b059d41"),n=n(),y(),n),B={class:"link-view"},C={class:"container"},S=V(()=>s("div",{class:"title"}," 是否访问此链接 ",-1)),N={class:"link"},T=i({name:"LinkView"}),L=i({...T,setup(n){const o=w();function l(){window.open(o.meta.link,"_blank")}return(D,E)=>{const p=g,d=c("el-icon"),r=c("el-button"),u=m;return a(),k("div",B,[t(b,{name:"link",mode:"out-in",appear:""},{default:e(()=>[(a(),f(u,{key:_(o).meta.link,title:"⚠️访问提醒"},{default:e(()=>[s("div",C,[S,s("div",N,v(_(o).meta.link),1),t(r,{type:"primary",plain:"",round:"",onClick:l},{icon:e(()=>[t(d,null,{default:e(()=>[t(p,{name:"ep:link"})]),_:1})]),default:e(()=>[h(" 立即访问 ")]),_:1})])]),_:1}))]),_:1})])}}});const j=I(L,[["__scopeId","data-v-7b059d41"]]);export{j as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
* Github https://github.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin
*/ */
import{_ as j}from"./index-5e1cba81.js";import{a as _}from"./config-33902e1a.js";import{d as H,Q as N,r as p,x as S,o as g,c as h,e as t,f as l,a as y,k as b,R as E,S as G,E as P,h as a,t as U,q as L}from"./index-a4526b0d.js";const B={class:"flex justify-between"},R=y("b",null,"客户端动态菜单设置参数设置",-1),D=H({__name:"logo",setup(J){const x=[{label:"ChatGpt聊天",path:"/chat"},{label:"Dall-E绘画",path:"/draw"},{label:"Midjourney绘画",path:"/midjourney"},{label:"mj公共预览页",path:"/market"},{label:"mind思维导图",path:"/mind"},{label:"应用广场",path:"/app-store"},{label:"不指定首页",path:""}],n=N({clientMenuList:[],clientHomePath:"",clientLogoPath:"",clientFavoIconPath:""}),v=p({clientHomePath:[{required:!1,trigger:"change",message:"请选择项目默认主页地址"}],clientMenuList:[{required:!1,trigger:"change",message:"请选择客户端开放的菜单"}],clientLogoPath:[{required:!1,trigger:"blur",message:"请填写您的网站LOGO图片链接"}],clientFavoIconPath:[{required:!1,trigger:"blur",message:"请填写您的网站favorit.ico网站logo地址"}]}),u=p();async function d(){const o=await _.queryConfig({keys:["clientHomePath","clientMenuList","clientLogoPath","clientFavoIconPath"]}),e=o.data;e.clientMenuList=e.clientMenuList?JSON.parse(e.clientMenuList):[],Object.assign(n,o.data)}function V(){var o;(o=u.value)==null||o.validate(async e=>{if(e){try{await _.setConfig({settings:C(n)}),P.success("变更配置信息成功")}catch{}d()}else P.error("请填写完整信息")})}function M(o,e){if(["clientMenuList"].includes(o)){if(!e)return[];if(e)return JSON.stringify(e)}else return e}function C(o){return Object.keys(o).map(e=>({configKey:e,configVal:M(e,o[e])}))}return S(()=>{d()}),(o,e)=>{const m=a("el-alert"),O=j,w=a("el-button"),k=a("el-radio"),q=a("el-radio-group"),r=a("el-form-item"),i=a("el-col"),c=a("el-row"),f=a("el-input"),F=a("el-form"),I=a("el-card");return g(),h("div",null,[t(O,null,{default:l(()=>[t(m,{closable:!1,"show-icon":"",title:"动态菜单配置说明",description:"动态菜单继承到下方、用户端logo配置在客户端左上角、ico为网站图标请使用svg格式、可以在线转格式",type:"success"})]),_:1}),t(I,{style:{margin:"20px"}},{header:l(()=>[y("div",B,[R,t(w,{class:"button",text:"",onClick:V},{default:l(()=>[b(" 保存设置 ")]),_:1})])]),default:l(()=>[t(F,{ref_key:"formRef",ref:u,rules:v.value,model:n,"label-width":"130px"},{default:l(()=>[t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"设置指定首页",prop:"clientHomePath"},{default:l(()=>[t(q,{modelValue:n.clientHomePath,"onUpdate:modelValue":e[0]||(e[0]=s=>n.clientHomePath=s)},{default:l(()=>[(g(),h(E,null,G(x,s=>t(k,{key:s.path,size:"small",border:"",label:s.path},{default:l(()=>[b(U(s.label),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"用户端LOGO",prop:"clientLogoPath"},{default:l(()=>[t(f,{modelValue:n.clientLogoPath,"onUpdate:modelValue":e[1]||(e[1]=s=>n.clientLogoPath=s),placeholder:"请填写您要设置的网站LOGO图片链接",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"用户端ico",prop:"clientFavoIconPath"},{default:l(()=>[t(f,{modelValue:n.clientFavoIconPath,"onUpdate:modelValue":e[2]||(e[2]=s=>n.clientFavoIconPath=s),placeholder:"请填写您要设置的网站ico地址、格式为svg",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof L=="function"&&L(D);export{D as default}; import{_ as j}from"./index-7911c6db.js";import{a as _}from"./config-b4a9e7c0.js";import{d as H,Q as N,r as p,x as S,o as g,c as h,e as t,f as l,a as y,k as b,R as E,S as G,E as P,h as a,t as U,q as L}from"./index-4eef28ae.js";const B={class:"flex justify-between"},R=y("b",null,"客户端动态菜单设置参数设置",-1),D=H({__name:"logo",setup(J){const x=[{label:"ChatGpt聊天",path:"/chat"},{label:"Dall-E绘画",path:"/draw"},{label:"Midjourney绘画",path:"/midjourney"},{label:"mj公共预览页",path:"/market"},{label:"mind思维导图",path:"/mind"},{label:"应用广场",path:"/app-store"},{label:"不指定首页",path:""}],n=N({clientMenuList:[],clientHomePath:"",clientLogoPath:"",clientFavoIconPath:""}),v=p({clientHomePath:[{required:!1,trigger:"change",message:"请选择项目默认主页地址"}],clientMenuList:[{required:!1,trigger:"change",message:"请选择客户端开放的菜单"}],clientLogoPath:[{required:!1,trigger:"blur",message:"请填写您的网站LOGO图片链接"}],clientFavoIconPath:[{required:!1,trigger:"blur",message:"请填写您的网站favorit.ico网站logo地址"}]}),u=p();async function d(){const o=await _.queryConfig({keys:["clientHomePath","clientMenuList","clientLogoPath","clientFavoIconPath"]}),e=o.data;e.clientMenuList=e.clientMenuList?JSON.parse(e.clientMenuList):[],Object.assign(n,o.data)}function V(){var o;(o=u.value)==null||o.validate(async e=>{if(e){try{await _.setConfig({settings:C(n)}),P.success("变更配置信息成功")}catch{}d()}else P.error("请填写完整信息")})}function M(o,e){if(["clientMenuList"].includes(o)){if(!e)return[];if(e)return JSON.stringify(e)}else return e}function C(o){return Object.keys(o).map(e=>({configKey:e,configVal:M(e,o[e])}))}return S(()=>{d()}),(o,e)=>{const m=a("el-alert"),O=j,w=a("el-button"),k=a("el-radio"),q=a("el-radio-group"),r=a("el-form-item"),i=a("el-col"),c=a("el-row"),f=a("el-input"),F=a("el-form"),I=a("el-card");return g(),h("div",null,[t(O,null,{default:l(()=>[t(m,{closable:!1,"show-icon":"",title:"动态菜单配置说明",description:"动态菜单继承到下方、用户端logo配置在客户端左上角、ico为网站图标请使用svg格式、可以在线转格式",type:"success"})]),_:1}),t(I,{style:{margin:"20px"}},{header:l(()=>[y("div",B,[R,t(w,{class:"button",text:"",onClick:V},{default:l(()=>[b(" 保存设置 ")]),_:1})])]),default:l(()=>[t(F,{ref_key:"formRef",ref:u,rules:v.value,model:n,"label-width":"130px"},{default:l(()=>[t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"设置指定首页",prop:"clientHomePath"},{default:l(()=>[t(q,{modelValue:n.clientHomePath,"onUpdate:modelValue":e[0]||(e[0]=s=>n.clientHomePath=s)},{default:l(()=>[(g(),h(E,null,G(x,s=>t(k,{key:s.path,size:"small",border:"",label:s.path},{default:l(()=>[b(U(s.label),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"用户端LOGO",prop:"clientLogoPath"},{default:l(()=>[t(f,{modelValue:n.clientLogoPath,"onUpdate:modelValue":e[1]||(e[1]=s=>n.clientLogoPath=s),placeholder:"请填写您要设置的网站LOGO图片链接",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(c,null,{default:l(()=>[t(i,{xs:24,md:24,lg:24,xl:24},{default:l(()=>[t(r,{label:"用户端ico",prop:"clientFavoIconPath"},{default:l(()=>[t(f,{modelValue:n.clientFavoIconPath,"onUpdate:modelValue":e[2]||(e[2]=s=>n.clientFavoIconPath=s),placeholder:"请填写您要设置的网站ico地址、格式为svg",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof L=="function"&&L(D);export{D as default};

Some files were not shown because too many files have changed in this diff Show More