| | |
| | | }) |
| | | } |
| | | |
| | | // 替换图片请求代理地址 |
| | | export function replaceWithProxy(url) { |
| | | if (!url) return '' |
| | | return url.replace( |
| | | /^https?:\/\/[^/]+/, |
| | | 'https://wrj.shuixiongit.com/ja-proxy' |
| | | ) |
| | | } |
| | | |
| | | // 异步生成算法成果图片 |
| | | export async function appendAiImages(item) { |
| | | try { |
| | | const [resultUrl, thumbnail] = await Promise.all([ |
| | | getAiImg(replaceWithProxy(item.resultUrl), item.geojson), |
| | | getAiImg(replaceWithProxy(item.thumbnail), item.geojson), |
| | | ]) |
| | | console.log() |
| | | if (item.id === '2019312870354416746'){ |
| | | console.log(resultUrl) |
| | | console.log(thumbnail) |
| | | } |
| | | item.resultUrl = resultUrl |
| | | item.thumbnail = thumbnail |
| | | } catch { |
| | | item.thumbnail = item.resultUrl |
| | | } |
| | | } |
| | | |
| | | // 图片转带ai框的图片 |
| | | export function getAiImg(url, aiFrameSource) { |
| | | if (!url) return url |