|
@@ -31,9 +31,10 @@ const CompoundWidget = ({ word, add, split, onSearch }: IWidget) => {
|
|
|
if (typeof value === "undefined") {
|
|
if (typeof value === "undefined") {
|
|
|
setMeaningData(undefined);
|
|
setMeaningData(undefined);
|
|
|
} else {
|
|
} else {
|
|
|
- get<IDictFirstMeaningResponse>(
|
|
|
|
|
- `/v2/dict-meaning?lang=zh-Hans&word=` + value.replaceAll("+", "-")
|
|
|
|
|
- ).then((json) => {
|
|
|
|
|
|
|
+ const url =
|
|
|
|
|
+ `/v2/dict-meaning?lang=zh-Hans&word=` + value.replaceAll("+", "-");
|
|
|
|
|
+ console.info("dict compound url", url);
|
|
|
|
|
+ get<IDictFirstMeaningResponse>(url).then((json) => {
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
|
setMeaningData(json.data);
|
|
setMeaningData(json.data);
|
|
|
}
|
|
}
|
|
@@ -42,7 +43,7 @@ const CompoundWidget = ({ word, add, split, onSearch }: IWidget) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- console.log("compound changed", add, compound);
|
|
|
|
|
|
|
+ console.debug("compound changed", add, compound);
|
|
|
if (typeof add === "undefined") {
|
|
if (typeof add === "undefined") {
|
|
|
setFactors(compound);
|
|
setFactors(compound);
|
|
|
const value = compound.length > 0 ? compound[0].value : undefined;
|
|
const value = compound.length > 0 ? compound[0].value : undefined;
|
|
@@ -60,6 +61,7 @@ const CompoundWidget = ({ word, add, split, onSearch }: IWidget) => {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const url = `/v2/userdict?view=compound&word=${word}&order=confidence`;
|
|
const url = `/v2/userdict?view=compound&word=${word}&order=confidence`;
|
|
|
|
|
+ console.info("dict compound url", url);
|
|
|
get<IApiResponseDictList>(url).then((json) => {
|
|
get<IApiResponseDictList>(url).then((json) => {
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
|
const data = json.data.rows
|
|
const data = json.data.rows
|