mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-10 16:12:50 +00:00
v8.x
This commit is contained in:
parent
bdb221ea15
commit
49ba7b54be
@ -74,10 +74,13 @@
|
||||
],
|
||||
"assets": [
|
||||
"public/**/*",
|
||||
"typings/**/*"
|
||||
"typings/**/*",
|
||||
"src/locales/**/*"
|
||||
],
|
||||
"targets": [
|
||||
"node20-macos-x64"
|
||||
"node20-macos-x64",
|
||||
"node20-linux-x64",
|
||||
"node20-win-x64"
|
||||
],
|
||||
"outputPath": "build"
|
||||
},
|
||||
|
||||
9860
pnpm-lock.yaml
generated
9860
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
BIN
public/Thumbs.db
Normal file
BIN
public/Thumbs.db
Normal file
Binary file not shown.
@ -10,7 +10,7 @@ import { availablePort } from '../comm/port';
|
||||
|
||||
export default {
|
||||
// 确保每个项目唯一,项目首次启动会自动生成
|
||||
keys: '576848ea-bb0c-4c0c-ac95-c8602ef908b5',
|
||||
keys: 'cool-admin-keys-xxxxxx',
|
||||
koa: {
|
||||
port: availablePort(8001),
|
||||
},
|
||||
|
||||
@ -10,36 +10,25 @@ export default {
|
||||
typeorm: {
|
||||
dataSource: {
|
||||
default: {
|
||||
type: 'sqlite',
|
||||
// 数据库文件地址
|
||||
database: pSqlitePath(),
|
||||
type: 'mysql',
|
||||
host: '127.0.0.1',
|
||||
port: 3306,
|
||||
username: 'root',
|
||||
password: '123456',
|
||||
database: 'cool',
|
||||
// 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
|
||||
synchronize: true,
|
||||
// 打印日志
|
||||
logging: false,
|
||||
// 字符集
|
||||
charset: 'utf8mb4',
|
||||
// 是否开启缓存
|
||||
cache: true,
|
||||
// 实体路径
|
||||
entities: ['**/modules/*/entity'],
|
||||
// 订阅者
|
||||
subscribers: [TenantSubscriber],
|
||||
},
|
||||
// default: {
|
||||
// type: 'mysql',
|
||||
// host: '127.0.0.1',
|
||||
// port: 3306,
|
||||
// username: 'root',
|
||||
// password: '123456',
|
||||
// database: 'cool',
|
||||
// // 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
|
||||
// synchronize: true,
|
||||
// // 打印日志
|
||||
// logging: false,
|
||||
// // 字符集
|
||||
// charset: 'utf8mb4',
|
||||
// // 是否开启缓存
|
||||
// cache: true,
|
||||
// // 实体路径
|
||||
// entities: ['**/modules/*/entity'],
|
||||
// },
|
||||
},
|
||||
},
|
||||
cool: {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { CoolConfig } from '@cool-midway/core';
|
||||
import { MidwayConfig } from '@midwayjs/core';
|
||||
import { entities } from '../entities';
|
||||
import { pSqlitePath } from '../comm/path';
|
||||
import { TenantSubscriber } from '../modules/base/db/tenant';
|
||||
|
||||
/**
|
||||
@ -11,13 +10,20 @@ export default {
|
||||
typeorm: {
|
||||
dataSource: {
|
||||
default: {
|
||||
type: 'sqlite',
|
||||
// 数据库文件地址
|
||||
database: pSqlitePath(),
|
||||
type: 'mysql',
|
||||
host: '127.0.0.1',
|
||||
port: 3306,
|
||||
username: 'root',
|
||||
password: '123456',
|
||||
database: 'cool',
|
||||
// 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
|
||||
synchronize: true,
|
||||
synchronize: false,
|
||||
// 打印日志
|
||||
logging: false,
|
||||
// 字符集
|
||||
charset: 'utf8mb4',
|
||||
// 是否开启缓存
|
||||
cache: true,
|
||||
// 实体路径
|
||||
entities,
|
||||
// 订阅者
|
||||
@ -27,12 +33,12 @@ export default {
|
||||
},
|
||||
cool: {
|
||||
// 实体与路径,跟生成代码、前端请求、swagger文档相关 注意:线上不建议开启,以免暴露敏感信息
|
||||
eps: true,
|
||||
eps: false,
|
||||
// 是否自动导入模块数据库
|
||||
initDB: true,
|
||||
initDB: false,
|
||||
// 判断是否初始化的方式
|
||||
initJudge: 'db',
|
||||
// 是否自动导入模块菜单
|
||||
initMenu: true,
|
||||
initMenu: false,
|
||||
} as CoolConfig,
|
||||
} as MidwayConfig;
|
||||
|
||||
@ -27,7 +27,7 @@ export default () => {
|
||||
// 单点登录
|
||||
sso: false,
|
||||
// 注意: 最好重新修改,防止破解
|
||||
secret: 'e43675a9-0ce5-4d50-8dd0-549dff19334c',
|
||||
secret: 'cool-admin-xxxxxx',
|
||||
// token
|
||||
token: {
|
||||
// 2小时过期,需要用刷新token
|
||||
|
||||
@ -78,7 +78,7 @@ export class BaseTranslateService {
|
||||
* 加载翻译文件到内存
|
||||
*/
|
||||
async loadTranslations() {
|
||||
if (!(this.config?.enable && this.app.getEnv() == 'local')) {
|
||||
if (!this.config?.enable) {
|
||||
return;
|
||||
}
|
||||
if (!this.basePath) {
|
||||
|
||||
@ -308,6 +308,10 @@ export class TaskLocalService extends BaseService {
|
||||
* 执行器
|
||||
*/
|
||||
async executor(task: any): Promise<void> {
|
||||
// 如果不是开始时间之后的 则不执行
|
||||
if (task.startDate && moment(task.startDate).isAfter(moment())) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const currentTime = moment();
|
||||
const lockExpireTime = moment().add(5, 'minutes');
|
||||
|
||||
@ -28,7 +28,7 @@ export default () => {
|
||||
// 刷新token 过期时间,单位秒
|
||||
refreshExpire: 60 * 60 * 24 * 30,
|
||||
// jwt 秘钥
|
||||
secret: '52dee820-a5d9-46ed-858b-ea193c3f84e2x',
|
||||
secret: 'cool-app-xxxxxx',
|
||||
},
|
||||
} as ModuleConfig;
|
||||
};
|
||||
|
||||
96
typings/feishu.d.ts
vendored
96
typings/feishu.d.ts
vendored
@ -1,96 +0,0 @@
|
||||
import { BasePlugin } from '@cool-midway/plugin-cli';
|
||||
import axios from 'axios';
|
||||
interface Message {
|
||||
/** 类型 */
|
||||
msg_type:
|
||||
| 'text'
|
||||
| 'post'
|
||||
| 'image'
|
||||
| 'file'
|
||||
| 'audio'
|
||||
| 'media'
|
||||
| 'sticker'
|
||||
| 'interactive'
|
||||
| 'share_chat'
|
||||
| 'share_user';
|
||||
/** 内容 */
|
||||
content: any;
|
||||
}
|
||||
/**
|
||||
* 飞书
|
||||
*/
|
||||
export declare class CoolPlugin extends BasePlugin {
|
||||
/**
|
||||
* 推送webHook消息
|
||||
* @param message
|
||||
* @returns
|
||||
*/
|
||||
sendByHook(message: Message): Promise<axios.AxiosResponse<any, any>>;
|
||||
/**
|
||||
* 推送应用消息
|
||||
* @param message 消息
|
||||
* @param options receive_id 接收人 receive_id_type 接收人类型 message_id 消息ID uuid 消息唯一ID
|
||||
* @returns
|
||||
*/
|
||||
sendByApp(
|
||||
message: Message,
|
||||
options: {
|
||||
receive_id: string;
|
||||
receive_id_type: 'open_id' | 'user_id' | 'chat_id' | 'union_id' | 'email';
|
||||
message_id?: string;
|
||||
uuid?: string;
|
||||
},
|
||||
): Promise<axios.AxiosResponse<any, any>>;
|
||||
/**
|
||||
* 上传图片
|
||||
* @param filePath 文件路径
|
||||
* @param image_type message 用于发送消息 avatar 用于设置头像
|
||||
* @returns
|
||||
*/
|
||||
uploadImage(
|
||||
filePath: string,
|
||||
image_type?: 'message' | 'avatar',
|
||||
): Promise<any>;
|
||||
/**
|
||||
* 上传文件
|
||||
* @param filePath 文件路径
|
||||
* @param file_type 文件类型
|
||||
* @returns
|
||||
*/
|
||||
uploadFile(
|
||||
filePath: any,
|
||||
file_type?: 'opus' | 'mp4' | 'pdf' | 'doc' | 'xls' | 'ppt' | 'stream',
|
||||
): Promise<any>;
|
||||
/**
|
||||
* 获得聊天列表,如:应用所在的群组
|
||||
* @returns
|
||||
*/
|
||||
chatList(): Promise<any>;
|
||||
/**
|
||||
*获得用户信息
|
||||
* @param options emails 邮箱数组,mobiles 手机号数组 不能同时为空 include_resigned 是否包含离职员工
|
||||
* @returns
|
||||
*/
|
||||
getUserInfos(options: {
|
||||
emails?: string[];
|
||||
mobiles?: string[];
|
||||
include_resigned?: boolean;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* 使用手机号或邮箱获取用户 ID
|
||||
* @param options emails 邮箱数组,mobiles 手机号数组 不能同时为空 include_resigned 是否包含离职员工
|
||||
* @returns
|
||||
*/
|
||||
getUserIds(options: {
|
||||
emails?: string[];
|
||||
mobiles?: string[];
|
||||
include_resigned?: boolean;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* 获得token
|
||||
* @returns
|
||||
*/
|
||||
getToken(): Promise<any>;
|
||||
}
|
||||
export declare const Plugin: typeof CoolPlugin;
|
||||
export {};
|
||||
2
typings/plugin.d.ts
vendored
2
typings/plugin.d.ts
vendored
@ -1,4 +1,3 @@
|
||||
import * as feishu from './feishu';
|
||||
import { BaseUpload, MODETYPE } from './upload';
|
||||
type AnyString = string & {};
|
||||
/**
|
||||
@ -6,5 +5,4 @@ type AnyString = string & {};
|
||||
*/
|
||||
interface PluginMap {
|
||||
upload: BaseUpload;
|
||||
feishu: feishu.CoolPlugin;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user