diff --git a/app/controllers/api/v1/issues/issue_priorities_controller.rb b/app/controllers/api/v1/issues/issue_priorities_controller.rb index c3a223a90..2df1288f7 100644 --- a/app/controllers/api/v1/issues/issue_priorities_controller.rb +++ b/app/controllers/api/v1/issues/issue_priorities_controller.rb @@ -8,7 +8,7 @@ class Api::V1::Issues::IssuePrioritiesController < Api::V1::BaseController @priorities = kaminary_select_paginate(@priorities) end - def mp_index + def pm_index @priorities = IssuePriority.order(position: :asc) @priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword] @priorities = kaminary_select_paginate(@priorities) diff --git a/app/controllers/api/v1/issues/issue_tags_controller.rb b/app/controllers/api/v1/issues/issue_tags_controller.rb index e77b5425f..39534c313 100644 --- a/app/controllers/api/v1/issues/issue_tags_controller.rb +++ b/app/controllers/api/v1/issues/issue_tags_controller.rb @@ -1,5 +1,5 @@ class Api::V1::Issues::IssueTagsController < Api::V1::BaseController - before_action :require_login, except: [:index, :mp_index] + before_action :require_login, except: [:index, :pm_index] before_action :require_public_and_member_above, only: [:index] before_action :require_operate_above, only: [:create, :update, :destroy] @@ -13,7 +13,7 @@ class Api::V1::Issues::IssueTagsController < Api::V1::BaseController end end - def mp_index + def pm_index @issue_tags = IssueTag.init_mp_issues_tags render_ok(@issue_tags) end diff --git a/app/controllers/api/v1/issues/statues_controller.rb b/app/controllers/api/v1/issues/statues_controller.rb index 3e2a837ee..c6495ee26 100644 --- a/app/controllers/api/v1/issues/statues_controller.rb +++ b/app/controllers/api/v1/issues/statues_controller.rb @@ -9,7 +9,7 @@ class Api::V1::Issues::StatuesController < Api::V1::BaseController @statues = kaminary_select_paginate(@statues) end - def mp_index + def pm_index @statues = IssueStatus.order("position asc") @statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present? @statues = kaminary_select_paginate(@statues) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 4949946c0..cedefd1fe 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -229,6 +229,7 @@ class AttachmentsController < ApplicationController end tip_exception(403, "您没有权限进入") if project.present? && !candown end + tip_exception(403, "您没有权限查看") if project.present? && !candown if @file.is_public == 0 && author_id != current_user.id end end diff --git a/app/models/identity_verification.rb b/app/models/identity_verification.rb index 3c8c88d9b..6ea6e0547 100644 --- a/app/models/identity_verification.rb +++ b/app/models/identity_verification.rb @@ -23,7 +23,10 @@ class IdentityVerification < ApplicationRecord belongs_to :user enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2} - + after_create do + Attachment.where(id:[card_front,card_back,hold_card_front,hold_card_back]).update_all(is_public:0) + end + after_save do if state == "已通过" user.update(id_card_verify: true, website_permission: true) diff --git a/app/models/issue.rb b/app/models/issue.rb index 4420ed18e..14876da63 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -34,6 +34,8 @@ # ref_name :string(255) # branch_name :string(255) # blockchain_token_num :integer +# pm_project_id :integer +# pm_sprint_id :integer # # Indexes # diff --git a/config/routes/api.rb b/config/routes/api.rb index b6698996f..41d331168 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -57,20 +57,20 @@ defaults format: :json do scope module: :issues do resources :issue_tags, except: [:new, :edit] do collection do - get :mp_index + get :pm_index end end resources :milestones, except: [:new, :edit] resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues' do collection do - get :mp_index + get :pm_index end end resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors' resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners' resources :issue_priorities, only: [:index] do collection do - get :mp_index + get :pm_index end end end diff --git a/db/migrate/20231018034251_add_pm_project_id_and_pm_sprint_id_to_issues.rb b/db/migrate/20231018034251_add_pm_project_id_and_pm_sprint_id_to_issues.rb new file mode 100644 index 000000000..2c75693fb --- /dev/null +++ b/db/migrate/20231018034251_add_pm_project_id_and_pm_sprint_id_to_issues.rb @@ -0,0 +1,6 @@ +class AddPmProjectIdAndPmSprintIdToIssues < ActiveRecord::Migration[5.2] + def change + add_column :issues, :pm_project_id , :integer + add_column :issues, :pm_sprint_id , :integer + end +end