Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI_BOOK_TOOL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
AI_BOOK_TOOL
Commits
96409f99
Commit
96409f99
authored
Oct 01, 2026
by
Jeff nan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加权限验证
parent
524a1f81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
index.js
form/index.js
+18
-1
index.js
play/index.js
+28
-1
No files found.
form/index.js
View file @
96409f99
...
...
@@ -142,6 +142,23 @@ new Vue({
methods
:
{
async
getAuthKey
()
{
const
resp
=
await
callServerMethod
(
'
getAuthKey
'
);
if
(
resp
.
msg
==
'
success
'
)
{
return
resp
.
data
;
}
else
{
this
.
$message
.
error
(
resp
.
data
);
return
''
;
}
},
// open API 鉴权 query:auth_key / user_sign
async
appendApiAuthQuery
(
url
)
{
const
authKey
=
await
this
.
getAuthKey
();
const
sep
=
url
.
includes
(
'
?
'
)
?
'
&
'
:
'
?
'
;
return
`
${
url
}${
sep
}
auth_key=
${
encodeURIComponent
(
authKey
||
''
)}
&user_sign=
${
encodeURIComponent
(
'
syllabus_cw_make
'
)}
`
;
},
async
tryAI
()
{
const
urlParams
=
new
URLSearchParams
(
window
.
location
.
search
);
const
coursewareId
=
urlParams
.
get
(
'
course_id
'
);
...
...
@@ -160,7 +177,7 @@ new Vue({
this
.
aiAnalysisStatus
=
'
正在发送请求...
'
;
this
.
aiAnalysisProgress
=
20
;
const
requestUrl
=
this
.
AI_SERVER_URL
+
'
/open/api/ai/dpe/v1/pagerepair
'
;
const
requestUrl
=
await
this
.
appendApiAuthQuery
(
this
.
AI_SERVER_URL
+
'
/open/api/ai/dpe/v1/pagerepair
'
)
;
const
requestData
=
{
courseware_id
:
coursewareId
||
1783332
,
page_number
:
this
.
currentPageIndex
};
await
new
Promise
((
resolve
,
reject
)
=>
{
...
...
play/index.js
View file @
96409f99
//对应模板的名称,这个可以不写,但是最好是能写上,同时开发多个模板的情况下如果不写这个,本地缓存可能会存在混乱
var
t_name
=
'
AI_BOOK_TOOL
'
;
const
callServerMethod
=
(
method
,
data
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
window
.
courseware
.
onEvent
(
method
,
(
result
,
next
)
=>
{
resolve
(
result
);
next
();
},
t_name
);
window
.
courseware
.
sendEvent
(
method
,
data
,
t_name
);
});
}
$
(
function
()
{
window
.
courseware
.
getData
(
function
(
data
)
{
if
(
!
data
)
{
...
...
@@ -277,6 +287,23 @@ function initializeApp(data) {
},
methods
:
{
async
getAuthKey
()
{
const
resp
=
await
callServerMethod
(
'
getAuthKey
'
);
if
(
resp
.
msg
==
'
success
'
)
{
return
resp
.
data
;
}
else
{
this
.
$message
.
error
(
resp
.
data
);
return
''
;
}
},
// open API 鉴权 query:auth_key / user_sign
async
appendApiAuthQuery
(
url
)
{
const
authKey
=
await
this
.
getAuthKey
();
const
sep
=
url
.
includes
(
'
?
'
)
?
'
&
'
:
'
?
'
;
return
`
${
url
}${
sep
}
auth_key=
${
encodeURIComponent
(
authKey
||
''
)}
&user_sign=
${
encodeURIComponent
(
'
syllabus_cw_make
'
)}
`
;
},
// 初始化音频
initAudio
()
{
if
(
!
this
.
audioUrl
)
{
...
...
@@ -1185,7 +1212,7 @@ function initializeApp(data) {
// 滚动到底部
this
.
scrollToBottom
();
const
requestUrl
=
this
.
AI_SERVER_URL
+
'
/open/api/ai/dpe/v1/super/translatetoc
'
;
const
requestUrl
=
await
this
.
appendApiAuthQuery
(
this
.
AI_SERVER_URL
+
'
/open/api/ai/dpe/v1/super/translatetoc
'
)
;
const
requestData
=
{
word
:
word
,
sentence
:
sentence
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment