diff --git a/api/api_v1/endpoints/dashboard.py b/api/api_v1/endpoints/dashboard.py index e5f1d4d..58d84c8 100644 --- a/api/api_v1/endpoints/dashboard.py +++ b/api/api_v1/endpoints/dashboard.py @@ -210,7 +210,7 @@ async def edit_report(data_in: schemas.EditReport, db: AsyncIOMotorDatabase = Depends(get_database), current_user: schemas.UserDB = Depends(deps.get_current_user) ): - """编辑报表""" + """看板样式设置""" res = await crud.dashboard.update_one(db, {'_id': data_in.id, 'reports.report_id': data_in.report.report_id}, {'$set': {f'reports.$.{k}': v for k, v in diff --git a/api/api_v1/endpoints/project.py b/api/api_v1/endpoints/project.py index 7e40058..9a00e6b 100644 --- a/api/api_v1/endpoints/project.py +++ b/api/api_v1/endpoints/project.py @@ -25,6 +25,20 @@ async def create( try: res_project = await crud.project.create(db, data_in, current_user=request.user) await crud.project_number.createxiangmu(db, data_in) + # game = data_in.game + # name = ['乐谷管理员', '发行方管理员'] + # # path列表 + # res = await crud.api_board.all_api(db) + # for i in name: + # path_list = [] + # for data in res: + # if data['name'] == i: + # path_list.append(data['api_path']) + # # 存管理员角色 + # id = await crud.role.add_role_project(db, game, i) + # for path in path_list: + # # 存路径 + # casbin_enforcer.add_policy(id, game, path, '*') except pymongo.errors.DuplicateKeyError: return schemas.Msg(code=-1, msg='项目名已存在', data='项目名已存在') @@ -312,6 +326,7 @@ async def read_kanban( res['spaces'][-1]['children'].append({ 'name': d['name'], '_id': d['_id'], + 'user_id':d['user_id'], 'isFolder': False }) diff --git a/api/api_v1/endpoints/user.py b/api/api_v1/endpoints/user.py index b38b2f5..d73ce4a 100644 --- a/api/api_v1/endpoints/user.py +++ b/api/api_v1/endpoints/user.py @@ -40,6 +40,7 @@ async def login( 'nickname': user.nickname, 'email': user.email, 'tel': user.tel, + 'userid':user.id, 'token': security.create_access_token( expires_delta=access_token_expires, _id=str(user.id), email=user.email,