提交 221a3018 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 5543664d
VITE_API_URL_WORD = http://192.168.11.88:7419 VITE_API_URL_WORD = https://zijingebook.ezijing.com/file/
VITE_API_BASE_API_PREFFIX = /api VITE_API_BASE_API_PREFFIX = /api
VITE_API_WEBSOCKET_URL = ws://192.168.11.88:7419 VITE_API_WEBSOCKET_URL = wss://zijingebook.ezijing.com
VITE_API_OPENAI_URL = https://model-platform-skyagents.tiangong.cn VITE_API_OPENAI_URL = https://model-platform-skyagents.tiangong.cn
\ No newline at end of file
Binary files a/a.md and /dev/null differ Binary files a/a.md and /dev/null differ
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./public/favicon.ico" /> <link rel="icon" type="image/svg+xml" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0" />
<title>清控紫荆数智学堂</title> <title>清控紫荆数智学堂</title>
</head> </head>
......
{ {
"name": "zijing-html", "name": "center-book",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"start:test": "cross-env NODE_ENV=test vite",
"start:dev": "cross-env NODE_ENV=development vite",
"build": "vite build", "build": "vite build",
"build:dev": "cross-env NODE_ENV=development vite build", "build:dev": "vite build --mode development",
"build:ali": "cross-env NODE_ENV=ali vite build", "build:ali": "vite build --mode ali",
"build:online": "cross-env NODE_ENV=online vite build",
"preview": "vite preview", "preview": "vite preview",
"prepare": "husky install", "prepare": "husky install",
"fix-memory-limit": "cross-env LIMIT=40240 increase-memory-limit",
"lint": "npm run lint:js && npm run lint:prettier", "lint": "npm run lint:js && npm run lint:prettier",
"lint-staged": "lint-staged", "lint-staged": "lint-staged",
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx", "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx",
...@@ -29,17 +25,15 @@ ...@@ -29,17 +25,15 @@
"@wangeditor/editor-for-react": "^1.0.6", "@wangeditor/editor-for-react": "^1.0.6",
"@wangeditor/plugin-link-card": "^1.0.0", "@wangeditor/plugin-link-card": "^1.0.0",
"ali-oss": "^6.20.0", "ali-oss": "^6.20.0",
"antd": "^5.11.1", "antd": "^5.17.0",
"axios": "^1.6.2", "axios": "^1.6.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"easy-formula-editor": "^0.0.2-alpha.1",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"i": "^0.3.7",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"js-md5": "^0.8.3", "js-md5": "^0.8.3",
"katex": "^0.15.2", "lodash-es": "^4.17.21",
"loadsh": "^0.0.4",
"lodash": "^4.17.21",
"qs": "^6.11.2", "qs": "^6.11.2",
"rc-slider-captcha": "^1.3.0", "rc-slider-captcha": "^1.3.0",
"react": "^18.2.0", "react": "^18.2.0",
...@@ -55,20 +49,15 @@ ...@@ -55,20 +49,15 @@
"@types/react-dom": "^18.2.7", "@types/react-dom": "^18.2.7",
"@umijs/fabric": "^4.0.1", "@umijs/fabric": "^4.0.1",
"@umijs/lint": "^4.0.88", "@umijs/lint": "^4.0.88",
"@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-react-swc": "^3.6.0",
"@vitejs/plugin-react": "^4.0.3",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"eslint": "^8.53.0", "eslint": "^8.53.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"less": "^4.2.0", "less": "^4.2.0",
"lint-staged": "^15.1.0", "lint-staged": "^15.1.0",
"picocolors": "^1.0.0",
"prettier": "^3.1.0", "prettier": "^3.1.0",
"stylelint-config-standard": "^34.0.0", "stylelint-config-standard": "^34.0.0",
"terser": "^5.26.0", "vite": "^5.2.11",
"vite": "^4.4.5", "vite-plugin-mkcert": "^1.17.5"
"vite-plugin-progress": "^0.0.7"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
......
...@@ -7,8 +7,8 @@ Currently, two official plugins are available: ...@@ -7,8 +7,8 @@ Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## PC:
PC:
1. 预览时气泡的投影样式加深; 1. 预览时气泡的投影样式加深;
2. 修改默认字号为四号,18px; 2. 修改默认字号为四号,18px;
3. 去掉选择图片时,查看链接的按钮; 3. 去掉选择图片时,查看链接的按钮;
...@@ -18,9 +18,88 @@ PC: ...@@ -18,9 +18,88 @@ PC:
7. 添加题目时,题干、答案、选项会过滤复制粘贴过来的样式,图片也会去除。 7. 添加题目时,题干、答案、选项会过滤复制粘贴过来的样式,图片也会去除。
8. 添加交互练习时,可以进行分组,分组签名加上编号;同时题干和编号第一行对齐。 8. 添加交互练习时,可以进行分组,分组签名加上编号;同时题干和编号第一行对齐。
APP: ## APP:
1. 划线和高亮问题修复; 1. 划线和高亮问题修复;
2. 画廊的图片可以点击打开放大,添加图片左右切换; 2. 画廊的图片可以点击打开放大,添加图片左右切换;
3. app端答题页也添加分组,同时题干和编号第一行对齐。 3. app端答题页也添加分组,同时题干和编号第一行对齐。
4. loading关闭的时机调整; 4. loading关闭的时机调整;
5. 阅读页样式修改 5. 阅读页样式修改
\ No newline at end of file
## 目录结构
````
ZIJING-HTML
├─.husky husky 代码提交规范
├─.vscode 本地编辑器配置
├─dist npm run build 之后打包存放目录
├─formula-editor 公式插件源代码
├─node_modules npm 包管下载目录
└─src 主要代码存放目录
├─assets 静态资源
│ ├─fonts 字体文件
│ ├─images 图片目录
│ │ ├─editor
│ │ ├─icon
│ │ └─svg
│ └─login 验证码图片
├─common 公共组件
│ ├─dropDownCom 下拉菜单
│ ├─editor-simple 编辑器
│ ├─errorBoundary 错误边界信息
│ ├─icon 图标组件
│ ├─iconfont 图标字体
│ ├─notFound 404页面
│ ├─notPermission 无权限页面
│ ├─Pagination 页码控制
│ ├─TableCom 表格组件
│ ├─wangeditor-customer 编辑器
│ └─websocket websocket hook
├─config 路由组件配置
├─css
├─layout layout
│ ├─components
│ └─css
├─pages 页面
│ ├─advertisement 广告模块
│ │ ├─adsense 广告管理
│ │ └─advert 广告位管理
│ ├─books 书籍基本信息
│ │ ├─audit 书籍审核
│ │ ├─classify 书籍分类
│ │ ├─discussion 讨论互动
│ │ ├─label 书籍标签
│ │ ├─management 写书管理
│ │ ├─order-management 订单管理
│ │ ├─question-bank 题库管理
│ │ ├─sale 书籍审核
│ │ └─section 写书管理 -- 章节
│ ├─jurisdiction 权限管理
│ │ ├─admin 管理员管理
│ │ └─role 权限管理
│ ├─member 用户管理模块
│ │ ├─detail 用户详情
│ │ ├─list 用户列表
│ │ └─userlevel 用户等级
│ ├─setting 系统设置模块
│ │ ├─app-version app版本管理
│ │ ├─applied 应用管理
│ │ ├─coupon 优惠券管理
│ │ ├─feedback 意见反馈
│ │ ├─help 帮助中心
│ │ ├─personalized-setting 个性化设置
│ │ ├─point-management 积分管理
│ │ └─sensitive 敏感词搜索
│ ├─teacher 老师管理模块
│ │ └─query 老师列表
│ └─user-module 用户模块
│ ├─login 登录
│ └─userInfo 个人中心
├─routes 路由
├─store 状态管理
│ └─modules 状态管理各模块
└─utils 工具函数和方法
```
````
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
\ No newline at end of file
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 菜单列表 // 菜单列表
const getMenuList = async (obj) => { const getMenuList = async (obj) => {
......
...@@ -130,7 +130,6 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -130,7 +130,6 @@ const ExpandModal = forwardRef((props, ref) => {
const { flex, theme, fontSize, ...other } = values; const { flex, theme, fontSize, ...other } = values;
if (nowRandom) { if (nowRandom) {
let props = { let props = {
title: values.title,
flex: parseInt(values.flex), flex: parseInt(values.flex),
name: values.name, name: values.name,
title: values.title, title: values.title,
...@@ -234,7 +233,6 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -234,7 +233,6 @@ const ExpandModal = forwardRef((props, ref) => {
if (parseInt(values.flex) === 1) { if (parseInt(values.flex) === 1) {
editor.insertNode({ editor.insertNode({
type: 'chapterExpandRead', type: 'chapterExpandRead',
title: values.title,
flex: parseInt(values.flex), flex: parseInt(values.flex),
name: values.name, name: values.name,
title: values.title, title: values.title,
...@@ -246,7 +244,6 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -246,7 +244,6 @@ const ExpandModal = forwardRef((props, ref) => {
} else { } else {
editor.insertNode({ editor.insertNode({
type: 'chapterExpandReadSimple', type: 'chapterExpandReadSimple',
title: values.title,
flex: parseInt(values.flex), flex: parseInt(values.flex),
name: values.name, name: values.name,
title: values.title, title: values.title,
......
...@@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef, useImperativeHandle, forwardRef } f ...@@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef, useImperativeHandle, forwardRef } f
import { Modal, Drawer, Tree, Button, Spin, Space, Input, Image } from 'antd'; import { Modal, Drawer, Tree, Button, Spin, Space, Input, Image } from 'antd';
import { LeftOutlined, RightOutlined } from '@ant-design/icons'; import { LeftOutlined, RightOutlined } from '@ant-design/icons';
import { getInfoByChapterId } from '@/pages/books/section/request'; import { getInfoByChapterId } from '@/pages/books/section/request';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import $, { event } from 'jquery'; import $, { event } from 'jquery';
import baike from '@/assets/images/editor/icon-baike.png'; import baike from '@/assets/images/editor/icon-baike.png';
import { getChapterTopic, expandReadInfo } from '../utils/request'; import { getChapterTopic, expandReadInfo } from '../utils/request';
...@@ -14,7 +14,34 @@ import { clacTopicText } from '@/utils/common'; ...@@ -14,7 +14,34 @@ import { clacTopicText } from '@/utils/common';
import hljs from 'highlight.js'; import hljs from 'highlight.js';
import 'highlight.js/styles/github.css'; import 'highlight.js/styles/github.css';
const correctList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; const correctList = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
const PreviewScreen = forwardRef((props, ref) => { const PreviewScreen = forwardRef((props, ref) => {
const { editor, bookId, chapterId, gData, nowTitle } = props; const { editor, bookId, chapterId, gData, nowTitle } = props;
...@@ -240,7 +267,7 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -240,7 +267,7 @@ const PreviewScreen = forwardRef((props, ref) => {
const flex = $(aGallery).data('flex'); const flex = $(aGallery).data('flex');
const gallerylist = $(aGallery).data('gallerylist'); const gallerylist = $(aGallery).data('gallerylist');
const galleryArr = JSON.parse(decodeURI(gallerylist)); const galleryArr = JSON.parse(decodeURI(gallerylist));
setOpend(true); setOpend(true);
setHeadTitle(title); setHeadTitle(title);
if (galleryArr && galleryArr.length > 0 && galleryArr instanceof Array) { if (galleryArr && galleryArr.length > 0 && galleryArr instanceof Array) {
...@@ -251,7 +278,7 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -251,7 +278,7 @@ const PreviewScreen = forwardRef((props, ref) => {
setGalleryIndex($(target).closest('.chapter-gallery-item').index()); setGalleryIndex($(target).closest('.chapter-gallery-item').index());
} }
} else { } else {
setGallery([]) setGallery([]);
} }
setIsType('gallery'); setIsType('gallery');
setTooltip({}); setTooltip({});
...@@ -328,11 +355,14 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -328,11 +355,14 @@ const PreviewScreen = forwardRef((props, ref) => {
.each((index, item) => { .each((index, item) => {
$(item).attr('controls', true).attr('controlslist', 'nodownload'); $(item).attr('controls', true).attr('controlslist', 'nodownload');
}); });
setTimeout(() => { setTimeout(() => {
document.querySelectorAll(".preview-content-show ")[0].querySelectorAll('pre code').forEach((el) => { document
hljs.highlightElement(el); .querySelectorAll('.preview-content-show ')[0]
}); .querySelectorAll('pre code')
.forEach((el) => {
hljs.highlightElement(el);
});
}, 200); }, 200);
} }
setLoading(false); setLoading(false);
...@@ -396,7 +426,7 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -396,7 +426,7 @@ const PreviewScreen = forwardRef((props, ref) => {
setIsType('expand'); setIsType('expand');
return; return;
} }
setOpend(false); setOpend(false);
setIsType(''); setIsType('');
setExpandContent(''); setExpandContent('');
...@@ -416,7 +446,7 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -416,7 +446,7 @@ const PreviewScreen = forwardRef((props, ref) => {
</h2> </h2>
</div> </div>
<div className='preview-content-it'> <div className='preview-content-it'>
<div className="preview-content-show"> <div className='preview-content-show'>
<Spin spinning={loading} wrapperClassName='chapter-loading'> <Spin spinning={loading} wrapperClassName='chapter-loading'>
<div <div
className='preview-content-html' className='preview-content-html'
...@@ -428,25 +458,27 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -428,25 +458,27 @@ const PreviewScreen = forwardRef((props, ref) => {
<div className='preview-content-other'> <div className='preview-content-other'>
{isType === 'gallery' && ( {isType === 'gallery' && (
<div className='gallery-prview-container'> <div className='gallery-prview-container'>
{ {gallery && gallery.length > 0 ? (
gallery && gallery.length > 0 ? ( <>
<> <div className='gallery-img'>
<div className='gallery-img'> <img
<img src={gallery[parseInt(galleryIndex)].url}
src={gallery[parseInt(galleryIndex)].url} alt={gallery[parseInt(galleryIndex)].title}
alt={gallery[parseInt(galleryIndex)].title} />
/> <div className='opa prev' onClick={galleryLeft}></div>
<div className='opa prev' onClick={galleryLeft}></div> <div className='opa next' onClick={galleryRight}></div>
<div className='opa next' onClick={galleryRight}></div> </div>
</div> <div className='steps'>
<div className='steps'> 当前 {parseInt(galleryIndex) + 1}/{gallery.length}
当前 {parseInt(galleryIndex) + 1}/{gallery.length} </div>
</div> <div className='title'>{gallery[parseInt(galleryIndex)].title}</div>
<div className='title'>{gallery[parseInt(galleryIndex)].title}</div> <div className='desc'>{gallery[parseInt(galleryIndex)].desc}</div>
<div className='desc'>{gallery[parseInt(galleryIndex)].desc}</div> </>
</> ) : (
) : (<><div className='gallery-img noData'>画廊数据异常</div></>) <>
} <div className='gallery-img noData'>画廊数据异常</div>
</>
)}
</div> </div>
)} )}
{isType === 'practice' && ( {isType === 'practice' && (
...@@ -487,7 +519,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -487,7 +519,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -533,7 +568,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -533,7 +568,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -579,7 +617,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -579,7 +617,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -625,7 +666,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -625,7 +666,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -637,7 +681,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -637,7 +681,10 @@ const PreviewScreen = forwardRef((props, ref) => {
)} )}
{textareaList.length > 0 && ( {textareaList.length > 0 && (
<div className='topic_style'> <div className='topic_style'>
<h3>{clacTopicText('textarea', radioList, checkBoxList, judgeList, fillList)}. 简答题</h3> <h3>
{clacTopicText('textarea', radioList, checkBoxList, judgeList, fillList)}.
简答题
</h3>
<div className='practice-list'> <div className='practice-list'>
{textareaList.map((item, index) => { {textareaList.map((item, index) => {
return ( return (
...@@ -671,7 +718,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -671,7 +718,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
......
import { DomEditor, SlateTransforms } from '@wangeditor/editor'; import { DomEditor, SlateTransforms } from '@wangeditor/editor';
import { h } from 'snabbdom'; import { h } from 'snabbdom';
import { throttle } from 'lodash'; import { throttle } from 'lodash-es';
import $ from 'jquery'; import $ from 'jquery';
import { getStyleValue } from '@/utils/common'; import { getStyleValue } from '@/utils/common';
import ImageAutoConf, { imageWidth100MenuChapterConf, imageWidth50MenuChapterConf, imageWidth30MenuChapterConf } from '../customer/Image'; import ImageAutoConf, {
imageWidth100MenuChapterConf,
imageWidth50MenuChapterConf,
imageWidth30MenuChapterConf,
} from '../customer/Image';
const withImageNode = (editor) => { const withImageNode = (editor) => {
const { isInline, isVoid, normalizeNode } = editor; const { isInline, isVoid, normalizeNode } = editor;
...@@ -200,13 +204,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) { ...@@ -200,13 +204,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
return; return;
} }
e.preventDefault(); e.preventDefault();
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) { if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
revers = true; // 反转。向右拖拽,减少宽度 revers = true; // 反转。向右拖拽,减少宽度
} }
init(e.clientX); // 初始化 init(e.clientX); // 初始化
}, },
} },
}), }),
h('div', { h('div', {
props: { className: 'w-e-image-dragger right-top' }, props: { className: 'w-e-image-dragger right-top' },
...@@ -227,13 +231,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) { ...@@ -227,13 +231,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
return; return;
} }
e.preventDefault(); e.preventDefault();
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) { if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
revers = true; // 反转。向右拖拽,减少宽度 revers = true; // 反转。向右拖拽,减少宽度
} }
init(e.clientX); // 初始化 init(e.clientX); // 初始化
}, },
} },
}), }),
h('div', { h('div', {
props: { className: 'w-e-image-dragger left-bottom' }, props: { className: 'w-e-image-dragger left-bottom' },
...@@ -254,13 +258,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) { ...@@ -254,13 +258,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
return; return;
} }
e.preventDefault(); e.preventDefault();
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) { if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
revers = true; // 反转。向右拖拽,减少宽度 revers = true; // 反转。向右拖拽,减少宽度
} }
init(e.clientX); // 初始化 init(e.clientX); // 初始化
}, },
} },
}), }),
h('div', { h('div', {
props: { className: 'w-e-image-dragger right-bottom' }, props: { className: 'w-e-image-dragger right-bottom' },
...@@ -281,13 +285,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) { ...@@ -281,13 +285,13 @@ function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
return; return;
} }
e.preventDefault(); e.preventDefault();
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) { if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
revers = true; // 反转。向右拖拽,减少宽度 revers = true; // 反转。向右拖拽,减少宽度
} }
init(e.clientX); // 初始化 init(e.clientX); // 初始化
}, },
} },
}), }),
], ],
); );
...@@ -452,7 +456,12 @@ const chapterImageModule = { ...@@ -452,7 +456,12 @@ const chapterImageModule = {
renderElems: [renderElemConf], renderElems: [renderElemConf],
elemsToHtml: [chapterImageElemToHtmlConf], elemsToHtml: [chapterImageElemToHtmlConf],
parseElemsHtml: [parseImageConf], parseElemsHtml: [parseImageConf],
menus: [ImageAutoConf, imageWidth100MenuChapterConf, imageWidth50MenuChapterConf, imageWidth30MenuChapterConf] menus: [
ImageAutoConf,
imageWidth100MenuChapterConf,
imageWidth50MenuChapterConf,
imageWidth30MenuChapterConf,
],
}; };
export default chapterImageModule; export default chapterImageModule;
......
...@@ -12,7 +12,7 @@ import dayjs from 'dayjs'; ...@@ -12,7 +12,7 @@ import dayjs from 'dayjs';
import { getAliOSSSTSToken } from '@/pages/setting/help/addedit/requet'; import { getAliOSSSTSToken } from '@/pages/setting/help/addedit/requet';
import { uploadFiles } from '@/utils/upload'; import { uploadFiles } from '@/utils/upload';
import QuestionEditr from '@/pages/books/question-bank/questionEditr'; import QuestionEditr from '@/pages/books/question-bank/questionEditr';
import { values } from 'lodash'; import { values } from 'lodash-es';
const CustomerTopic = forwardRef((props, ref) => { const CustomerTopic = forwardRef((props, ref) => {
const { getTopList, bookNameIdData, setPracticeStatus, bookId, setCustomerType } = props; const { getTopList, bookNameIdData, setPracticeStatus, bookId, setCustomerType } = props;
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 题目列表 // 题目列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 获取题目列表 // 获取题目列表
......
...@@ -106,14 +106,7 @@ const UserMenu = (props) => { ...@@ -106,14 +106,7 @@ const UserMenu = (props) => {
offset: [0, 3], //让下拉菜单位移 offset: [0, 3], //让下拉菜单位移
}, },
}} }}
> ></Menu>
<Menu.Item key='leftIcon' icon={<LeftOutlined />} />
{newMenus.map((menuItem) => (
<Menu.Item key={menuItem.key} icon={menuItem.icon}>
{menuItem.label}
</Menu.Item>
))}
</Menu>
</div> </div>
); );
}; };
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Layout, Spin } from 'antd'; import { Layout, Spin } from 'antd';
import { Outlet, useNavigate } from 'react-router-dom'; import { Outlet, useNavigate, Link } from 'react-router-dom';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { setMenuRouter, setOperationPermissionsList } from '@/store/modules/user'; import { setMenuRouter, setOperationPermissionsList } from '@/store/modules/user';
...@@ -29,12 +29,12 @@ const LayoutComponent = () => { ...@@ -29,12 +29,12 @@ const LayoutComponent = () => {
localStorage.setItem('kiwi.token', data.token); localStorage.setItem('kiwi.token', data.token);
setIsSSOToken(data.token); setIsSSOToken(data.token);
} }
} };
// 获取菜单 // 获取菜单
const getMenu = async () => { const getMenu = async () => {
setLoading(true); setLoading(true);
// 获取菜单内容 // 获取菜单内容
const {data, operation_permissions_list} = await getMenuList(); const { data, operation_permissions_list } = await getMenuList();
if (data && data.length) { if (data && data.length) {
setMenuRole(data); setMenuRole(data);
const menus = generateToAntdMenus(data, 'name', 'front_url', 'childs', 1); const menus = generateToAntdMenus(data, 'name', 'front_url', 'childs', 1);
...@@ -71,13 +71,12 @@ const LayoutComponent = () => { ...@@ -71,13 +71,12 @@ const LayoutComponent = () => {
<Spin spinning={loading}> <Spin spinning={loading}>
<Header className='layout-header'> <Header className='layout-header'>
<div className='header-logo'> <div className='header-logo'>
<img src={logo} alt='logo' /> <Link to='/'>
<span></span> <img src={logo} alt='logo' />
</Link>
</div> </div>
<UserMenu menuList={menuList} /> <UserMenu menuList={menuList} />
{ {menuList && menuList.length && <UserInfo />}
menuList && menuList.length && (<UserInfo />)
}
</Header> </Header>
<Content className='layout-content'> <Content className='layout-content'>
<div className='crumb'> <div className='crumb'>
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 用户信息 // 用户信息
const getUserInfo = async (obj) => { const getUserInfo = async (obj) => {
...@@ -197,5 +197,5 @@ export { ...@@ -197,5 +197,5 @@ export {
setRead, setRead,
setAllRead, setAllRead,
loginout, loginout,
checkSSOLogin checkSSOLogin,
}; };
...@@ -21,24 +21,24 @@ import { GlobalProvider } from './layout/GlobalContext.jsx'; ...@@ -21,24 +21,24 @@ import { GlobalProvider } from './layout/GlobalContext.jsx';
import 'dayjs/locale/zh-cn'; import 'dayjs/locale/zh-cn';
ReactDOM.createRoot(document.getElementById('root')).render( ReactDOM.createRoot(document.getElementById('root')).render(
// <React.StrictMode> <React.StrictMode>
<Provider store={store}> <Provider store={store}>
<PersistGate loading={null} persistor={persistor}> <PersistGate loading={null} persistor={persistor}>
<ConfigProvider <ConfigProvider
locale={zhCN} locale={zhCN}
theme={{ theme={{
token: { token: {
colorPrimary: '#ab1941', colorPrimary: '#ab1941',
}, },
}} }}
> >
<Router> <Router>
<GlobalProvider> <GlobalProvider>
<App /> <App />
</GlobalProvider> </GlobalProvider>
</Router> </Router>
</ConfigProvider> </ConfigProvider>
</PersistGate> </PersistGate>
</Provider>, </Provider>
// </React.StrictMode>, </React.StrictMode>,
); );
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 广告位列表 // 广告位列表
const getPositionList = async (obj) => { const getPositionList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 广告列表 // 广告列表
const getList = async (obj) => { const getList = async (obj) => {
......
...@@ -10,14 +10,41 @@ import { ...@@ -10,14 +10,41 @@ import {
findFirstNotHasChildren, findFirstNotHasChildren,
clacTopicText, clacTopicText,
} from '@/utils/common'; } from '@/utils/common';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import $ from 'jquery'; import $ from 'jquery';
import '@/common/preview.less'; import '@/common/preview.less';
import hljs from 'highlight.js'; import hljs from 'highlight.js';
import 'highlight.js/styles/github.css'; import 'highlight.js/styles/github.css';
const correctList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; const correctList = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
const PreviewScreen = forwardRef((props, ref) => { const PreviewScreen = forwardRef((props, ref) => {
const { bookId } = props; const { bookId } = props;
...@@ -137,9 +164,12 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -137,9 +164,12 @@ const PreviewScreen = forwardRef((props, ref) => {
}); });
setTimeout(() => { setTimeout(() => {
document.querySelectorAll(".preview-content-show ")[0].querySelectorAll('pre code').forEach((el) => { document
hljs.highlightElement(el); .querySelectorAll('.preview-content-show ')[0]
}); .querySelectorAll('pre code')
.forEach((el) => {
hljs.highlightElement(el);
});
}, 200); }, 200);
} }
setLoading(false); setLoading(false);
...@@ -306,7 +336,7 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -306,7 +336,7 @@ const PreviewScreen = forwardRef((props, ref) => {
setGalleryIndex($(target).closest('.chapter-gallery-item').index()); setGalleryIndex($(target).closest('.chapter-gallery-item').index());
} }
} else { } else {
setGallery([]) setGallery([]);
} }
setOpend(true); setOpend(true);
...@@ -484,25 +514,27 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -484,25 +514,27 @@ const PreviewScreen = forwardRef((props, ref) => {
<div className='preview-content-other'> <div className='preview-content-other'>
{isType === 'gallery' && ( {isType === 'gallery' && (
<div className='gallery-prview-container'> <div className='gallery-prview-container'>
{ {gallery && gallery.length > 0 ? (
gallery && gallery.length > 0 ? ( <>
<> <div className='gallery-img'>
<div className='gallery-img'> <img
<img src={gallery[parseInt(galleryIndex)].url}
src={gallery[parseInt(galleryIndex)].url} alt={gallery[parseInt(galleryIndex)].title}
alt={gallery[parseInt(galleryIndex)].title} />
/> <div className='opa prev' onClick={galleryLeft}></div>
<div className='opa prev' onClick={galleryLeft}></div> <div className='opa next' onClick={galleryRight}></div>
<div className='opa next' onClick={galleryRight}></div> </div>
</div> <div className='steps'>
<div className='steps'> 当前 {parseInt(galleryIndex) + 1}/{gallery.length}
当前 {parseInt(galleryIndex) + 1}/{gallery.length} </div>
</div> <div className='title'>{gallery[parseInt(galleryIndex)].title}</div>
<div className='title'>{gallery[parseInt(galleryIndex)].title}</div> <div className='desc'>{gallery[parseInt(galleryIndex)].desc}</div>
<div className='desc'>{gallery[parseInt(galleryIndex)].desc}</div> </>
</> ) : (
) : (<><div className='gallery-img noData'>画廊数据异常</div></>) <>
} <div className='gallery-img noData'>画廊数据异常</div>
</>
)}
</div> </div>
)} )}
{isType === 'practice' && ( {isType === 'practice' && (
...@@ -543,7 +575,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -543,7 +575,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -589,7 +624,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -589,7 +624,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -635,7 +673,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -635,7 +673,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -681,7 +722,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -681,7 +722,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
...@@ -693,7 +737,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -693,7 +737,10 @@ const PreviewScreen = forwardRef((props, ref) => {
)} )}
{textareaList.length > 0 && ( {textareaList.length > 0 && (
<div className='topic_style'> <div className='topic_style'>
<h3>{clacTopicText('textarea', radioList, checkBoxList, judgeList, fillList)}. 简答题</h3> <h3>
{clacTopicText('textarea', radioList, checkBoxList, judgeList, fillList)}.
简答题
</h3>
<div className='practice-list'> <div className='practice-list'>
{textareaList.map((item, index) => { {textareaList.map((item, index) => {
return ( return (
...@@ -727,7 +774,10 @@ const PreviewScreen = forwardRef((props, ref) => { ...@@ -727,7 +774,10 @@ const PreviewScreen = forwardRef((props, ref) => {
{item.question_style === 5 && ( {item.question_style === 5 && (
<div> <div>
<Input.TextArea disabled={true} autoSize={{ minRows: 4, maxRows: 6 }} /> <Input.TextArea
disabled={true}
autoSize={{ minRows: 4, maxRows: 6 }}
/>
</div> </div>
)} )}
</div> </div>
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 用户信息 // 用户信息
const getUserInfo = async (obj) => { const getUserInfo = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 分类列表 // 分类列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 讨论列表 // 讨论列表
const getList = async (obj) => { const getList = async (obj) => {
...@@ -110,7 +110,7 @@ const systemEdit = async (obj) => { ...@@ -110,7 +110,7 @@ const systemEdit = async (obj) => {
} }
}; };
// 所有上架书籍名称列表 // 所有上架书籍名称列表
const getBooklist=async (obj) => { const getBooklist = async (obj) => {
try { try {
const res = await axios.post('/book/book/getAllList', qs.stringify(obj)); const res = await axios.post('/book/book/getAllList', qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
...@@ -125,5 +125,5 @@ const getBooklist=async (obj) => { ...@@ -125,5 +125,5 @@ const getBooklist=async (obj) => {
} catch (error) { } catch (error) {
return error; return error;
} }
}; };
export { getList, delComment, changeStatus, getSystem, systemEdit,getBooklist }; export { getList, delComment, changeStatus, getSystem, systemEdit, getBooklist };
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 标签列表 // 标签列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 书籍列表 // 书籍列表
const getList = async (obj) => { const getList = async (obj) => {
...@@ -134,7 +134,7 @@ const getUploadToken = async (obj) => { ...@@ -134,7 +134,7 @@ const getUploadToken = async (obj) => {
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return data; return data;
} else { } else {
message.error(msg); message.error(msg);
...@@ -152,7 +152,7 @@ const releaseExamine = async (obj) => { ...@@ -152,7 +152,7 @@ const releaseExamine = async (obj) => {
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
...@@ -165,7 +165,7 @@ const releaseExamine = async (obj) => { ...@@ -165,7 +165,7 @@ const releaseExamine = async (obj) => {
// 导入 // 导入
const importBook = async (obj) => { const importBook = async (obj) => {
try { try {
const res = await axios.post('/book/teacher/import',obj, { const res = await axios.post('/book/teacher/import', obj, {
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },
...@@ -174,7 +174,7 @@ const importBook = async (obj) => { ...@@ -174,7 +174,7 @@ const importBook = async (obj) => {
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
...@@ -184,5 +184,14 @@ const importBook = async (obj) => { ...@@ -184,5 +184,14 @@ const importBook = async (obj) => {
return false; return false;
} }
}; };
export { getList, getInfo, addUser, editUser, delUser, export {
exportBook, exportToPdf,releaseExamine,importBook}; getList,
getInfo,
addUser,
editUser,
delUser,
exportBook,
exportToPdf,
releaseExamine,
importBook,
};
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 订单列表 // 订单列表
const getList = async (obj) => { const getList = async (obj) => {
...@@ -46,7 +46,7 @@ const refund = async (obj) => { ...@@ -46,7 +46,7 @@ const refund = async (obj) => {
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
...@@ -56,4 +56,4 @@ const refund = async (obj) => { ...@@ -56,4 +56,4 @@ const refund = async (obj) => {
return false; return false;
} }
}; };
export { getList, salesStatistics,refund }; export { getList, salesStatistics, refund };
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 题目列表 // 题目列表
const getList = async (obj) => { const getList = async (obj) => {
......
...@@ -10,7 +10,7 @@ import filter from '@/assets/images/icon/filter.png'; ...@@ -10,7 +10,7 @@ import filter from '@/assets/images/icon/filter.png';
import reload from '@/assets/images/icon/reload.png'; import reload from '@/assets/images/icon/reload.png';
import { useLocation } from 'react-router-dom'; import { useLocation } from 'react-router-dom';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import TableCom from '@/common/TableCom/index'; import TableCom from '@/common/TableCom/index';
const DiscussList = () => { const DiscussList = () => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 在售列表 // 在售列表
const getList = async (obj) => { const getList = async (obj) => {
...@@ -76,7 +76,7 @@ const publisherAdd = async (obj) => { ...@@ -76,7 +76,7 @@ const publisherAdd = async (obj) => {
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
......
...@@ -30,7 +30,7 @@ import { useDispatch, useSelector } from 'react-redux'; ...@@ -30,7 +30,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { setAutosaveTime } from '@/store/modules/editor'; import { setAutosaveTime } from '@/store/modules/editor';
import { setTreeChapter } from '@/store/modules/user'; import { setTreeChapter } from '@/store/modules/user';
import EditChapterTitle from './components/form-chapter-title'; import EditChapterTitle from './components/form-chapter-title';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import md5 from 'js-md5'; import md5 from 'js-md5';
import { import {
...@@ -384,7 +384,7 @@ const Examine = () => { ...@@ -384,7 +384,7 @@ const Examine = () => {
useEffect(() => { useEffect(() => {
console.log(expandedKeys); console.log(expandedKeys);
}, [expandedKeys]) }, [expandedKeys]);
// 编辑章节名称 // 编辑章节名称
const titleRenderDom = (node) => { const titleRenderDom = (node) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 用户信息 // 用户信息
const getUserInfo = async (obj) => { const getUserInfo = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 管理员列表 // 管理员列表
const getList1 = async (obj) => { const getList1 = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 角色列表 // 角色列表
const getAllList = async (obj) => { const getAllList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 用户列表 // 用户列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 等级列表 // 等级列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 版本列表 // 版本列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import api from './api.js' import api from './api.js';
import {get} from 'loadsh' import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 应用管理列表 // 应用管理列表
const getAppList=async (obj)=>{ const getAppList = async (obj) => {
try{ try {
const res=await axios.post(api.getAppList,qs.stringify(obj)) const res = await axios.post(api.getAppList, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
...@@ -16,32 +16,32 @@ const getAppList=async (obj)=>{ ...@@ -16,32 +16,32 @@ const getAppList=async (obj)=>{
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
// 添加应用 // 添加应用
const addApp=async (obj)=>{ const addApp = async (obj) => {
try{ try {
const res=await axios.post(api.addApp,qs.stringify(obj)) const res = await axios.post(api.addApp, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
// 获取应用详情 // 获取应用详情
const getAppInfo=async (obj)=>{ const getAppInfo = async (obj) => {
try{ try {
const res=await axios.post(api.getAppInfo,qs.stringify(obj)) const res = await axios.post(api.getAppInfo, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
...@@ -51,14 +51,14 @@ const getAppInfo=async (obj)=>{ ...@@ -51,14 +51,14 @@ const getAppInfo=async (obj)=>{
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
// 应用编辑 // 应用编辑
const editApp=async (obj)=>{ const editApp = async (obj) => {
try{ try {
const res=await axios.post(api.editApp,qs.stringify(obj)) const res = await axios.post(api.editApp, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
...@@ -68,14 +68,14 @@ const editApp=async (obj)=>{ ...@@ -68,14 +68,14 @@ const editApp=async (obj)=>{
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
// 启用/停用 // 启用/停用
const changeStatus=async (obj)=>{ const changeStatus = async (obj) => {
try{ try {
const res=await axios.post(api.changeStatus,qs.stringify(obj)) const res = await axios.post(api.changeStatus, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
...@@ -85,33 +85,26 @@ const changeStatus=async (obj)=>{ ...@@ -85,33 +85,26 @@ const changeStatus=async (obj)=>{
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
// 删除应用 // 删除应用
const delApp=async (obj)=>{ const delApp = async (obj) => {
try{ try {
const res=await axios.post(api.delApp,qs.stringify(obj)) const res = await axios.post(api.delApp, qs.stringify(obj));
const code = get(res, 'data.code', 0); const code = get(res, 'data.code', 0);
const data = get(res, 'data.data', []); const data = get(res, 'data.data', []);
const msg = get(res, 'data.message', '数据获取失败!'); const msg = get(res, 'data.message', '数据获取失败!');
if (code === 200) { if (code === 200) {
message.success(msg) message.success(msg);
return true; return true;
} else { } else {
message.error(msg); message.error(msg);
return false; return false;
} }
}catch(error){ } catch (error) {
return false; return false;
} }
} };
export { export { getAppList, addApp, getAppInfo, editApp, changeStatus, delApp };
getAppList,
addApp,
getAppInfo,
editApp,
changeStatus,
delApp,
}
\ No newline at end of file
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 优惠券列表 // 优惠券列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { message } from 'antd'; import { message } from 'antd';
import { get } from 'loadsh'; import { get } from 'lodash-es';
// oss // oss
const getAliOSSSTSToken = async (obj) => { const getAliOSSSTSToken = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { message } from 'antd'; import { message } from 'antd';
import { get } from 'loadsh'; import { get } from 'lodash-es';
// 获取列表 // 获取列表
const getList = async (obj) => { const getList = async (obj) => {
try { try {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { message } from 'antd'; import { message } from 'antd';
import { get } from 'loadsh'; import { get } from 'lodash-es';
// 获取积分设置信息 // 获取积分设置信息
const getIntegral = async (obj) => { const getIntegral = async (obj) => {
try { try {
......
...@@ -27,7 +27,7 @@ import imports from '@/assets/images/icon/import.png'; ...@@ -27,7 +27,7 @@ import imports from '@/assets/images/icon/import.png';
import success from '@/assets/images/success.png'; import success from '@/assets/images/success.png';
import err from '@/assets/images/err.png'; import err from '@/assets/images/err.png';
import TableCom from '@/common/TableCom/index'; import TableCom from '@/common/TableCom/index';
import _ from 'loadsh'; import _ from 'lodash-es';
const Sensitive = () => { const Sensitive = () => {
const [data, setData] = useState([]); const [data, setData] = useState([]);
const [page_size, setpage_size] = useState(10); const [page_size, setpage_size] = useState(10);
...@@ -97,7 +97,7 @@ const Sensitive = () => { ...@@ -97,7 +97,7 @@ const Sensitive = () => {
name: 'file', name: 'file',
accept: '.xlsx', accept: '.xlsx',
showUploadList: false, showUploadList: false,
beforeUpload (file) { beforeUpload(file) {
const suffixArr = ['xlsx']; const suffixArr = ['xlsx'];
const suffix = file.name.substring(file.name.lastIndexOf('.') + 1); const suffix = file.name.substring(file.name.lastIndexOf('.') + 1);
if (!suffixArr.includes(suffix)) { if (!suffixArr.includes(suffix)) {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { message } from 'antd'; import { message } from 'antd';
import { get } from 'loadsh'; import { get } from 'lodash-es';
// 敏感词 // 敏感词
// 获取列表 // 获取列表
const getList = async (obj) => { const getList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 老师列表 // 老师列表
const getTeacherList = async (obj) => { const getTeacherList = async (obj) => {
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import api from './api.js'; import api from './api.js';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
const login = async (obj) => { const login = async (obj) => {
...@@ -17,12 +17,12 @@ const login = async (obj) => { ...@@ -17,12 +17,12 @@ const login = async (obj) => {
if (code === 200) { if (code === 200) {
return { return {
code, code,
...data ...data,
}; };
} else { } else {
message.error(msg); message.error(msg);
return { return {
msg msg,
}; };
} }
} catch (error) { } catch (error) {
......
import axios from '@/utils/request'; import axios from '@/utils/request';
import { message } from 'antd'; import { message } from 'antd';
import api from './api'; import api from './api';
import { get } from 'lodash'; import { get } from 'lodash-es';
import qs from 'qs'; import qs from 'qs';
// 获取图形验证码 // 获取图形验证码
......
import axios from '@/utils/request.js'; import axios from '@/utils/request.js';
import qs from 'qs'; import qs from 'qs';
import { message } from 'antd'; import { message } from 'antd';
import { get } from 'loadsh'; import { get } from 'lodash-es';
// oss // oss
const getAliOSSSTSToken = async (obj) => { const getAliOSSSTSToken = async (obj) => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import Axios from 'axios'; import Axios from 'axios';
import { message, Modal, notification } from 'antd'; import { message, Modal, notification } from 'antd';
import md5 from 'js-md5'; import md5 from 'js-md5';
import { get } from 'lodash'; import { get } from 'lodash-es';
import cancelRequestArr from './cancelRequestArr'; import cancelRequestArr from './cancelRequestArr';
import { sortObjASCII } from '@/utils/common.js'; import { sortObjASCII } from '@/utils/common.js';
import qs from 'qs'; import qs from 'qs';
...@@ -41,7 +41,7 @@ axios.interceptors.request.use( ...@@ -41,7 +41,7 @@ axios.interceptors.request.use(
// 而后我们可以在响应拦截器中,根据状态码进行一些统一的操作。 // 而后我们可以在响应拦截器中,根据状态码进行一些统一的操作。
if (axios.errorNotified) { if (axios.errorNotified) {
return new Error('') return new Error('');
} }
const token = getToken(); const token = getToken();
...@@ -60,8 +60,8 @@ axios.interceptors.request.use( ...@@ -60,8 +60,8 @@ axios.interceptors.request.use(
signData.appId = appId; signData.appId = appId;
signData.appSecret = appSecret; signData.appSecret = appSecret;
signData.timestamp = timeStr; signData.timestamp = timeStr;
let s = '' let s = '';
if (config.url.indexOf('.tiangong.cn') > -1) { if (config.url.indexOf('.tiangong.cn') > -1) {
s = config.url; s = config.url;
} else { } else {
......
import axios from './request'; import axios from './request';
import qs from 'qs'; import qs from 'qs';
import { get } from 'loadsh'; import { get } from 'lodash-es';
import { message } from 'antd'; import { message } from 'antd';
// 统一上传 // 统一上传
const uploadFiles = async (obj) => { const uploadFiles = async (obj) => {
......
import { defineConfig } from 'vite'; import { fileURLToPath, URL } from 'node:url';
import react from '@vitejs/plugin-react';
import path from 'path';
import * as fs from 'fs';
import * as dotenv from 'dotenv';
import progress from 'vite-plugin-progress';
import colors from 'picocolors';
// import pluginBasicSsl from '@vitejs/plugin-basic-ssl';
// https://vitejs.dev/config/ import { defineConfig, loadEnv } from 'vite';
export default defineConfig(() => { import react from '@vitejs/plugin-react-swc';
const NODE_ENV = process.env.NODE_ENV || 'development'; import mkcert from 'vite-plugin-mkcert';
const envFiles = [`.env.${NODE_ENV}`];
for (const file of envFiles) {
const envConfig = dotenv.parse(fs.readFileSync(file));
// eslint-disable-next-line guard-for-in
for (const k in envConfig) {
process.env[k] = envConfig[k];
}
}
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
return { return {
plugins: [ plugins: [react(), mkcert()],
react(),
// pluginBasicSsl(),
progress({
format: `${colors.green(colors.bold('Bouilding'))} ${colors.cyan('[:bar]')} :percent`,
}),
],
server: { server: {
port: 5178,
host: '0.0.0.0',
strictPort: true,
open: true, open: true,
https: false, host: 'dev.ezijing.com',
hmr: {
overlay: true,
},
proxy: { proxy: {
'/api': { '/api': {
target: process.env.VITE_API_URL_WORD, target: env.VITE_API_URL_WORD,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), // 将请求路径中的“/api”前缀替换为空字符串 rewrite: (path) => path.replace(/^\/api/, ''), // 将请求路径中的“/api”前缀替换为空字符串
}, },
'/openapi': { '/openapi': {
target: process.env.VITE_API_OPENAI_URL, target: env.VITE_API_OPENAI_URL,
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/openapi/, '/openapi'), // 将请求路径中的“/api”前缀替换为空字符串 rewrite: (path) => path.replace(/^\/openapi/, '/openapi'), // 将请求路径中的“/api”前缀替换为空字符串
}, },
...@@ -51,8 +27,7 @@ export default defineConfig(() => { ...@@ -51,8 +27,7 @@ export default defineConfig(() => {
}, },
resolve: { resolve: {
alias: { alias: {
'@': path.resolve(__dirname, './src'), '@': fileURLToPath(new URL('./src', import.meta.url)),
'@/public': path.resolve(__dirname, './public'),
}, },
}, },
css: { css: {
...@@ -62,23 +37,5 @@ export default defineConfig(() => { ...@@ -62,23 +37,5 @@ export default defineConfig(() => {
}, },
}, },
}, },
optimizeDeps: {},
build: {
// rollupOptions: {
// external: ['easy-formula-editor'],
// },
// rollupOptions: {
// external: ['highlight.js'],
// },
commonjsOptions: {},
sourcemap: false,
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
}; };
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论