feat: some add auth

This commit is contained in:
2024-10-02 00:22:54 +08:00
parent 6f0535e2ef
commit 8436b0462a
12 changed files with 203 additions and 2 deletions

View File

@@ -40,8 +40,10 @@ app
const add = app.route({
path: 'container',
key: 'update',
middleware: ['auth'],
});
add.run = async (ctx) => {
const tokenUser = ctx.state.tokenUser;
const data = ctx.query.data;
const _data: Container = {
@@ -72,6 +74,7 @@ add.run = async (ctx) => {
...container,
source: '',
sourceType: '',
uid: tokenUser.id,
});
} catch (e) {
console.log('error', e);