This commit is contained in:
2024-11-29 01:46:00 +08:00
parent b67bc5d124
commit eba5e4988e
4 changed files with 60 additions and 97 deletions

View File

@@ -52,11 +52,11 @@ app
description: 'Deploy micro app',
})
.define(async (ctx) => {
// const { id, key} = ctx.query?.data;
const { id, key} = ctx.query?.data;
// const id = '10f03411-85fc-4d37-a4d3-e32b15566a6c';
// const key = 'envision-cli';
const id = '7c54a6de-9171-4093-926d-67a035042c6c';
const key = 'mark';
// const id = '7c54a6de-9171-4093-926d-67a035042c6c';
// const key = 'mark';
if (!id) {
ctx.throw(400, 'Invalid id');
}
@@ -85,8 +85,8 @@ app
description: 'Load micro app, no use',
})
.define(async (ctx) => {
// const { key } = ctx.query?.data;
const key = 'mark';
const { key } = ctx.query?.data;
// const key = 'mark';
try {
const main = await loadApp(key);
if (main?.loadApp) {
@@ -107,8 +107,8 @@ app
key: 'unload',
})
.define(async (ctx) => {
// const { key } = ctx.query?.data;
const key = 'mark';
const { key } = ctx.query?.data;
// const key = 'mark';
const main = manager.getAppShowInfo(key);
if (!main) {
ctx.throw(400, 'Invalid app');

View File

@@ -34,11 +34,14 @@ app
}
let user: User | null = null;
if (username) {
user = await User.findOne({ where: { username } });
user = await User.findOne({ where: { username }, logging: false });
}
if (!user && email) {
user = await User.findOne({ where: { email } });
}
console.log('user logiin', ctx.query)
console.log('user logiin', user)
console.log('users', (await User.findAll()).map(u => u.username))
if (!user) {
ctx.throw(500, 'Login Failed');
}