|
|
@@ -36,6 +36,7 @@ import { paraParam } from "../../../reducers/para-change";
|
|
|
import { get } from "../../../request";
|
|
|
import store from "../../../store";
|
|
|
import { IRecent } from "../../../components/recent/RecentList";
|
|
|
+import { fullUrl } from "../../../utils";
|
|
|
|
|
|
/**
|
|
|
* type:
|
|
|
@@ -268,17 +269,26 @@ const Widget = () => {
|
|
|
para={searchParams.get("par")}
|
|
|
channelId={searchParams.get("channel")}
|
|
|
articleId={id}
|
|
|
+ anthologyId={searchParams.get("anthology")}
|
|
|
mode={searchParams.get("mode") as ArticleMode}
|
|
|
- onArticleChange={(article: string) => {
|
|
|
- console.log("article change", article);
|
|
|
- let url = `/article/${type}/${article}?mode=${currMode}`;
|
|
|
+ onArticleChange={(article: string, target?: string) => {
|
|
|
+ console.log("article change", article, target);
|
|
|
+ let mType = type;
|
|
|
+ if (article.split("-").length === 2) {
|
|
|
+ mType = "chapter";
|
|
|
+ }
|
|
|
+ let url = `/article/${mType}/${article}?mode=${currMode}`;
|
|
|
searchParams.forEach((value, key) => {
|
|
|
console.log(value, key);
|
|
|
if (key !== "mode") {
|
|
|
url += `&${key}=${value}`;
|
|
|
}
|
|
|
});
|
|
|
- navigate(url);
|
|
|
+ if (target === "_blank") {
|
|
|
+ window.open(fullUrl(url), "_blank");
|
|
|
+ } else {
|
|
|
+ navigate(url);
|
|
|
+ }
|
|
|
}}
|
|
|
onLoad={(article: IArticleDataResponse) => {
|
|
|
setLoadedArticleData(article);
|