|
@@ -1,600 +1,765 @@
|
|
|
-import Http from './http'
|
|
|
-import Apis from './api'
|
|
|
-import ProvinceJson from '../constants/provinceCity'
|
|
|
-import {} from './reportService'
|
|
|
-import {} from './projectService'
|
|
|
-import {} from './taskService'
|
|
|
-import {} from './userService'
|
|
|
-import {} from './generalService'
|
|
|
-import {} from './fileService'
|
|
|
+import {
|
|
|
+ deleteAuthInfo,
|
|
|
+ getAllAuthentications,
|
|
|
+ getAuthUrls,
|
|
|
+ getCurrentAuthenInfo,
|
|
|
+ getCurrentUser,
|
|
|
+ getRolesPermissions,
|
|
|
+ logout,
|
|
|
+ updateAgencyAuthInfo,
|
|
|
+ updateEnterpriseAuthInfo,
|
|
|
+ updateIndividualAuthInfo,
|
|
|
+ uploadAgencyAuthenticationInfo,
|
|
|
+ uploadEnterpriseAuthenticationInfo,
|
|
|
+ uploadIndividualAuthenticationInfo,
|
|
|
+} from './userService'
|
|
|
+import {
|
|
|
+ createProject,
|
|
|
+ deleteProject,
|
|
|
+ ensureEndProject,
|
|
|
+ getProject,
|
|
|
+ receiveProjectRequest,
|
|
|
+ rejectProject,
|
|
|
+ submitProjectRequest,
|
|
|
+ updateProject
|
|
|
+} from './projectService'
|
|
|
+import {
|
|
|
+ createTask,
|
|
|
+ deleteTask,
|
|
|
+ ensureEndTask,
|
|
|
+ getTask,
|
|
|
+ receiveTaskRequest,
|
|
|
+ rejectTask,
|
|
|
+ submitTaskRequest,
|
|
|
+ updateTask
|
|
|
+} from './taskService'
|
|
|
+import {
|
|
|
+ createProjectReport,
|
|
|
+ createTaskReport,
|
|
|
+ deleteProjectReport,
|
|
|
+ deleteTaskReport,
|
|
|
+ getProjectReport,
|
|
|
+ getTaskReport,
|
|
|
+ updateProjectReport,
|
|
|
+ updateTaskReport,
|
|
|
+} from './reportService'
|
|
|
+import {beforeUploadFile, beforeUploadImage, checkFileType, uploadFile, uploadImage,} from './fileService'
|
|
|
+import {
|
|
|
+ getAllAbilities,
|
|
|
+ getAllAgencies,
|
|
|
+ getAllAgencyResourceTypes,
|
|
|
+ getAllInstitutions,
|
|
|
+ getAllPlatformTypes,
|
|
|
+ getAllReportTypes,
|
|
|
+ getAllServiceTypes,
|
|
|
+ getGreenChannelAddProjectExcelTemplateFile,
|
|
|
+ getProvinceCodeByProvinceName,
|
|
|
+ getProvinceNameByProvinceCode,
|
|
|
+ getUserIdentity,
|
|
|
+ storageGet,
|
|
|
+ storageSave
|
|
|
+} from './generalService'
|
|
|
|
|
|
export {
|
|
|
- //获取用户信息
|
|
|
- //用户登出
|
|
|
-
|
|
|
- //创建项目
|
|
|
- //修改项目
|
|
|
- //获取项目
|
|
|
- //删除项目
|
|
|
-
|
|
|
- //创建任务
|
|
|
- //修改任务
|
|
|
- //获取任务
|
|
|
- //删除任务
|
|
|
-
|
|
|
- //创建项目报告
|
|
|
- //创建任务报告
|
|
|
- //修改项目报告
|
|
|
- //修改任务报告
|
|
|
- //获取项目报告详情
|
|
|
- //获取任务报告详情
|
|
|
- //删除项目报告
|
|
|
- //删除任务报告
|
|
|
-
|
|
|
- //上传图片
|
|
|
- //上传文档
|
|
|
- //校验上传格式
|
|
|
- //上传需求文档
|
|
|
- //上传安装包
|
|
|
- //上传批量创建项目文件
|
|
|
-}
|
|
|
-
|
|
|
-export const defaultValue = {
|
|
|
- name: '普通用户',
|
|
|
- image: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
-}
|
|
|
-
|
|
|
-//存session
|
|
|
-export const storageSave = (key, value) => {
|
|
|
- sessionStorage.setItem(key, JSON.stringify(value))
|
|
|
-}
|
|
|
-
|
|
|
-//取session
|
|
|
-export const storageGet = (key) => {
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(JSON.parse(sessionStorage.getItem(key)))
|
|
|
- // })
|
|
|
- return JSON.parse(sessionStorage.getItem(key))
|
|
|
-}
|
|
|
-
|
|
|
-//获取用户id
|
|
|
-export const getUserIdentity = () => {
|
|
|
- return Http.get(Apis.USER.GET_USER_IDENTITY)
|
|
|
-}
|
|
|
-
|
|
|
-//获取用户信息
|
|
|
-export const getCurrentUser = () => {
|
|
|
- // const data = {
|
|
|
- // userVO: {
|
|
|
- // id: 3,
|
|
|
- // photo: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
- // name: '郭超',
|
|
|
- // roleList: ['区域管理员', '个人用户', '企业用户', '测评机构', '系统管理员'],
|
|
|
- // mobile: '110',
|
|
|
- // email: '12345@qq.com',
|
|
|
- // },
|
|
|
- // agency: '',
|
|
|
- // }
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(data)
|
|
|
- // })
|
|
|
- return Http.get(Apis.USER.GET_CURRENT_USER)
|
|
|
-}
|
|
|
-//
|
|
|
-export const getRolesPermissions = (roleList) => {
|
|
|
- const roles = {
|
|
|
- regionManager: 'RegionalManager',
|
|
|
- individualUser: 'generalUser',
|
|
|
- enterpriseUser: 'enterpriseUser',
|
|
|
- agency: 'evaluationAgency',
|
|
|
- systemAdministrator: 'SystemAdministrator'
|
|
|
- }
|
|
|
- const permissions = {
|
|
|
- isRegionManager: false,
|
|
|
- isIndividualUser: false,
|
|
|
- isEnterpriseUser: false,
|
|
|
- isAgency: false,
|
|
|
- isSystemAdministrator: false
|
|
|
- }
|
|
|
- if (roleList.includes(roles.regionManager)) {
|
|
|
- permissions.isRegionManager = true
|
|
|
- permissions.isEnterpriseUser = true
|
|
|
- permissions.isIndividualUser = true
|
|
|
- }
|
|
|
- if (roleList.includes(roles.agency)) {
|
|
|
- permissions.isAgency = true
|
|
|
- permissions.isEnterpriseUser = true
|
|
|
- permissions.isIndividualUser = true
|
|
|
- }
|
|
|
- if (roleList.includes(roles.enterpriseUser)) {
|
|
|
- permissions.isEnterpriseUser = true
|
|
|
- }
|
|
|
- if (roleList.includes(roles.individualUser)) {
|
|
|
- permissions.isIndividualUser = true
|
|
|
- }
|
|
|
- if (roleList.includes(roles.systemAdministrator)) {
|
|
|
- permissions.isSystemAdministrator = true
|
|
|
- permissions.isRegionManager = true
|
|
|
- permissions.isAgency = true
|
|
|
- permissions.isEnterpriseUser = true
|
|
|
- permissions.isIndividualUser = true
|
|
|
- }
|
|
|
- return permissions
|
|
|
-}
|
|
|
-
|
|
|
-export const logout = () => {
|
|
|
- sessionStorage.removeItem('user')
|
|
|
- sessionStorage.removeItem('rolesPermissions')
|
|
|
- return Http.get(Apis.USER.LOGOUT)
|
|
|
-}
|
|
|
-
|
|
|
-//上传文档
|
|
|
-export const uploadFile = (url, file) => {
|
|
|
- const formData = new FormData()
|
|
|
- let config = {
|
|
|
- //添加请求头
|
|
|
- headers: {'Content-Type': 'multipart/form-data'},
|
|
|
- }
|
|
|
- formData.append('file', file)
|
|
|
- return Http.upload(url, formData, config)
|
|
|
-}
|
|
|
-
|
|
|
-//上传图片
|
|
|
-export const uploadImage = (file, uploadImageSuccess, uploadImageFail) => {
|
|
|
- const formData = new FormData()
|
|
|
- let config = {
|
|
|
- //添加请求头
|
|
|
- headers: {'Content-Type': 'multipart/form-data'},
|
|
|
- }
|
|
|
- formData.append('file', file)
|
|
|
- Http.upload(Apis.FILE.UPLOAD_IMAGE, formData, config).then((res) => {
|
|
|
- uploadImageSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- uploadImageFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//上传图片前检测
|
|
|
-export const beforeUploadImage = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//上传文档前检测
|
|
|
-export const beforeUploadFile = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//创建项目
|
|
|
-export const createProject = (project) => {
|
|
|
- return Http.post(Apis.PROJECT.CREATE_PROJECT, project)
|
|
|
-}
|
|
|
-
|
|
|
-//修改项目
|
|
|
-export const updateProject = (project, projectId) => {
|
|
|
- return Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', projectId), project)
|
|
|
-}
|
|
|
-
|
|
|
-//查看项目
|
|
|
-export const getProject = (projectId) => {
|
|
|
- Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', projectId))
|
|
|
-}
|
|
|
-
|
|
|
-//删除项目
|
|
|
-export const deleteProject = (projectId, deleteProjectSuccess, deleteProjectFail) => {
|
|
|
- Http.put(Apis.PROJECT.DELETE_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
- deleteProjectSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- deleteProjectFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//区域管理员提出接收项目申请
|
|
|
-export const receiveProjectRequest = (projectId, userId, receiveProjectSuccess, receiveProjectFail) => {
|
|
|
- console.log('调用')
|
|
|
- Http.put(Apis.PROJECT.ACCEPT_PROJECT.replace('{projectId}', projectId).replace('{userId}', userId), {}).then((res) => {
|
|
|
- console.log(res)
|
|
|
- receiveProjectSuccess(res)
|
|
|
-
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
- receiveProjectFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//区域管理员拒绝项目
|
|
|
-export const rejectProject = (projectId, rejectProjectSuccess, rejectProjectFail) => {
|
|
|
- Http.put(Apis.PROJECT.REJECT_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
- rejectProjectSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- rejectProjectFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//区域管理员提出结束项目申请
|
|
|
-export const submitProjectRequest = (projectId, submitProjectReuqestSuccess, submitProjectRequestFail) => {
|
|
|
- Http.put(Apis.PROJECT.SUBMIT_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
- submitProjectReuqestSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- submitProjectRequestFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//用户确认结束项目
|
|
|
-export const ensureEndProject = (projectId, endProjectSuccess, endProjectFail) => {
|
|
|
- Http.put(Apis.PROJECT.END_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
- endProjectSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- endProjectFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//创建任务
|
|
|
-export const createTask = (projectId, task) => {
|
|
|
- return Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', projectId), task)
|
|
|
-}
|
|
|
-
|
|
|
-//修改任务
|
|
|
-export const updateTask = (projectId, taskId, task, updateTaskSuccess, updateTaskFail) => {
|
|
|
- Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), task).then((res) => {
|
|
|
- updateTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- updateTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//查看任务
|
|
|
-export const getTask = (projectId, taskId, getTaskSuccess, getTaskFail) => {
|
|
|
- Http.get(Apis.TASK.GET_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
- getTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- getTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//删除任务
|
|
|
-export const deleteTask = (projectId, taskId, deleteTaskSuccess, deleteTaskFail) => {
|
|
|
- Http.put(Apis.TASK.DELETE_TASK.replace('{projectId}', projectId).replace('taskId', taskId), {}).then((res) => {
|
|
|
- deleteTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- deleteTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//测评机构接受任务
|
|
|
-export const receiveTaskRequest = (projectId, taskId, userId, receiveTaskRequestSuccess, receiveTaskRequestFail) => {
|
|
|
- Http.put(Apis.TASK.ACCEPT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{userId}', userId), {}).then((res) => {
|
|
|
- receiveTaskRequestSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- receiveTaskRequestFail(error)
|
|
|
- })
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//测评机构提出结束任务申请
|
|
|
-export const submitTaskRequest = (projectId, taskId, submitTaskSuccess, submitTaskFail) => {
|
|
|
- Http.put(Apis.TASK.SUBMIT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
- submitTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- submitTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-export const rejectTask = (projectId, taskId, rejectTaskSuccess, rejectTaskFail) => {
|
|
|
- Http.put(Apis.TASK.REJECT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
- rejectTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- rejectTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//区域管理员确认结束任务
|
|
|
-export const ensureEndTask = (projectId, taskId, endTaskSuccess, endTaskFail) => {
|
|
|
- Http.put(Apis.TASK.END_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
- endTaskSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- endTaskFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//创建项目报告
|
|
|
-export const createProjectReport = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//创建任务报告
|
|
|
-export const createTaskReport = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//修改项目报告
|
|
|
-export const updateProjectReport = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//修改任务报告
|
|
|
-export const updateTaskReport = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//查看报告
|
|
|
-export const getReport = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//删除项目报告
|
|
|
-export const deleteProjectReport = (projectId, reportId, deleteProjectReportSuccess, deleteProjectReportFail) => {
|
|
|
- Http.put(Apis.REPORT.DELETE_PROJECT_REPORT.replace('{projectId}', projectId).replace('{reportId}', reportId), {}).then((res) => {
|
|
|
- deleteProjectReportSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- deleteProjectReportFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//删除任务报告
|
|
|
-export const deleteTaskReport = (projectId, taskId, reportId, deleteTaskReportSuccess, deleteTaskReportFail) => {
|
|
|
- Http.put(Apis.REPORT.DELETE_TASK_REPORT.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{reportId}', reportId), {}).then((res) => {
|
|
|
- deleteTaskReportSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- deleteTaskReportFail(error)
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有测评能力
|
|
|
-export const getAllAbilities = () => {
|
|
|
- return ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试']
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有测评资源种类
|
|
|
-export const getAllAgencyResourceTypes = () => {
|
|
|
- return ['人力资源', '服务器资源', '专用设备']
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有服务类型
|
|
|
-export const getAllServiceTypes = () => {
|
|
|
- const data = ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试']
|
|
|
- return new Promise((resolve) => {
|
|
|
- resolve(data)
|
|
|
- })
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************userService*************************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 尚未使用 用户放弃认证,删除用户认证信息
|
|
|
+ deleteAuthInfo,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有认证信息
|
|
|
+ getAllAuthentications,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有可以访问的url
|
|
|
+ getAuthUrls,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取当前用户的认证信息
|
|
|
+ getCurrentAuthenInfo,
|
|
|
+ //TODO 可以使用 需要重构 获取当前用户信息
|
|
|
+ getCurrentUser,
|
|
|
+ //TODO 基本无用 获取当前用户所有的角色权限
|
|
|
+ getRolesPermissions,
|
|
|
+ //TODO 可以使用 需要重构 用户登出
|
|
|
+ logout,
|
|
|
+ //TODO 尚未使用 代码未实现 更新机构认证信息
|
|
|
+ updateAgencyAuthInfo,
|
|
|
+ //TODO 尚未使用 代码未实现 更新企业认证信息
|
|
|
+ updateEnterpriseAuthInfo,
|
|
|
+ //TODO 尚未使用 代码未实现 更新个人认证信息
|
|
|
+ updateIndividualAuthInfo,
|
|
|
+ //TODO 尚未使用 代码未实现 上传机构认证信息
|
|
|
+ uploadAgencyAuthenticationInfo,
|
|
|
+ //TODO 尚未使用 代码未实现 上传企业认证信息
|
|
|
+ uploadEnterpriseAuthenticationInfo,
|
|
|
+ //TODO 尚未使用 代码未实现 上传个人认证信息
|
|
|
+ uploadIndividualAuthenticationInfo,
|
|
|
}
|
|
|
-
|
|
|
-//获取所有报告类型
|
|
|
-export const getAllReportTypes = () => {
|
|
|
- const data = ['项目可行性报告', '项目测试方案', '项目测试报告', '项目缺陷报告', '项目用例报告', '其他']
|
|
|
- return new Promise((resolve) => {
|
|
|
- resolve(data)
|
|
|
- })
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有平台类型
|
|
|
-export const getAllPlatformTypes = () => {
|
|
|
- return ['ANDROID', 'IOS', 'WEB']
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
-}
|
|
|
-
|
|
|
-//获取当前角色可访问的url
|
|
|
-export const getAuthUrls = () => {
|
|
|
- return [
|
|
|
- '/', '/home', '/square', '/mine', '/project/create',
|
|
|
- '/project/:projectId', '/project/:projectId/task/create',
|
|
|
- '/project/:projectId/task/:taskId', '/project/:projectId/analyse',
|
|
|
- '/report/create', '/report/:reportId', '/greenChannel/addProject', '/greenChannel/addAgency',
|
|
|
- '/authentication/individual', '/authentication/enterprise',
|
|
|
- '/authentication/agency', '/authentication/index'
|
|
|
- ]
|
|
|
- //return Http.get(Apis.USER.GET_AUTH_URLS)
|
|
|
-}
|
|
|
-
|
|
|
-//上传个人认证信息
|
|
|
-export const uploadIndividualAuthenticationInfo = () => {
|
|
|
- Http.post(Apis)
|
|
|
-}
|
|
|
-
|
|
|
-//上传企业认证信息
|
|
|
-export const uploadEnterpriseAuthenticationInfo = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//上传机构认证信息
|
|
|
-export const uploadAgencyAuthenticationInfo = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有定向发布的目标
|
|
|
-export const getAllInstitutions = () => {
|
|
|
- return Http.get(Apis.GENERAL.GET_ALL_INSTITUTIONS)
|
|
|
-}
|
|
|
-
|
|
|
-//获取所有测评机构
|
|
|
-export const getAllAgencies = () => {
|
|
|
- // const data = [{
|
|
|
- // id: 1,
|
|
|
- // name: '慕测'
|
|
|
- // }, {
|
|
|
- // id: 2,
|
|
|
- // name: '南大'
|
|
|
- // }]
|
|
|
- //
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(data)
|
|
|
- // })
|
|
|
- return Http.get(Apis.GENERAL.GET_ALL_AGENCIES)
|
|
|
+export {
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************projectService**********************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 可以使用 需要重构 创建项目
|
|
|
+ createProject,
|
|
|
+ //TODO 可以使用 需要重构 删除项目
|
|
|
+ deleteProject,
|
|
|
+ //项目拥有者确认结束项目
|
|
|
+ ensureEndProject,
|
|
|
+ //TODO 可以使用 需要重构 获取项目信息
|
|
|
+ getProject,
|
|
|
+ //区域管理员接收项目
|
|
|
+ receiveProjectRequest,
|
|
|
+ //区域管理员拒绝项目
|
|
|
+ rejectProject,
|
|
|
+ //区域管理员提交项目
|
|
|
+ submitProjectRequest,
|
|
|
+ //TODO 可以使用 需要重构 项目拥有者修改项目
|
|
|
+ updateProject,
|
|
|
}
|
|
|
-
|
|
|
-//通过代码获取省、市名称
|
|
|
-export const getProvinceNameByProvinceCode = (provinceCode, cityCode) => {
|
|
|
- for (var i = 0; i < ProvinceJson.provinces.length; i++) {
|
|
|
- if (ProvinceJson.provinces[i].code == provinceCode) {
|
|
|
- for (var j = 0; j < ProvinceJson.provinces[i].cities.length; j++) {
|
|
|
- if (ProvinceJson.provinces[i].cities[j].code == cityCode) {
|
|
|
- return {
|
|
|
- 'provinceCode': ProvinceJson.provinces[i].name,
|
|
|
- 'cityCode': ProvinceJson.provinces[i].cities[j].name
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- 'provinceCode': '江苏省',
|
|
|
- 'cityCode': '南京市'
|
|
|
- }
|
|
|
+export {
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************taskService*************************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 可以使用 需要重构 创建任务
|
|
|
+ createTask,
|
|
|
+ //TODO 可以使用 需要重构 删除任务
|
|
|
+ deleteTask,
|
|
|
+ //区域管理员确认结束项目
|
|
|
+ ensureEndTask,
|
|
|
+ //查看任务信息
|
|
|
+ getTask,
|
|
|
+ //测评机构接收任务
|
|
|
+ receiveTaskRequest,
|
|
|
+ //测评机构拒绝任务
|
|
|
+ rejectTask,
|
|
|
+ //测评机构提交任务
|
|
|
+ submitTaskRequest,
|
|
|
+ //区域管理员修改任务
|
|
|
+ updateTask,
|
|
|
}
|
|
|
-//通过名称获取省、市代码
|
|
|
-export const getProvinceCodeByProvinceName = (provinceName, cityName) => {
|
|
|
- for (var i = 0; i < ProvinceJson.provinces.length; i++) {
|
|
|
- if (ProvinceJson.provinces[i].name == provinceName) {
|
|
|
- for (var j = 0; j < ProvinceJson.provinces[i].cities.length; j++) {
|
|
|
- if (ProvinceJson.provinces[i].cities[j].name == cityName) {
|
|
|
- return {
|
|
|
- 'provinceCode': ProvinceJson.provinces[i].code,
|
|
|
- 'cityCode': ProvinceJson.provinces[i].cities[j].code
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- 'provinceCode': '3200',
|
|
|
- 'cityCode': '3201'
|
|
|
- }
|
|
|
+export {
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************reportService***********************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 尚未使用 代码未实现 创建项目报告
|
|
|
+ createProjectReport,
|
|
|
+ //TODO 尚未使用 代码未实现 创建任务报告
|
|
|
+ createTaskReport,
|
|
|
+ //TODO 尚未使用 代码未实现 删除项目报告
|
|
|
+ deleteProjectReport,
|
|
|
+ //TODO 尚未使用 代码未实现 删除任务报告
|
|
|
+ deleteTaskReport,
|
|
|
+ //TODO 尚未使用 代码未实现 获取项目报告详情
|
|
|
+ getProjectReport,
|
|
|
+ //TODO 尚未使用 代码未实现 获取任务报告详情
|
|
|
+ getTaskReport,
|
|
|
+ //TODO 尚未使用 代码未实现 修改项目报告
|
|
|
+ updateProjectReport,
|
|
|
+ //TODO 尚未使用 代码未实现 修改任务报告
|
|
|
+ updateTaskReport,
|
|
|
}
|
|
|
+export {
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************fileService*************************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 尚未使用 代码未实现 上传图片
|
|
|
+ uploadImage,
|
|
|
+ //TODO 尚未使用 代码未实现 上传文档
|
|
|
+ uploadFile,
|
|
|
+ //TODO 尚未使用 代码未实现 校验上传格式
|
|
|
+ checkFileType,
|
|
|
+ //TODO 尚未使用 代码未实现 上传需求文档
|
|
|
+ //TODO 尚未使用 代码未实现 上传安装包
|
|
|
+ //TODO 尚未使用 代码未实现 上传批量创建项目文件
|
|
|
+
|
|
|
+ beforeUploadImage,
|
|
|
+ beforeUploadFile,
|
|
|
|
|
|
-//获取批量上传项目模板文件
|
|
|
-export const getGreenChannelAddProjectExcelTemplateFile = (getTemplateExcelSuccess, getTemplateExcelFail) => {
|
|
|
- const data = {
|
|
|
- fileUrl: 'http://mooctest-crowd-service.oss-cn-hangzhou.aliyuncs.com/Others/%E9%A1%B9%E7%9B%AE%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx'
|
|
|
- }
|
|
|
- new Promise((resolve) => {
|
|
|
- resolve(data)
|
|
|
- }).then((res) => {
|
|
|
- getTemplateExcelSuccess(res)
|
|
|
- }).catch((error) => {
|
|
|
- getTemplateExcelFail(error)
|
|
|
- })
|
|
|
- // Http.get(Apis.FILE.GET_TEMPLATE_EXCEL_FILE).then((res) => {
|
|
|
- // getTemplateExcelSuccess(res)
|
|
|
- // }).catch((error) => {
|
|
|
- // getTemplateExcelFail(error)
|
|
|
- // })
|
|
|
}
|
|
|
-
|
|
|
-//获取所有认证消息
|
|
|
-export const getAllAuthentications = () => {
|
|
|
- return [{
|
|
|
- userVO: {},
|
|
|
- type: '',
|
|
|
- status: '',
|
|
|
- authenticationDetail: {}
|
|
|
- }]
|
|
|
+export {
|
|
|
+ /*******************************************************************************/
|
|
|
+ /*******************************generalService**********************************/
|
|
|
+ /*******************************************************************************/
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有测评能力
|
|
|
+ getAllAbilities,
|
|
|
+ //TODO 可以使用 需要重构 获取所有测评机构
|
|
|
+ getAllAgencies,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有测评能力 获取所有测评资源类型
|
|
|
+ getAllAgencyResourceTypes,
|
|
|
+ //TODO 可以使用 需要重构 获取所有区域管理员
|
|
|
+ getAllInstitutions,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有测试平台类型
|
|
|
+ getAllPlatformTypes,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有报告类型
|
|
|
+ getAllReportTypes,
|
|
|
+ //TODO 目前使用本地数据 需要修改 获取所有服务类型(与获取所有测评能力相同)
|
|
|
+ getAllServiceTypes,
|
|
|
+ //获取绿色通道创建项目时的模板文件
|
|
|
+ getGreenChannelAddProjectExcelTemplateFile,
|
|
|
+ //通过省和市名称获取省市代码
|
|
|
+ getProvinceCodeByProvinceName,
|
|
|
+ //通过省市代码获取省市名称
|
|
|
+ getProvinceNameByProvinceCode,
|
|
|
+ //TODO 尚未使用 代码未实现 获取用户id
|
|
|
+ getUserIdentity,
|
|
|
+ //读取本地数据
|
|
|
+ storageGet,
|
|
|
+ //保存数据到本地
|
|
|
+ storageSave,
|
|
|
}
|
|
|
|
|
|
-export const getCurrentAuthenInfo = () => {
|
|
|
- const individualData = {
|
|
|
- type: '个人',//企业、机构、个人
|
|
|
- //共有
|
|
|
- id: 1,
|
|
|
- userId: 3,
|
|
|
- bankAccount: '621000999000999000',
|
|
|
- address: '江苏科技大厦',
|
|
|
- status: '认证失败',
|
|
|
- rejectReason: '太强',
|
|
|
- createTime: '2019.13.12',
|
|
|
- //个人
|
|
|
- realName: '李白',
|
|
|
- IDCard: '32092111111111',
|
|
|
- IDCardPhoto: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
- }
|
|
|
- const enterpriseData = {
|
|
|
- type: '企业',//企业、机构、个人
|
|
|
- //共有
|
|
|
- id: 1,
|
|
|
- userId: 3,
|
|
|
- bankAccount: '621000999000999000',
|
|
|
- address: '江苏科技大厦1901',
|
|
|
- status: '',
|
|
|
- rejectReason: '',
|
|
|
- createTime: '',
|
|
|
- //企业
|
|
|
- companyName: '慕测呀',
|
|
|
- legalPersonName: '郭超啊',
|
|
|
- businessLicensePhoto: null,
|
|
|
- unifiedSocialCreditCode: '1900000000086',
|
|
|
-
|
|
|
- }
|
|
|
- const agencyData = {
|
|
|
- type: '机构',//企业、机构、个人
|
|
|
- //共有
|
|
|
- id: 1,
|
|
|
- userId: 3,
|
|
|
- bankAccount: '100000000086',
|
|
|
- address: '江苏科技大厦1901',
|
|
|
- status: '',
|
|
|
- rejectReason: '123123123',
|
|
|
- createTime: '',
|
|
|
- //机构
|
|
|
- evaluationAgencyName: '慕测科技',
|
|
|
- evaluationAgencyAbilityList: ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试'],
|
|
|
- evaluationAgencyResourceList: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- type: '人力资源',
|
|
|
- name: '专家',
|
|
|
- totalNum: 100,
|
|
|
- availableNum: 3,
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- type: '人力资源',
|
|
|
- name: '程序员',
|
|
|
- totalNum: 100,
|
|
|
- availableNum: 3,
|
|
|
- }
|
|
|
- ],
|
|
|
- agencyPhoto: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
- }
|
|
|
- return new Promise((resolve) => {
|
|
|
- resolve(enterpriseData)
|
|
|
- })
|
|
|
-}
|
|
|
-//放弃认证
|
|
|
-export const deleteAuthInfo = () => {
|
|
|
- const data = {}
|
|
|
- return new Promise((resolve) => {
|
|
|
- resolve(data)
|
|
|
- })
|
|
|
- //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+export const defaultValue = {
|
|
|
+ name: '普通用户',
|
|
|
+ image: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
}
|
|
|
//
|
|
|
-export const updateIndividualAuthInfo = (userId, authInfo) => {
|
|
|
- // const data = {}
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(data)
|
|
|
- // })
|
|
|
- return Http.put(Apis.USER.UPDATE_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
-}
|
|
|
-export const updateAgencyAuthInfo = (userId, authInfo) => {
|
|
|
- // const data = {}
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(data)
|
|
|
- // })
|
|
|
- return Http.put(Apis.USER.UPDATE_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
-}
|
|
|
-export const updateEnterpriseAuthInfo = (userId, authInfo) => {
|
|
|
- // const data = {}
|
|
|
- // return new Promise((resolve) => {
|
|
|
- // resolve(data)
|
|
|
- // })
|
|
|
- return Http.put(Apis.USER.UPDATE_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
-}
|
|
|
+// //存session
|
|
|
+// export const storageSave = (key, value) => {
|
|
|
+// sessionStorage.setItem(key, JSON.stringify(value))
|
|
|
+// }
|
|
|
//
|
|
|
-export const checkFileType = (file, typeList, checkFileTypeError) => {
|
|
|
- var fileType = file.name.split('.')[file.name.split('.').length - 1].toLowerCase()
|
|
|
- if (!typeList.includes(fileType)) {
|
|
|
- checkFileTypeError()
|
|
|
- }
|
|
|
- return typeList.includes(fileType)
|
|
|
-}
|
|
|
+// //取session
|
|
|
+// export const storageGet = (key) => {
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(JSON.parse(sessionStorage.getItem(key)))
|
|
|
+// // })
|
|
|
+// return JSON.parse(sessionStorage.getItem(key))
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取用户id
|
|
|
+// export const getUserIdentity = () => {
|
|
|
+// return Http.get(Apis.USER.GET_USER_IDENTITY)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取用户信息
|
|
|
+// export const getCurrentUser = () => {
|
|
|
+// // const data = {
|
|
|
+// // userVO: {
|
|
|
+// // id: 3,
|
|
|
+// // photo: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
+// // name: '郭超',
|
|
|
+// // roleList: ['区域管理员', '个人用户', '企业用户', '测评机构', '系统管理员'],
|
|
|
+// // mobile: '110',
|
|
|
+// // email: '12345@qq.com',
|
|
|
+// // },
|
|
|
+// // agency: '',
|
|
|
+// // }
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(data)
|
|
|
+// // })
|
|
|
+// return Http.get(Apis.USER.GET_CURRENT_USER)
|
|
|
+// }
|
|
|
+// //
|
|
|
+// export const getRolesPermissions = (roleList) => {
|
|
|
+// const roles = {
|
|
|
+// regionManager: 'RegionalManager',
|
|
|
+// individualUser: 'generalUser',
|
|
|
+// enterpriseUser: 'enterpriseUser',
|
|
|
+// agency: 'evaluationAgency',
|
|
|
+// systemAdministrator: 'SystemAdministrator'
|
|
|
+// }
|
|
|
+// const permissions = {
|
|
|
+// isRegionManager: false,
|
|
|
+// isIndividualUser: false,
|
|
|
+// isEnterpriseUser: false,
|
|
|
+// isAgency: false,
|
|
|
+// isSystemAdministrator: false
|
|
|
+// }
|
|
|
+// if (roleList.includes(roles.regionManager)) {
|
|
|
+// permissions.isRegionManager = true
|
|
|
+// permissions.isEnterpriseUser = true
|
|
|
+// permissions.isIndividualUser = true
|
|
|
+// }
|
|
|
+// if (roleList.includes(roles.agency)) {
|
|
|
+// permissions.isAgency = true
|
|
|
+// permissions.isEnterpriseUser = true
|
|
|
+// permissions.isIndividualUser = true
|
|
|
+// }
|
|
|
+// if (roleList.includes(roles.enterpriseUser)) {
|
|
|
+// permissions.isEnterpriseUser = true
|
|
|
+// }
|
|
|
+// if (roleList.includes(roles.individualUser)) {
|
|
|
+// permissions.isIndividualUser = true
|
|
|
+// }
|
|
|
+// if (roleList.includes(roles.systemAdministrator)) {
|
|
|
+// permissions.isSystemAdministrator = true
|
|
|
+// permissions.isRegionManager = true
|
|
|
+// permissions.isAgency = true
|
|
|
+// permissions.isEnterpriseUser = true
|
|
|
+// permissions.isIndividualUser = true
|
|
|
+// }
|
|
|
+// return permissions
|
|
|
+// }
|
|
|
+//
|
|
|
+// export const logout = () => {
|
|
|
+// sessionStorage.removeItem('user')
|
|
|
+// sessionStorage.removeItem('rolesPermissions')
|
|
|
+// return Http.get(Apis.USER.LOGOUT)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传文档
|
|
|
+// export const uploadFile = (url, file) => {
|
|
|
+// const formData = new FormData()
|
|
|
+// let config = {
|
|
|
+// //添加请求头
|
|
|
+// headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+// }
|
|
|
+// formData.append('file', file)
|
|
|
+// return Http.upload(url, formData, config)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传图片
|
|
|
+// export const uploadImage = (file, uploadImageSuccess, uploadImageFail) => {
|
|
|
+// const formData = new FormData()
|
|
|
+// let config = {
|
|
|
+// //添加请求头
|
|
|
+// headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+// }
|
|
|
+// formData.append('file', file)
|
|
|
+// Http.upload(Apis.FILE.UPLOAD_IMAGE, formData, config).then((res) => {
|
|
|
+// uploadImageSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// uploadImageFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传图片前检测
|
|
|
+// export const beforeUploadImage = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传文档前检测
|
|
|
+// export const beforeUploadFile = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //创建项目
|
|
|
+// export const createProject = (project) => {
|
|
|
+// return Http.post(Apis.PROJECT.CREATE_PROJECT, project)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改项目
|
|
|
+// export const updateProject = (project, projectId) => {
|
|
|
+// return Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', projectId), project)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //查看项目
|
|
|
+// export const getProject = (projectId) => {
|
|
|
+// Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', projectId))
|
|
|
+// }
|
|
|
+//
|
|
|
+// //删除项目
|
|
|
+// export const deleteProject = (projectId, deleteProjectSuccess, deleteProjectFail) => {
|
|
|
+// Http.put(Apis.PROJECT.DELETE_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
+// deleteProjectSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// deleteProjectFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //区域管理员提出接收项目申请
|
|
|
+// export const receiveProjectRequest = (projectId, userId, receiveProjectSuccess, receiveProjectFail) => {
|
|
|
+// console.log('调用')
|
|
|
+// Http.put(Apis.PROJECT.ACCEPT_PROJECT.replace('{projectId}', projectId).replace('{userId}', userId), {}).then((res) => {
|
|
|
+// console.log(res)
|
|
|
+// receiveProjectSuccess(res)
|
|
|
+//
|
|
|
+// }).catch((error) => {
|
|
|
+// console.log(error)
|
|
|
+// receiveProjectFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //区域管理员拒绝项目
|
|
|
+// export const rejectProject = (projectId, rejectProjectSuccess, rejectProjectFail) => {
|
|
|
+// Http.put(Apis.PROJECT.REJECT_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
+// rejectProjectSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// rejectProjectFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //区域管理员提出结束项目申请
|
|
|
+// export const submitProjectRequest = (projectId, submitProjectReuqestSuccess, submitProjectRequestFail) => {
|
|
|
+// Http.put(Apis.PROJECT.SUBMIT_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
+// submitProjectReuqestSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// submitProjectRequestFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //用户确认结束项目
|
|
|
+// export const ensureEndProject = (projectId, endProjectSuccess, endProjectFail) => {
|
|
|
+// Http.put(Apis.PROJECT.END_PROJECT.replace('{projectId}', projectId), {}).then((res) => {
|
|
|
+// endProjectSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// endProjectFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //创建任务
|
|
|
+// export const createTask = (projectId, task) => {
|
|
|
+// return Http.post(Apis.TASK.CREATE_TASK.replace('{projectId}', projectId), task)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改任务
|
|
|
+// export const updateTask = (projectId, taskId, task, updateTaskSuccess, updateTaskFail) => {
|
|
|
+// Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), task).then((res) => {
|
|
|
+// updateTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// updateTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //查看任务
|
|
|
+// export const getTask = (projectId, taskId, getTaskSuccess, getTaskFail) => {
|
|
|
+// Http.get(Apis.TASK.GET_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
+// getTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// getTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //删除任务
|
|
|
+// export const deleteTask = (projectId, taskId, deleteTaskSuccess, deleteTaskFail) => {
|
|
|
+// Http.put(Apis.TASK.DELETE_TASK.replace('{projectId}', projectId).replace('taskId', taskId), {}).then((res) => {
|
|
|
+// deleteTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// deleteTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //测评机构接受任务
|
|
|
+// export const receiveTaskRequest = (projectId, taskId, userId, receiveTaskRequestSuccess, receiveTaskRequestFail) => {
|
|
|
+// Http.put(Apis.TASK.ACCEPT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{userId}', userId), {}).then((res) => {
|
|
|
+// receiveTaskRequestSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// receiveTaskRequestFail(error)
|
|
|
+// })
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //测评机构提出结束任务申请
|
|
|
+// export const submitTaskRequest = (projectId, taskId, submitTaskSuccess, submitTaskFail) => {
|
|
|
+// Http.put(Apis.TASK.SUBMIT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
+// submitTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// submitTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// export const rejectTask = (projectId, taskId, rejectTaskSuccess, rejectTaskFail) => {
|
|
|
+// Http.put(Apis.TASK.REJECT_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
+// rejectTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// rejectTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //区域管理员确认结束任务
|
|
|
+// export const ensureEndTask = (projectId, taskId, endTaskSuccess, endTaskFail) => {
|
|
|
+// Http.put(Apis.TASK.END_TASK.replace('{projectId}', projectId).replace('{taskId}', taskId), {}).then((res) => {
|
|
|
+// endTaskSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// endTaskFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //创建项目报告
|
|
|
+// export const createProjectReport = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //创建任务报告
|
|
|
+// export const createTaskReport = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改项目报告
|
|
|
+// export const updateProjectReport = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //修改任务报告
|
|
|
+// export const updateTaskReport = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //查看报告
|
|
|
+// export const getReport = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //删除项目报告
|
|
|
+// export const deleteProjectReport = (projectId, reportId, deleteProjectReportSuccess, deleteProjectReportFail) => {
|
|
|
+// Http.put(Apis.REPORT.DELETE_PROJECT_REPORT.replace('{projectId}', projectId).replace('{reportId}', reportId), {}).then((res) => {
|
|
|
+// deleteProjectReportSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// deleteProjectReportFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //删除任务报告
|
|
|
+// export const deleteTaskReport = (projectId, taskId, reportId, deleteTaskReportSuccess, deleteTaskReportFail) => {
|
|
|
+// Http.put(Apis.REPORT.DELETE_TASK_REPORT.replace('{projectId}', projectId).replace('{taskId}', taskId).replace('{reportId}', reportId), {}).then((res) => {
|
|
|
+// deleteTaskReportSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// deleteTaskReportFail(error)
|
|
|
+// })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有测评能力
|
|
|
+// export const getAllAbilities = () => {
|
|
|
+// return ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试']
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有测评资源种类
|
|
|
+// export const getAllAgencyResourceTypes = () => {
|
|
|
+// return ['人力资源', '服务器资源', '专用设备']
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有服务类型
|
|
|
+// export const getAllServiceTypes = () => {
|
|
|
+// const data = ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试']
|
|
|
+// return new Promise((resolve) => {
|
|
|
+// resolve(data)
|
|
|
+// })
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有报告类型
|
|
|
+// export const getAllReportTypes = () => {
|
|
|
+// const data = ['项目可行性报告', '项目测试方案', '项目测试报告', '项目缺陷报告', '项目用例报告', '其他']
|
|
|
+// return new Promise((resolve) => {
|
|
|
+// resolve(data)
|
|
|
+// })
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有平台类型
|
|
|
+// export const getAllPlatformTypes = () => {
|
|
|
+// return ['ANDROID', 'IOS', 'WEB']
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取当前角色可访问的url
|
|
|
+// export const getAuthUrls = () => {
|
|
|
+// return [
|
|
|
+// '/', '/home', '/square', '/mine', '/project/create',
|
|
|
+// '/project/:projectId', '/project/:projectId/task/create',
|
|
|
+// '/project/:projectId/task/:taskId', '/project/:projectId/analyse',
|
|
|
+// '/report/create', '/report/:reportId', '/greenChannel/addProject', '/greenChannel/addAgency',
|
|
|
+// '/authentication/individual', '/authentication/enterprise',
|
|
|
+// '/authentication/agency', '/authentication/index'
|
|
|
+// ]
|
|
|
+// //return Http.get(Apis.USER.GET_AUTH_URLS)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传个人认证信息
|
|
|
+// export const uploadIndividualAuthenticationInfo = () => {
|
|
|
+// Http.post(Apis)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传企业认证信息
|
|
|
+// export const uploadEnterpriseAuthenticationInfo = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //上传机构认证信息
|
|
|
+// export const uploadAgencyAuthenticationInfo = () => {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有定向发布的目标
|
|
|
+// export const getAllInstitutions = () => {
|
|
|
+// return Http.get(Apis.GENERAL.GET_ALL_INSTITUTIONS)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有测评机构
|
|
|
+// export const getAllAgencies = () => {
|
|
|
+// // const data = [{
|
|
|
+// // id: 1,
|
|
|
+// // name: '慕测'
|
|
|
+// // }, {
|
|
|
+// // id: 2,
|
|
|
+// // name: '南大'
|
|
|
+// // }]
|
|
|
+// //
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(data)
|
|
|
+// // })
|
|
|
+// return Http.get(Apis.GENERAL.GET_ALL_AGENCIES)
|
|
|
+// }
|
|
|
+//
|
|
|
+// //通过代码获取省、市名称
|
|
|
+// export const getProvinceNameByProvinceCode = (provinceCode, cityCode) => {
|
|
|
+// for (var i = 0; i < ProvinceJson.provinces.length; i++) {
|
|
|
+// if (ProvinceJson.provinces[i].code == provinceCode) {
|
|
|
+// for (var j = 0; j < ProvinceJson.provinces[i].cities.length; j++) {
|
|
|
+// if (ProvinceJson.provinces[i].cities[j].code == cityCode) {
|
|
|
+// return {
|
|
|
+// 'provinceCode': ProvinceJson.provinces[i].name,
|
|
|
+// 'cityCode': ProvinceJson.provinces[i].cities[j].name
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return {
|
|
|
+// 'provinceCode': '江苏省',
|
|
|
+// 'cityCode': '南京市'
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //通过名称获取省、市代码
|
|
|
+// export const getProvinceCodeByProvinceName = (provinceName, cityName) => {
|
|
|
+// for (var i = 0; i < ProvinceJson.provinces.length; i++) {
|
|
|
+// if (ProvinceJson.provinces[i].name == provinceName) {
|
|
|
+// for (var j = 0; j < ProvinceJson.provinces[i].cities.length; j++) {
|
|
|
+// if (ProvinceJson.provinces[i].cities[j].name == cityName) {
|
|
|
+// return {
|
|
|
+// 'provinceCode': ProvinceJson.provinces[i].code,
|
|
|
+// 'cityCode': ProvinceJson.provinces[i].cities[j].code
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return {
|
|
|
+// 'provinceCode': '3200',
|
|
|
+// 'cityCode': '3201'
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取批量上传项目模板文件
|
|
|
+// export const getGreenChannelAddProjectExcelTemplateFile = (getTemplateExcelSuccess, getTemplateExcelFail) => {
|
|
|
+// const data = {
|
|
|
+// fileUrl: 'http://mooctest-crowd-service.oss-cn-hangzhou.aliyuncs.com/Others/%E9%A1%B9%E7%9B%AE%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx'
|
|
|
+// }
|
|
|
+// new Promise((resolve) => {
|
|
|
+// resolve(data)
|
|
|
+// }).then((res) => {
|
|
|
+// getTemplateExcelSuccess(res)
|
|
|
+// }).catch((error) => {
|
|
|
+// getTemplateExcelFail(error)
|
|
|
+// })
|
|
|
+// // Http.get(Apis.FILE.GET_TEMPLATE_EXCEL_FILE).then((res) => {
|
|
|
+// // getTemplateExcelSuccess(res)
|
|
|
+// // }).catch((error) => {
|
|
|
+// // getTemplateExcelFail(error)
|
|
|
+// // })
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取所有认证消息
|
|
|
+// export const getAllAuthentications = () => {
|
|
|
+// return [{
|
|
|
+// userVO: {},
|
|
|
+// type: '',
|
|
|
+// status: '',
|
|
|
+// authenticationDetail: {}
|
|
|
+// }]
|
|
|
+// }
|
|
|
+//
|
|
|
+// export const getCurrentAuthenInfo = () => {
|
|
|
+// const individualData = {
|
|
|
+// type: '个人',//企业、机构、个人
|
|
|
+// //共有
|
|
|
+// id: 1,
|
|
|
+// userId: 3,
|
|
|
+// bankAccount: '621000999000999000',
|
|
|
+// address: '江苏科技大厦',
|
|
|
+// status: '认证失败',
|
|
|
+// rejectReason: '太强',
|
|
|
+// createTime: '2019.13.12',
|
|
|
+// //个人
|
|
|
+// realName: '李白',
|
|
|
+// IDCard: '32092111111111',
|
|
|
+// IDCardPhoto: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
+// }
|
|
|
+// const enterpriseData = {
|
|
|
+// type: '企业',//企业、机构、个人
|
|
|
+// //共有
|
|
|
+// id: 1,
|
|
|
+// userId: 3,
|
|
|
+// bankAccount: '621000999000999000',
|
|
|
+// address: '江苏科技大厦1901',
|
|
|
+// status: '',
|
|
|
+// rejectReason: '',
|
|
|
+// createTime: '',
|
|
|
+// //企业
|
|
|
+// companyName: '慕测呀',
|
|
|
+// legalPersonName: '郭超啊',
|
|
|
+// businessLicensePhoto: null,
|
|
|
+// unifiedSocialCreditCode: '1900000000086',
|
|
|
+//
|
|
|
+// }
|
|
|
+// const agencyData = {
|
|
|
+// type: '机构',//企业、机构、个人
|
|
|
+// //共有
|
|
|
+// id: 1,
|
|
|
+// userId: 3,
|
|
|
+// bankAccount: '100000000086',
|
|
|
+// address: '江苏科技大厦1901',
|
|
|
+// status: '',
|
|
|
+// rejectReason: '123123123',
|
|
|
+// createTime: '',
|
|
|
+// //机构
|
|
|
+// evaluationAgencyName: '慕测科技',
|
|
|
+// evaluationAgencyAbilityList: ['接口测试', '安全漏洞扫描', '风险评估服务', '源代码安全审计服务', '功能测试服务', '性能测试', '功能和易用性测试'],
|
|
|
+// evaluationAgencyResourceList: [
|
|
|
+// {
|
|
|
+// id: 0,
|
|
|
+// type: '人力资源',
|
|
|
+// name: '专家',
|
|
|
+// totalNum: 100,
|
|
|
+// availableNum: 3,
|
|
|
+// },
|
|
|
+// {
|
|
|
+// id: 1,
|
|
|
+// type: '人力资源',
|
|
|
+// name: '程序员',
|
|
|
+// totalNum: 100,
|
|
|
+// availableNum: 3,
|
|
|
+// }
|
|
|
+// ],
|
|
|
+// agencyPhoto: 'http://www.mooctest.net/assets/img/mooctest.png',
|
|
|
+// }
|
|
|
+// return new Promise((resolve) => {
|
|
|
+// resolve(enterpriseData)
|
|
|
+// })
|
|
|
+// }
|
|
|
+// //放弃认证
|
|
|
+// export const deleteAuthInfo = () => {
|
|
|
+// const data = {}
|
|
|
+// return new Promise((resolve) => {
|
|
|
+// resolve(data)
|
|
|
+// })
|
|
|
+// //return Http.get(Apis.GENERAL.GET_ALL_ABILITIES)
|
|
|
+// }
|
|
|
+// //
|
|
|
+// export const updateIndividualAuthInfo = (userId, authInfo) => {
|
|
|
+// // const data = {}
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(data)
|
|
|
+// // })
|
|
|
+// return Http.put(Apis.USER.UPDATE_INDIVIDUAL_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
+// }
|
|
|
+// export const updateAgencyAuthInfo = (userId, authInfo) => {
|
|
|
+// // const data = {}
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(data)
|
|
|
+// // })
|
|
|
+// return Http.put(Apis.USER.UPDATE_AGENCY_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
+// }
|
|
|
+// export const updateEnterpriseAuthInfo = (userId, authInfo) => {
|
|
|
+// // const data = {}
|
|
|
+// // return new Promise((resolve) => {
|
|
|
+// // resolve(data)
|
|
|
+// // })
|
|
|
+// return Http.put(Apis.USER.UPDATE_ENTERPRISE_AUTHENTICATION_INFO.replace('{userId}', userId), authInfo)
|
|
|
+// }
|
|
|
+// //
|
|
|
+// export const checkFileType = (file, typeList, checkFileTypeError) => {
|
|
|
+// var fileType = file.name.split('.')[file.name.split('.').length - 1].toLowerCase()
|
|
|
+// if (!typeList.includes(fileType)) {
|
|
|
+// checkFileTypeError()
|
|
|
+// }
|
|
|
+// return typeList.includes(fileType)
|
|
|
+// }
|