| @@ -8,7 +8,7 @@ class Api::V1::Issues::IssuePrioritiesController < Api::V1::BaseController | |||||
| @priorities = kaminary_select_paginate(@priorities) | @priorities = kaminary_select_paginate(@priorities) | ||||
| end | end | ||||
| def mp_index | |||||
| def pm_index | |||||
| @priorities = IssuePriority.order(position: :asc) | @priorities = IssuePriority.order(position: :asc) | ||||
| @priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword] | @priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword] | ||||
| @priorities = kaminary_select_paginate(@priorities) | @priorities = kaminary_select_paginate(@priorities) | ||||
| @@ -1,5 +1,5 @@ | |||||
| class Api::V1::Issues::IssueTagsController < Api::V1::BaseController | 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_public_and_member_above, only: [:index] | ||||
| before_action :require_operate_above, only: [:create, :update, :destroy] | before_action :require_operate_above, only: [:create, :update, :destroy] | ||||
| @@ -13,7 +13,7 @@ class Api::V1::Issues::IssueTagsController < Api::V1::BaseController | |||||
| end | end | ||||
| end | end | ||||
| def mp_index | |||||
| def pm_index | |||||
| @issue_tags = IssueTag.init_mp_issues_tags | @issue_tags = IssueTag.init_mp_issues_tags | ||||
| render_ok(@issue_tags) | render_ok(@issue_tags) | ||||
| end | end | ||||
| @@ -9,7 +9,7 @@ class Api::V1::Issues::StatuesController < Api::V1::BaseController | |||||
| @statues = kaminary_select_paginate(@statues) | @statues = kaminary_select_paginate(@statues) | ||||
| end | end | ||||
| def mp_index | |||||
| def pm_index | |||||
| @statues = IssueStatus.order("position asc") | @statues = IssueStatus.order("position asc") | ||||
| @statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present? | @statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present? | ||||
| @statues = kaminary_select_paginate(@statues) | @statues = kaminary_select_paginate(@statues) | ||||
| @@ -229,6 +229,7 @@ class AttachmentsController < ApplicationController | |||||
| end | end | ||||
| tip_exception(403, "您没有权限进入") if project.present? && !candown | tip_exception(403, "您没有权限进入") if project.present? && !candown | ||||
| end | end | ||||
| tip_exception(403, "您没有权限查看") if project.present? && !candown if @file.is_public == 0 && author_id != current_user.id | |||||
| end | end | ||||
| end | end | ||||
| @@ -23,7 +23,10 @@ | |||||
| class IdentityVerification < ApplicationRecord | class IdentityVerification < ApplicationRecord | ||||
| belongs_to :user | belongs_to :user | ||||
| enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2} | 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 | after_save do | ||||
| if state == "已通过" | if state == "已通过" | ||||
| user.update(id_card_verify: true, website_permission: true) | user.update(id_card_verify: true, website_permission: true) | ||||
| @@ -34,6 +34,8 @@ | |||||
| # ref_name :string(255) | # ref_name :string(255) | ||||
| # branch_name :string(255) | # branch_name :string(255) | ||||
| # blockchain_token_num :integer | # blockchain_token_num :integer | ||||
| # pm_project_id :integer | |||||
| # pm_sprint_id :integer | |||||
| # | # | ||||
| # Indexes | # Indexes | ||||
| # | # | ||||
| @@ -57,20 +57,20 @@ defaults format: :json do | |||||
| scope module: :issues do | scope module: :issues do | ||||
| resources :issue_tags, except: [:new, :edit] do | resources :issue_tags, except: [:new, :edit] do | ||||
| collection do | collection do | ||||
| get :mp_index | |||||
| get :pm_index | |||||
| end | end | ||||
| end | end | ||||
| resources :milestones, except: [:new, :edit] | resources :milestones, except: [:new, :edit] | ||||
| resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues' do | resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues' do | ||||
| collection do | collection do | ||||
| get :mp_index | |||||
| get :pm_index | |||||
| end | end | ||||
| end | end | ||||
| resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors' | resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors' | ||||
| resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners' | resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners' | ||||
| resources :issue_priorities, only: [:index] do | resources :issue_priorities, only: [:index] do | ||||
| collection do | collection do | ||||
| get :mp_index | |||||
| get :pm_index | |||||
| end | end | ||||
| end | end | ||||
| end | end | ||||
| @@ -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 | |||||