完成这个地址替换
This commit is contained in:
7818
2026_05_29.log
Normal file
7818
2026_05_29.log
Normal file
File diff suppressed because one or more lines are too long
6
app/.env
6
app/.env
@@ -11,9 +11,9 @@ zn_username=%E8%87%AA%E5%8A%A8%E5%8C%96_Robot
|
|||||||
|
|
||||||
client_name=ShuFuAI
|
client_name=ShuFuAI
|
||||||
|
|
||||||
# java_api_base=http://47.111.163.154:18080
|
# java_api_base=http://api.aishufu.top:18080/
|
||||||
java_api_base=http://127.0.0.1:18080
|
java_api_base=http://api.aishufu.top:18080/
|
||||||
# java_api_base=http://121.196.149.225:18080
|
# java_api_base=http://api.aishufu.top:18080/
|
||||||
|
|
||||||
# 与 Java 后端共享的 JWT 签名密钥,必须与 backend-java 的 AIIMAGE_JWT_SECRET 完全一致
|
# 与 Java 后端共享的 JWT 签名密钥,必须与 backend-java 的 AIIMAGE_JWT_SECRET 完全一致
|
||||||
AIIMAGE_JWT_SECRET=please-change-this-secret-please-rotate-at-least-32-bytes
|
AIIMAGE_JWT_SECRET=please-change-this-secret-please-rotate-at-least-32-bytes
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ proxy_mode=2
|
|||||||
client_name=ShuFuAI
|
client_name=ShuFuAI
|
||||||
|
|
||||||
|
|
||||||
java_api_base=http://127.0.0.1:18080
|
java_api_base=http://api.aishufu.top:18080/
|
||||||
# java_api_base=http://47.111.163.154:18080
|
# java_api_base=http://api.aishufu.top:18080/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ zn_username=%E8%87%AA%E5%8A%A8%E5%8C%96_Robot
|
|||||||
client_name=ShuFuAI
|
client_name=ShuFuAI
|
||||||
|
|
||||||
|
|
||||||
java_api_base=http://47.111.163.154:18080
|
java_api_base=http://api.aishufu.top:18080/
|
||||||
# java_api_base=http://127.0.0.1:18080
|
# java_api_base=http://api.aishufu.top:18080/
|
||||||
# java_api_base=http://47.111.163.154:18080
|
# java_api_base=http://api.aishufu.top:18080/
|
||||||
|
|
||||||
# 与 Java 后端共享的 JWT 签名密钥,必须与 backend-java 的 AIIMAGE_JWT_SECRET 完全一致
|
# 与 Java 后端共享的 JWT 签名密钥,必须与 backend-java 的 AIIMAGE_JWT_SECRET 完全一致
|
||||||
AIIMAGE_JWT_SECRET=please-change-this-secret-please-rotate-at-least-32-bytes
|
AIIMAGE_JWT_SECRET=please-change-this-secret-please-rotate-at-least-32-bytes
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ proxy_url = os.getenv("proxy_url")
|
|||||||
proxy_mode = int(os.getenv("proxy_mode",1))
|
proxy_mode = int(os.getenv("proxy_mode",1))
|
||||||
|
|
||||||
client_name=os.getenv("client_name") + ".exe"
|
client_name=os.getenv("client_name") + ".exe"
|
||||||
JAVA_API_BASE = os.getenv("java_api_base", "http://127.0.0.1:18080")
|
JAVA_API_BASE = os.getenv("java_api_base", "http://api.aishufu.top:18080/").rstrip("/")
|
||||||
|
|
||||||
# 紫鸟浏览器配置
|
# 紫鸟浏览器配置
|
||||||
from urllib.parse import unquote
|
from urllib.parse import unquote
|
||||||
@@ -32,7 +32,7 @@ ZN_USERNAME = unquote(ZN_USERNAME)
|
|||||||
ZN_PASSWORD = os.getenv("zn_password", "#20zsg25")
|
ZN_PASSWORD = os.getenv("zn_password", "#20zsg25")
|
||||||
|
|
||||||
# 删除品牌API配置
|
# 删除品牌API配置
|
||||||
DELETE_BRAND_API_BASE = os.getenv("DELETE_BRAND_API_BASE", JAVA_API_BASE)
|
DELETE_BRAND_API_BASE = os.getenv("DELETE_BRAND_API_BASE", JAVA_API_BASE).rstrip("/")
|
||||||
|
|
||||||
|
|
||||||
cache_path = "./user_data"
|
cache_path = "./user_data"
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ public class AppearancePatentTaskService {
|
|||||||
"价格",
|
"价格",
|
||||||
"标题维度(商标)",
|
"标题维度(商标)",
|
||||||
"外观维度(外观设计专利)",
|
"外观维度(外观设计专利)",
|
||||||
"专利维度(发明/实用新型专利)",
|
|
||||||
"结论",
|
"结论",
|
||||||
"状态",
|
"状态",
|
||||||
"评分"
|
"评分"
|
||||||
@@ -3216,6 +3215,7 @@ public class AppearancePatentTaskService {
|
|||||||
List<String> resultHeaders = new ArrayList<>(RESULT_HEADERS);
|
List<String> resultHeaders = new ArrayList<>(RESULT_HEADERS);
|
||||||
resultHeaders.add(4, "标题");
|
resultHeaders.add(4, "标题");
|
||||||
resultHeaders.add(5, "图片链接");
|
resultHeaders.add(5, "图片链接");
|
||||||
|
resultHeaders.add(6, "sku");
|
||||||
Row header = sheet.createRow(0);
|
Row header = sheet.createRow(0);
|
||||||
for (int i = 0; i < resultHeaders.size(); i++) {
|
for (int i = 0; i < resultHeaders.size(); i++) {
|
||||||
Cell cell = header.createCell(i);
|
Cell cell = header.createCell(i);
|
||||||
@@ -3239,9 +3239,9 @@ public class AppearancePatentTaskService {
|
|||||||
row.createCell(col++).setCellValue(firstNonBlank(parsedRow.getPrice(), ""));
|
row.createCell(col++).setCellValue(firstNonBlank(parsedRow.getPrice(), ""));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? firstNonBlank(parsedRow.getTitle(), "") : firstNonBlank(resultRow.getTitle(), parsedRow.getTitle()));
|
row.createCell(col++).setCellValue(resultRow == null ? firstNonBlank(parsedRow.getTitle(), "") : firstNonBlank(resultRow.getTitle(), parsedRow.getTitle()));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? firstNonBlank(parsedRow.getUrl(), "") : firstNonBlank(resultRow.getUrl(), parsedRow.getUrl()));
|
row.createCell(col++).setCellValue(resultRow == null ? firstNonBlank(parsedRow.getUrl(), "") : firstNonBlank(resultRow.getUrl(), parsedRow.getUrl()));
|
||||||
|
row.createCell(col++).setCellValue(resultRow == null ? firstNonBlank(parsedRow.getSku(), "") : firstNonBlank(resultRow.getSku(), parsedRow.getSku()));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getTitleRisk()));
|
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getTitleRisk()));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getAppearanceRisk()));
|
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getAppearanceRisk()));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getPatentRisk()));
|
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? "未送检" : userFacingConclusion(resultRow));
|
row.createCell(col++).setCellValue(resultRow == null ? "未送检" : userFacingConclusion(resultRow));
|
||||||
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingStatus(resultRow));
|
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingStatus(resultRow));
|
||||||
row.createCell(col).setCellValue(resultRow == null ? "" : firstNonBlank(resultRow.getScore(), ""));
|
row.createCell(col).setCellValue(resultRow == null ? "" : firstNonBlank(resultRow.getScore(), ""));
|
||||||
|
|||||||
@@ -696,7 +696,7 @@ public class SimilarAsinTaskService {
|
|||||||
scope.setCreatedAt(LocalDateTime.now());
|
scope.setCreatedAt(LocalDateTime.now());
|
||||||
}
|
}
|
||||||
scope.setChunkTotal(chunkTotal);
|
scope.setChunkTotal(chunkTotal);
|
||||||
scope.setReceivedChunkCount(countChunks(taskId, scopeHash));
|
scope.setReceivedChunkCount(resolveReceivedChunkProgress(taskId, scopeHash, scope.getChunkTotal()));
|
||||||
scope.setLastChunkAt(LocalDateTime.now());
|
scope.setLastChunkAt(LocalDateTime.now());
|
||||||
scope.setLastError(request.getError());
|
scope.setLastError(request.getError());
|
||||||
scope.setCompleted(Boolean.TRUE.equals(request.getDone()) ? 1 : 0);
|
scope.setCompleted(Boolean.TRUE.equals(request.getDone()) ? 1 : 0);
|
||||||
@@ -1199,7 +1199,7 @@ public class SimilarAsinTaskService {
|
|||||||
if (chunkTotal != null) {
|
if (chunkTotal != null) {
|
||||||
scope.setChunkTotal(chunkTotal);
|
scope.setChunkTotal(chunkTotal);
|
||||||
}
|
}
|
||||||
scope.setReceivedChunkCount(countChunks(taskId, scopeHash));
|
scope.setReceivedChunkCount(resolveReceivedChunkProgress(taskId, scopeHash, scope.getChunkTotal()));
|
||||||
scope.setLastChunkAt(now);
|
scope.setLastChunkAt(now);
|
||||||
scope.setLastError(error);
|
scope.setLastError(error);
|
||||||
scope.setCompleted(completed ? 1 : 0);
|
scope.setCompleted(completed ? 1 : 0);
|
||||||
@@ -4822,6 +4822,36 @@ public class SimilarAsinTaskService {
|
|||||||
return count == null ? 0 : count.intValue();
|
return count == null ? 0 : count.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int resolveReceivedChunkProgress(Long taskId, String scopeHash, Integer chunkTotal) {
|
||||||
|
int receivedCount = countChunks(taskId, scopeHash);
|
||||||
|
Integer maxChunkIndex = taskChunkMapper.selectObjs(new LambdaQueryWrapper<TaskChunkEntity>()
|
||||||
|
.select(TaskChunkEntity::getChunkIndex)
|
||||||
|
.eq(TaskChunkEntity::getTaskId, taskId)
|
||||||
|
.eq(TaskChunkEntity::getModuleType, MODULE_TYPE)
|
||||||
|
.eq(TaskChunkEntity::getScopeHash, scopeHash)
|
||||||
|
.orderByDesc(TaskChunkEntity::getChunkIndex)
|
||||||
|
.last("limit 1"))
|
||||||
|
.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(value -> {
|
||||||
|
if (value instanceof Number number) {
|
||||||
|
return number.intValue();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(value.toString());
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.findFirst()
|
||||||
|
.orElse(0);
|
||||||
|
int current = Math.max(receivedCount, maxChunkIndex == null ? 0 : maxChunkIndex);
|
||||||
|
if (chunkTotal != null && chunkTotal > 0) {
|
||||||
|
current = Math.min(current, chunkTotal);
|
||||||
|
}
|
||||||
|
return Math.max(0, current);
|
||||||
|
}
|
||||||
|
|
||||||
private SimilarAsinTaskItemVo toTaskItem(FileTaskEntity task) {
|
private SimilarAsinTaskItemVo toTaskItem(FileTaskEntity task) {
|
||||||
SimilarAsinTaskItemVo vo = new SimilarAsinTaskItemVo();
|
SimilarAsinTaskItemVo vo = new SimilarAsinTaskItemVo();
|
||||||
vo.setId(task.getId());
|
vo.setId(task.getId());
|
||||||
@@ -4938,7 +4968,7 @@ public class SimilarAsinTaskService {
|
|||||||
PythonUploadProgress progress = resolvePythonUploadProgress(taskId);
|
PythonUploadProgress progress = resolvePythonUploadProgress(taskId);
|
||||||
int total = progress.total() > 0 ? progress.total() : Math.max(1, progress.current() + 1);
|
int total = progress.total() > 0 ? progress.total() : Math.max(1, progress.current() + 1);
|
||||||
int current = Math.max(0, Math.min(progress.current(), total));
|
int current = Math.max(0, Math.min(progress.current(), total));
|
||||||
int percent = current <= 0 ? 1 : Math.min(95, (int) Math.floor(current * 100.0 / total));
|
int percent = current <= 0 ? 1 : Math.min(95, (int) Math.ceil(current * 100.0 / total));
|
||||||
vo.setFileProgressCurrent(current);
|
vo.setFileProgressCurrent(current);
|
||||||
vo.setFileProgressTotal(total);
|
vo.setFileProgressTotal(total);
|
||||||
vo.setFileProgressPercent(percent);
|
vo.setFileProgressPercent(percent);
|
||||||
@@ -4987,6 +5017,7 @@ public class SimilarAsinTaskService {
|
|||||||
}
|
}
|
||||||
int stateTotal = state.getChunkTotal() == null ? 0 : state.getChunkTotal();
|
int stateTotal = state.getChunkTotal() == null ? 0 : state.getChunkTotal();
|
||||||
int stateCurrent = state.getReceivedChunkCount() == null ? 0 : state.getReceivedChunkCount();
|
int stateCurrent = state.getReceivedChunkCount() == null ? 0 : state.getReceivedChunkCount();
|
||||||
|
stateCurrent = Math.max(stateCurrent, resolveReceivedChunkProgress(taskId, state.getScopeHash(), stateTotal));
|
||||||
if (stateTotal > total || total <= 0 && stateCurrent > current) {
|
if (stateTotal > total || total <= 0 && stateCurrent > current) {
|
||||||
total = stateTotal;
|
total = stateTotal;
|
||||||
current = stateCurrent;
|
current = stateCurrent;
|
||||||
@@ -5010,6 +5041,9 @@ public class SimilarAsinTaskService {
|
|||||||
}
|
}
|
||||||
String scopeHash = firstNonBlank(chunk.getScopeHash(), "");
|
String scopeHash = firstNonBlank(chunk.getScopeHash(), "");
|
||||||
receivedByScope.merge(scopeHash, 1, Integer::sum);
|
receivedByScope.merge(scopeHash, 1, Integer::sum);
|
||||||
|
if (chunk.getChunkIndex() != null && chunk.getChunkIndex() > 0) {
|
||||||
|
receivedByScope.merge(scopeHash, chunk.getChunkIndex(), Math::max);
|
||||||
|
}
|
||||||
if (chunk.getChunkTotal() != null && chunk.getChunkTotal() > 0) {
|
if (chunk.getChunkTotal() != null && chunk.getChunkTotal() > 0) {
|
||||||
totalByScope.merge(scopeHash, chunk.getChunkTotal(), Math::max);
|
totalByScope.merge(scopeHash, chunk.getChunkTotal(), Math::max);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ try:
|
|||||||
from config import bucket_path, backend_java_base_url
|
from config import bucket_path, backend_java_base_url
|
||||||
except ImportError:
|
except ImportError:
|
||||||
bucket_path = os.environ.get('BUCKET_PATH', 'nanri-image/')
|
bucket_path = os.environ.get('BUCKET_PATH', 'nanri-image/')
|
||||||
backend_java_base_url = os.environ.get('BACKEND_JAVA_BASE_URL', 'http://127.0.0.1:18080').rstrip('/')
|
backend_java_base_url = os.environ.get('BACKEND_JAVA_BASE_URL', 'http://api.aishufu.top:18080/').rstrip('/')
|
||||||
|
|
||||||
admin_api = Blueprint('admin_api', __name__, url_prefix='/api/admin')
|
admin_api = Blueprint('admin_api', __name__, url_prefix='/api/admin')
|
||||||
_backend_java_session_local = threading.local()
|
_backend_java_session_local = threading.local()
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ file_url_pre = f"https://{bucket}.oss-cn-hangzhou.aliyuncs.com/"
|
|||||||
backend_java_base_url, backend_java_base_url_source = _get_env(
|
backend_java_base_url, backend_java_base_url_source = _get_env(
|
||||||
"java_api_base",
|
"java_api_base",
|
||||||
"BACKEND_JAVA_BASE_URL",
|
"BACKEND_JAVA_BASE_URL",
|
||||||
default="http://127.0.0.1:18080",
|
default="http://api.aishufu.top:18080/",
|
||||||
# default="http://47.111.163.154:18080",
|
# default="http://api.aishufu.top:18080/",
|
||||||
)
|
)
|
||||||
backend_java_base_url = backend_java_base_url.rstrip("/")
|
backend_java_base_url = backend_java_base_url.rstrip("/")
|
||||||
os.environ["OSS_ACCESS_KEY_ID"] = accessKeyId
|
os.environ["OSS_ACCESS_KEY_ID"] = accessKeyId
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default defineConfig({
|
|||||||
port: 5173,
|
port: 5173,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/newApi/api': {
|
'/newApi/api': {
|
||||||
target: 'http://127.0.0.1:18080',
|
target: 'http://api.aishufu.top:18080/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/newApi/, ''),
|
rewrite: (path) => path.replace(/^\/newApi/, ''),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user