marvzhang пре 5 година
родитељ
комит
2425613538

+ 1 - 1
Dockerfile

@@ -11,7 +11,7 @@ WORKDIR /app
 ADD . /app
 COPY --from=frontend /app/dist /frontend
 RUN cp ./backend/package.json .
-RUN npm install --registry=https://registry.npm.taobao.org
+RUN npm install
 RUN yum install -y nginx
 RUN cp /app/nginx/artipub.conf /etc/nginx/conf.d
 

BIN
extensions/src/icon.png


BIN
public/artipub-helper.zip


BIN
public/favicon.ico


BIN
public/favicon.png


+ 4 - 1
spiders/base.js

@@ -59,7 +59,10 @@ class BaseSpider {
       // 打开开发者工具, 当此值为true时, headless总为false
       devtools: false,
       // 关闭headless模式, 不会打开浏览器
-      headless: enableChromeDebug !== 'Y'
+      headless: enableChromeDebug !== 'Y',
+      args: [
+        '--no-sandbox',
+      ]
     })
 
     // 页面

+ 3 - 0
spiders/import/base.js

@@ -45,6 +45,9 @@ class BaseImportSpider extends BaseSpider {
       ignoreHTTPSErrors: true,
       devtools: false,
       headless: enableChromeDebug !== 'Y',
+      args: [
+        '--no-sandbox',
+      ]
     })
 
     // 页面

+ 5 - 3
spiders/zhihu.js

@@ -29,7 +29,7 @@ class ZhihuSpider extends BaseSpider {
     // 上传markdown文件
     const handle = await this.page.$('input[accept=".docx,.doc,.markdown,.mdown,.mkdn,.md"]')
     await handle.uploadFile(mdPath)
-    await this.page.waitFor(1000)
+    await this.page.waitFor(5000)
 
     // 删除临时markdown文件
     await fs.unlinkSync(mdPath)
@@ -45,8 +45,10 @@ class ZhihuSpider extends BaseSpider {
 
   async afterInputEditor() {
     // 点击发布文章
-    const elPubBtn = await this.page.$('.PublishPanel-triggerButton')
-    await elPubBtn.click()
+    await this.page.evaluate(() => {
+      const el = document.querySelector('.PublishPanel-triggerButton')
+      el.click()
+    })
     await this.page.waitFor(5000)
 
     // 选择标签

BIN
src/assets/logo.png


+ 1 - 1
src/layouts/BasicLayout.tsx

@@ -18,7 +18,7 @@ import Authorized from '@/utils/Authorized';
 import RightContent from '@/components/GlobalHeader/RightContent';
 import {ConnectState, Dispatch} from '@/models/connect';
 import {isAntDesignPro} from '@/utils/utils';
-import logo from '../assets/logo.svg';
+import logo from '../assets/logo.png';
 import style from './BasicLayout.scss';
 import {Row} from "antd";
 

+ 1 - 1
src/layouts/UserLayout.tsx

@@ -7,7 +7,7 @@ import { formatMessage } from 'umi-plugin-react/locale';
 
 import SelectLang from '@/components/SelectLang';
 import { ConnectProps, ConnectState } from '@/models/connect';
-import logo from '../assets/logo.svg';
+import logo from '../assets/logo.png';
 import styles from './UserLayout.less';
 
 export interface UserLayoutProps extends ConnectProps {