ai-read-over-pro 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/components/demo/api/index.js +81 -0
- package/components/demo/index.js +7 -0
- package/components/demo/plugins/cache.js +77 -0
- package/components/demo/src/chat-tools.vue +275 -0
- package/components/demo/src/main.vue +378 -0
- package/components/demo/src/member-table.vue +204 -0
- package/components/demo/src/read-over.vue +238 -0
- package/components/demo/src/tab-filter.vue +223 -0
- package/components/demo/static/bg-img.svg +10 -0
- package/components/demo/static/cai-active.png +0 -0
- package/components/demo/static/cai.png +0 -0
- package/components/demo/static/correct.png +0 -0
- package/components/demo/static/error.png +0 -0
- package/components/demo/static/filter-block.svg +23 -0
- package/components/demo/static/filter-block_hover.svg +23 -0
- package/components/demo/static/filter-block_selected.svg +23 -0
- package/components/demo/static/filter.png +0 -0
- package/components/demo/static/logo.png +0 -0
- package/components/demo/static/robot.png +0 -0
- package/components/demo/static/send-icon.png +0 -0
- package/components/demo/static/zan-active.png +0 -0
- package/components/demo/static/zan.png +0 -0
- package/components/demo/utils/aes-utils.js +35 -0
- package/components/demo/utils/config.js +42 -0
- package/components/demo/utils/constants.js +13 -0
- package/components/demo/utils/request.js +69 -0
- package/components/index.js +15 -0
- package/dist/ai-read-over-pro.common.js +12858 -0
- package/dist/ai-read-over-pro.common.js.map +1 -0
- package/dist/ai-read-over-pro.css +1 -0
- package/dist/ai-read-over-pro.umd.js +12877 -0
- package/dist/ai-read-over-pro.umd.js.map +1 -0
- package/dist/ai-read-over-pro.umd.min.js +23 -0
- package/dist/ai-read-over-pro.umd.min.js.map +1 -0
- package/dist/demo.html +1 -0
- package/dist/img/bg-img.a3a40197.svg +10 -0
- package/dist/img/filter-block.6f369747.svg +23 -0
- package/dist/img/filter-block_hover.5314be0a.svg +23 -0
- package/dist/img/filter-block_selected.f523d7f3.svg +23 -0
- package/package.json +44 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient gradientUnits="userSpaceOnUse" x1="799.91452991453" y1="264" x2="840" y2="344" id="LinearGradient144">
|
|
5
|
+
<stop id="Stop145" stop-color="#ffffff" offset="0" />
|
|
6
|
+
<stop id="Stop146" stop-color="#e0e0ff" offset="1" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter x="752px" y="257px" width="96px" height="96px" filterUnits="userSpaceOnUse" id="filter147">
|
|
9
|
+
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner" />
|
|
10
|
+
<feGaussianBlur stdDeviation="4" in="shadowOffsetInner" result="shadowGaussian" />
|
|
11
|
+
<feComposite in2="shadowGaussian" operator="atop" in="SourceAlpha" result="shadowComposite" />
|
|
12
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.188235294117647 0 0 0 0 0.376470588235294 0 0 0 0 0.564705882352941 0 0 0 0.156862745098039 0 " in="shadowComposite" />
|
|
13
|
+
</filter>
|
|
14
|
+
<g id="widget148">
|
|
15
|
+
<path d="M 760.5 276 A 11.5 11.5 0 0 1 772 264.5 L 828 264.5 A 11.5 11.5 0 0 1 839.5 276 L 839.5 332 A 11.5 11.5 0 0 1 828 343.5 L 772 343.5 A 11.5 11.5 0 0 1 760.5 332 L 760.5 276 Z " fill-rule="nonzero" fill="url(#LinearGradient144)" stroke="none" />
|
|
16
|
+
<path d="M 760.5 276 A 11.5 11.5 0 0 1 772 264.5 L 828 264.5 A 11.5 11.5 0 0 1 839.5 276 L 839.5 332 A 11.5 11.5 0 0 1 828 343.5 L 772 343.5 A 11.5 11.5 0 0 1 760.5 332 L 760.5 276 Z " stroke-width="1" stroke="#ffffff" fill="none" />
|
|
17
|
+
</g>
|
|
18
|
+
</defs>
|
|
19
|
+
<g transform="matrix(1 0 0 1 -752 -257 )">
|
|
20
|
+
<use xlink:href="#widget148" filter="url(#filter147)" />
|
|
21
|
+
<use xlink:href="#widget148" />
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient gradientUnits="userSpaceOnUse" x1="799.91452991453" y1="264" x2="840" y2="344" id="LinearGradient149">
|
|
5
|
+
<stop id="Stop150" stop-color="#ffffff" offset="0" />
|
|
6
|
+
<stop id="Stop151" stop-color="#eeeeff" offset="1" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter x="752px" y="257px" width="96px" height="96px" filterUnits="userSpaceOnUse" id="filter152">
|
|
9
|
+
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner" />
|
|
10
|
+
<feGaussianBlur stdDeviation="4" in="shadowOffsetInner" result="shadowGaussian" />
|
|
11
|
+
<feComposite in2="shadowGaussian" operator="atop" in="SourceAlpha" result="shadowComposite" />
|
|
12
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.188235294117647 0 0 0 0 0.376470588235294 0 0 0 0 0.564705882352941 0 0 0 0.156862745098039 0 " in="shadowComposite" />
|
|
13
|
+
</filter>
|
|
14
|
+
<g id="widget153">
|
|
15
|
+
<path d="M 760.5 276 A 11.5 11.5 0 0 1 772 264.5 L 828 264.5 A 11.5 11.5 0 0 1 839.5 276 L 839.5 332 A 11.5 11.5 0 0 1 828 343.5 L 772 343.5 A 11.5 11.5 0 0 1 760.5 332 L 760.5 276 Z " fill-rule="nonzero" fill="url(#LinearGradient149)" stroke="none" />
|
|
16
|
+
<path d="M 760.5 276 A 11.5 11.5 0 0 1 772 264.5 L 828 264.5 A 11.5 11.5 0 0 1 839.5 276 L 839.5 332 A 11.5 11.5 0 0 1 828 343.5 L 772 343.5 A 11.5 11.5 0 0 1 760.5 332 L 760.5 276 Z " stroke-width="1" stroke="#ffffff" fill="none" />
|
|
17
|
+
</g>
|
|
18
|
+
</defs>
|
|
19
|
+
<g transform="matrix(1 0 0 1 -752 -257 )">
|
|
20
|
+
<use xlink:href="#widget153" filter="url(#filter152)" />
|
|
21
|
+
<use xlink:href="#widget153" />
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient gradientUnits="userSpaceOnUse" x1="799.91452991453" y1="264" x2="840" y2="344" id="LinearGradient154">
|
|
5
|
+
<stop id="Stop155" stop-color="#ffffff" offset="0" />
|
|
6
|
+
<stop id="Stop156" stop-color="#eeeeff" offset="1" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter x="752px" y="257px" width="96px" height="96px" filterUnits="userSpaceOnUse" id="filter157">
|
|
9
|
+
<feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetInner" />
|
|
10
|
+
<feGaussianBlur stdDeviation="4" in="shadowOffsetInner" result="shadowGaussian" />
|
|
11
|
+
<feComposite in2="shadowGaussian" operator="atop" in="SourceAlpha" result="shadowComposite" />
|
|
12
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.188235294117647 0 0 0 0 0.376470588235294 0 0 0 0 0.564705882352941 0 0 0 0.156862745098039 0 " in="shadowComposite" />
|
|
13
|
+
</filter>
|
|
14
|
+
<g id="widget158">
|
|
15
|
+
<path d="M 762 276 A 10 10 0 0 1 772 266 L 828 266 A 10 10 0 0 1 838 276 L 838 332 A 10 10 0 0 1 828 342 L 772 342 A 10 10 0 0 1 762 332 L 762 276 Z " fill-rule="nonzero" fill="url(#LinearGradient154)" stroke="none" />
|
|
16
|
+
<path d="M 761 276 A 11 11 0 0 1 772 265 L 828 265 A 11 11 0 0 1 839 276 L 839 332 A 11 11 0 0 1 828 343 L 772 343 A 11 11 0 0 1 761 332 L 761 276 Z " stroke-width="2" stroke="#6060e0" fill="none" stroke-opacity="0.8" />
|
|
17
|
+
</g>
|
|
18
|
+
</defs>
|
|
19
|
+
<g transform="matrix(1 0 0 1 -752 -257 )">
|
|
20
|
+
<use xlink:href="#widget158" filter="url(#filter157)" />
|
|
21
|
+
<use xlink:href="#widget158" />
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import CryptoJS from 'crypto-js';
|
|
2
|
+
import { Base64 } from 'js-base64';
|
|
3
|
+
|
|
4
|
+
const a = 'RU5D';
|
|
5
|
+
const b = 'ODE';
|
|
6
|
+
const c = 'AE';
|
|
7
|
+
const d = 'S_K';
|
|
8
|
+
const e = 'RVkx';
|
|
9
|
+
const z = Base64.decode(a).concat(b, '_', c, d, Base64.decode(e), '6');
|
|
10
|
+
const f = 'd3d3';
|
|
11
|
+
const g = 'w.e';
|
|
12
|
+
const i = 'mru';
|
|
13
|
+
const j = 'bik';
|
|
14
|
+
const k = 'Y29t';
|
|
15
|
+
const n = Base64.decode(f).concat(g, i, j, '.', Base64.decode(k));
|
|
16
|
+
const key = CryptoJS.enc.Utf8.parse(z);
|
|
17
|
+
const iv = CryptoJS.enc.Utf8.parse(n);
|
|
18
|
+
// 解密方法
|
|
19
|
+
export function decrypt(word) {
|
|
20
|
+
const stringToEncode = 'Hello, World!'; // 要进行 Base64 编码的字符串
|
|
21
|
+
const encodedString = Base64.encode(stringToEncode); // 进行 Base64 编码
|
|
22
|
+
const decodedString = Base64.decode(encodedString); // 进行 Base64 解码
|
|
23
|
+
|
|
24
|
+
let base64 = CryptoJS.enc.Base64.parse(word);
|
|
25
|
+
let src = CryptoJS.enc.Base64.stringify(base64);
|
|
26
|
+
|
|
27
|
+
let decrypt = CryptoJS.AES.decrypt(src, key, {
|
|
28
|
+
iv: iv,
|
|
29
|
+
mode: CryptoJS.mode.CBC,
|
|
30
|
+
padding: CryptoJS.pad.Pkcs7,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
|
|
34
|
+
return decryptedStr.toString();
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ssoAuth, authUser } from '../api/index';
|
|
2
|
+
import constants from '../utils/constants';
|
|
3
|
+
import cache from '../plugins/cache';
|
|
4
|
+
export const errorList = [
|
|
5
|
+
{
|
|
6
|
+
name: "格式问题",
|
|
7
|
+
code: "1",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "逻辑问题",
|
|
11
|
+
code: "2",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "有害信息",
|
|
15
|
+
code: "3",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "事实错误",
|
|
19
|
+
code: "4",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "没有帮助",
|
|
23
|
+
code: "5",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "答非所问",
|
|
27
|
+
code: "6",
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
export const getUserInfo = async (token) => {
|
|
32
|
+
const ssoRes = await ssoAuth(token);
|
|
33
|
+
const userRes = await authUser({
|
|
34
|
+
'X-Auth-User': encodeURIComponent(ssoRes.name),
|
|
35
|
+
'X-Auth-Token': ssoRes.password,
|
|
36
|
+
'X-Enterprise-Id': `${constants['X-Enterprise-Id']}`,
|
|
37
|
+
'X-App-Id': `${constants['X-App-Id']}`,
|
|
38
|
+
'X-App-Secret': `${constants['X-App-Secret']}`,
|
|
39
|
+
'X-Auth-User-Type': '1',
|
|
40
|
+
});
|
|
41
|
+
cache.session.setJSON('SRKJ_TOKEN_CACHE', userRes);
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let appId = '601a39a2a4a7cd88d5ddcef5';
|
|
2
|
+
const whiteList = ['/home', '/overview'];
|
|
3
|
+
if (process.env.VITE_APP_BUILD_TYPE === 'aliyun') {
|
|
4
|
+
appId = '6572ba195ec962924cc39951';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
'X-Enterprise-Id': 'www.hep-zj.com.cn',
|
|
9
|
+
'X-App-Id': '90403a27c0704259ab7a3c8aab4489b3',
|
|
10
|
+
'X-App-Secret': 'bc11ce7c44824fcaa23ff301a54b7094',
|
|
11
|
+
appId,
|
|
12
|
+
whiteList,
|
|
13
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import cache from '../plugins/cache'
|
|
3
|
+
import { Message } from 'element-ui'
|
|
4
|
+
const door = sessionStorage.getItem('AI_BASE_URL_FOR_TEST');
|
|
5
|
+
import { decrypt } from './aes-utils';
|
|
6
|
+
|
|
7
|
+
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
8
|
+
|
|
9
|
+
const service = axios.create({
|
|
10
|
+
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
|
11
|
+
baseURL: door || 'https://zjyw.icve.com.cn/ai-api',
|
|
12
|
+
// 超时
|
|
13
|
+
timeout: 80000
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
service.interceptors.request.use(config => {
|
|
17
|
+
if (cache.session.getJSON('SRKJ_TOKEN_CACHE')) {
|
|
18
|
+
config.headers["X-Id-Token"] = cache.session.getJSON('SRKJ_TOKEN_CACHE');
|
|
19
|
+
}
|
|
20
|
+
// 是否需要防止数据重复提交
|
|
21
|
+
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
|
|
22
|
+
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
|
23
|
+
const requestObj = {
|
|
24
|
+
url: config.url,
|
|
25
|
+
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
|
26
|
+
time: new Date().getTime()
|
|
27
|
+
}
|
|
28
|
+
const sessionObj = cache.session.getJSON('sessionObj')
|
|
29
|
+
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
|
30
|
+
cache.session.setJSON('sessionObj', requestObj)
|
|
31
|
+
} else {
|
|
32
|
+
const s_url = sessionObj.url; // 请求地址
|
|
33
|
+
const s_data = sessionObj.data; // 请求数据
|
|
34
|
+
const s_time = sessionObj.time; // 请求时间
|
|
35
|
+
const interval = 100; // 间隔时间(ms),小于此时间视为重复提交
|
|
36
|
+
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
|
37
|
+
} else {
|
|
38
|
+
cache.session.setJSON('sessionObj', requestObj)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return config
|
|
43
|
+
}, error => {
|
|
44
|
+
Promise.reject(error)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
service.interceptors.response.use(res => {
|
|
48
|
+
// 二进制数据则直接返回
|
|
49
|
+
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
|
|
50
|
+
return res.data
|
|
51
|
+
}
|
|
52
|
+
let srkjData = res.data;
|
|
53
|
+
if (srkjData) {
|
|
54
|
+
const respData = decrypt(srkjData);
|
|
55
|
+
try {
|
|
56
|
+
srkjData = JSON.parse(respData);
|
|
57
|
+
} catch (e) {}
|
|
58
|
+
}
|
|
59
|
+
if (res.status === 401) {
|
|
60
|
+
Message.warning(srkjData.message.description);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!srkjData.resultCode.endsWith('0000')) {
|
|
64
|
+
Message.warning(srkjData.message.description)
|
|
65
|
+
}
|
|
66
|
+
return srkjData.queryData || srkjData.data || srkjData.token;
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
export default service
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AiReadOver from './demo'
|
|
2
|
+
const components = {
|
|
3
|
+
AiReadOver
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const install = function (Vue) {
|
|
7
|
+
if (install.installed) return
|
|
8
|
+
Object.keys(components).forEach(key => {
|
|
9
|
+
Vue.component(components[key].name,components[key])
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
install
|
|
15
|
+
}
|