(config)
| 175 | } |
| 176 | |
| 177 | function handlePostRequestParams (config) { |
| 178 | if (config && config.data && config.data instanceof URLSearchParams) { |
| 179 | const project = vueProps.$localStorage.get(CURRENT_PROJECT) |
| 180 | const command = config.data.get('command') |
| 181 | const hasProjectId = config.data.has('projectid') |
| 182 | const ignoreProject = config.data.has('ignoreproject') |
| 183 | |
| 184 | if (!hasProjectId && !ignoreProject && project && project.id) { |
| 185 | if (command === 'listTags') { |
| 186 | config.data.append('projectid', '-1') |
| 187 | } else if (command !== 'assignVirtualMachine') { |
| 188 | config.data.append('projectid', project.id) |
| 189 | } |
| 190 | } |
| 191 | if (config.data.has('ignoreproject')) { |
| 192 | config.data.delete('ignoreproject') |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | // response interceptor |
| 198 | service.interceptors.response.use((response) => { |
no test coverage detected