Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
向伟
educationStu
Commits
506ac1eb
Commit
506ac1eb
authored
Jan 13, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
856d4c82
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
46 deletions
+31
-46
index.vue
src/pages/index/index.vue
+1
-1
login.vue
src/pages/login/login.vue
+2
-2
word.vue
src/pages/word/word.vue
+3
-1
request.js
src/utils/request.js
+25
-42
No files found.
src/pages/index/index.vue
View file @
506ac1eb
...
...
@@ -64,7 +64,7 @@
预计用时10分钟
</view>
<view
class=
"wordBtn"
@
click=
"jumpPage(`/pages/word/word?CourseId=$
{pageData.Words.CourseId
}
&&
ChapterId=${pageData.Words.NextCourseNo}
&&
ReviewChapterId=${pageData.Words.ReviewCourseNo}
&&
ClassId=${pageData.Words.ClassId
}`)">
@
click=
"jumpPage(`/pages/word/word?CourseId=$
{pageData.Words.CourseId
||0}
&&
ChapterId=${pageData.Words.NextCourseNo||0}
&&
ReviewChapterId=${pageData.Words.ReviewCourseNo||0}
&&
ClassId=${pageData.Words.ClassId||0
}`)">
开始学习
</view>
</view>
...
...
src/pages/login/login.vue
View file @
506ac1eb
...
...
@@ -70,8 +70,8 @@ export default {
let
{
proxy
}
=
getCurrentInstance
();
let
Toast
=
inject
(
"$toast"
);
let
msg
=
reactive
({
Account
:
"
13551126755
"
,
Password
:
"
123456
"
,
Account
:
""
,
Password
:
""
,
});
let
data
=
reactive
({
phoneNum
:
""
,
...
...
src/pages/word/word.vue
View file @
506ac1eb
...
...
@@ -75,6 +75,9 @@
if
(
data
.
StudyList
.
length
===
0
&&
data
.
ReviewList
.
length
==
0
)
{
data
.
nodata
=
true
}
}).
catch
(
err
=>
{
data
.
loading
=
false
data
.
nodata
=
true
})
},
swiperChange
(
val
)
{
...
...
@@ -121,7 +124,6 @@
}
},
onLoad
(
options
)
{
console
.
log
(
"options"
,
options
);
uni
.
setNavigationBarTitle
({
title
:
'单词学习'
});
...
...
src/utils/request.js
View file @
506ac1eb
//请求教育接口
let
host
=
''
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
// host = 'http://192.168.20.17:8017
/api'
host
=
'http://192.168.10.65:8085/api'
host
=
'http://192.168.10.46:8300
/api'
//
host = 'http://192.168.10.65:8085/api'
// host = 'https://eduapi.oytour.com/api'
}
else
{
host
=
'https://eduapi.oytour.com/api'
}
import
Toast
from
'../wxcomponents/vant/toast/toast'
;
let
request
=
(
param
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
token
=
uni
.
getStorageSync
(
'userInfo'
).
Token
;
uni
.
request
({
...
...
@@ -26,46 +25,29 @@ let request = (param) => {
if
(
res
.
data
.
Code
===
1
)
{
resolve
(
res
.
data
)
}
else
{
// Toast({
// type: 'fail',
// message: res.data.Message,
// onClose: () => {
// if (res.data.Code === 10001 || res.data.Code === 10000) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// } else {
// if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data.Message.indexOf('用户凭证失效') != -1) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// }
// },
// });
uni
.
showToast
({
title
:
res
.
data
.
Message
,
duration
:
2000
,
icon
:
"error"
,
success
()
{
// if (res.data.Code === 10001 || res.data.Code === 10000) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// } else {
// if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data
// .Message.indexOf('用户凭证失效') != -1) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// }
if
(
res
.
data
.
Code
===
0
&&
res
.
data
.
Data
.
Error
==-
1
){
//如果电话号码没有
resolve
(
res
.
data
)
if
(
res
.
data
.
Message
.
indexOf
(
'用户凭证为空'
)
!=
-
1
||
res
.
data
.
Message
.
indexOf
(
'用户凭证失效'
)
!=
-
1
)
{
uni
.
showToast
({
title
:
"用户凭证失效,请重新授权"
,
duration
:
2000
,
icon
:
"none"
,
});
reject
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
Message
,
duration
:
2000
,
icon
:
"error"
,
success
()
{
if
(
res
.
data
.
Code
===
0
&&
res
.
data
.
Data
.
Error
==-
1
){
//如果电话号码没有
resolve
(
res
.
data
)
}
else
{
reject
()
}
}
}
});
});
}
}
},
fail
:
(
err
)
=>
{
...
...
@@ -75,6 +57,7 @@ let request = (param) => {
duration
:
2000
,
icon
:
"error"
,
});
reject
()
}
});
})
...
...
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