mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-13 10:32:49 +00:00
兼容serverless部署,修改插件配置无需重启
This commit is contained in:
parent
5563a4adbf
commit
a59308fc6f
4
f.yml
4
f.yml
@ -6,3 +6,7 @@ provider:
|
||||
memorySize: 512
|
||||
|
||||
deployType: egg ## 部署的应用类型
|
||||
|
||||
package:
|
||||
include:
|
||||
- public/*
|
||||
@ -15,6 +15,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"md5": "^2.3.0",
|
||||
"midwayjs-cool-core": "/Users/ap/Documents/srcs/cool-admin/midway-core/core/dist",
|
||||
"midwayjs-cool-oss": "/Users/ap/Documents/srcs/cool-admin/midway-core/oss/dist",
|
||||
"midwayjs-cool-redis": "/Users/ap/Documents/srcs/cool-admin/midway-core/redis/dist",
|
||||
"midwayjs-cool-wxpay": "^1.0.10",
|
||||
"mysql2": "^2.2.5",
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
public/uploads/20210310/58564110-80f6-11eb-b397-8744a989342b.jpg
Normal file
BIN
public/uploads/20210310/58564110-80f6-11eb-b397-8744a989342b.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
BIN
public/uploads/20210310/7f62bea0-80f6-11eb-b397-8744a989342b.jpg
Normal file
BIN
public/uploads/20210310/7f62bea0-80f6-11eb-b397-8744a989342b.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
BIN
public/uploads/20210310/b22e6ff0-80f6-11eb-b397-8744a989342b.png
Normal file
BIN
public/uploads/20210310/b22e6ff0-80f6-11eb-b397-8744a989342b.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
1
public/uploads/说明.md
Normal file
1
public/uploads/说明.md
Normal file
@ -0,0 +1 @@
|
||||
文件上传目录
|
||||
@ -55,9 +55,7 @@ export class BaseAuthorityMiddleware implements IWebMiddleware {
|
||||
return;
|
||||
}
|
||||
// 需要动态获得缓存
|
||||
this.coolCache = await this.app
|
||||
.getApplicationContext()
|
||||
.getAsync('cool:cache');
|
||||
this.coolCache = await ctx.requestContext.getAsync('cool:cache');
|
||||
// 判断密码版本是否正确
|
||||
const passwordV = await this.coolCache.get(
|
||||
`admin:passwordVersion:${ctx.admin.userId}`
|
||||
|
||||
@ -24,7 +24,7 @@ export default (appInfo: EggAppInfo) => {
|
||||
// 靜態目錄及緩存設置
|
||||
config.static = {
|
||||
prefix: '/',
|
||||
dir: path.join(appInfo.baseDir, 'app/public'),
|
||||
dir: path.join(appInfo.baseDir, '..', 'public'),
|
||||
dynamic: true,
|
||||
preload: false,
|
||||
// maxAge: 31536000,
|
||||
|
||||
@ -4,7 +4,7 @@ import { Application } from 'egg';
|
||||
import * as orm from '@midwayjs/orm';
|
||||
import * as cool from 'midwayjs-cool-core';
|
||||
import * as wxpay from 'midwayjs-cool-wxpay';
|
||||
// import * as oss from 'midwayjs-cool-oss';
|
||||
import * as oss from 'midwayjs-cool-oss';
|
||||
import * as redis from 'midwayjs-cool-redis';
|
||||
// import * as queue from 'midwayjs-cool-queue';
|
||||
// import * as alipay from 'midwayjs-cool-alipay';
|
||||
@ -18,7 +18,7 @@ import * as redis from 'midwayjs-cool-redis';
|
||||
// 必须,不可移除, cool-admin 官方组件 https://www.cool-js.com
|
||||
cool,
|
||||
// oss插件,需要到后台配置之后才有用,默认是本地上传
|
||||
//oss,
|
||||
oss,
|
||||
// 将缓存替换成redis
|
||||
redis,
|
||||
// 队列
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user