Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
national_museum_vod-H5
Project
Project
Details
Activity
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
fubaole
national_museum_vod-H5
Commits
3a7b46a5
Commit
3a7b46a5
authored
Apr 10, 2021
by
乐宝呗666
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
ae38b650
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
62 additions
and
46 deletions
+62
-46
request.js
src/config/request.js
+6
-6
index.js
src/router/index.js
+1
-1
login.vue
src/views/login.vue
+2
-2
admin.vue
src/views/user/admin.vue
+2
-2
adminInfo.vue
src/views/user/components/adminInfo.vue
+8
-17
commitTab.vue
src/views/user/components/commitTab.vue
+36
-11
contentTab.vue
src/views/user/components/contentTab.vue
+1
-1
historyTab.vue
src/views/user/components/historyTab.vue
+1
-1
editPsd.vue
src/views/user/editPsd.vue
+4
-4
learn.vue
src/views/user/learn.vue
+1
-1
No files found.
src/config/request.js
View file @
3a7b46a5
...
...
@@ -41,8 +41,8 @@ function errorState(status, data) {
message
:
'您的用户权限已被禁用,请联系管理员!'
,
onClose
:
()
=>
{
//这个时候点击确定后清除用户信息
local
Storage
.
removeItem
(
'backToken'
)
local
Storage
.
removeItem
(
'userId'
)
session
Storage
.
removeItem
(
'backToken'
)
session
Storage
.
removeItem
(
'userId'
)
router
.
push
({
path
:
'/'
,
query
:
{
...
...
@@ -58,8 +58,8 @@ function errorState(status, data) {
message
:
'您的登录过期,将重新登录!'
,
onClose
:
()
=>
{
//清除用户信息
local
Storage
.
removeItem
(
'backToken'
)
local
Storage
.
removeItem
(
'userId'
)
session
Storage
.
removeItem
(
'backToken'
)
session
Storage
.
removeItem
(
'userId'
)
router
.
push
({
path
:
'/'
,
query
:
{
...
...
@@ -99,9 +99,9 @@ const httpServer = (opts, data, file, timeout) => {
let
authToken
=
""
;
if
(
opts
.
authType
&&
opts
.
authType
!=
""
)
{
if
(
opts
.
authType
===
"back"
)
{
authToken
=
local
Storage
.
getItem
(
'token'
)
||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
authToken
=
session
Storage
.
getItem
(
'token'
)
||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
}
else
if
(
opts
.
authType
===
"front"
)
{
authToken
=
local
Storage
.
getItem
(
"token"
);
authToken
=
session
Storage
.
getItem
(
"token"
);
}
httpDefaultOpts
.
headers
[
"Authorization"
]
=
authToken
}
...
...
src/router/index.js
View file @
3a7b46a5
...
...
@@ -86,7 +86,7 @@ const router = new VueRouter({
})
const
whiteList
=
[
'/login'
,
'/success'
,
'/screen'
]
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
let
user
=
local
Storage
.
getItem
(
"token"
);
let
user
=
session
Storage
.
getItem
(
"token"
);
if
(
!
user
&&
!
whiteList
.
includes
(
to
.
path
))
{
// 通过vuex state获取当前的token是否存在
next
({
path
:
'/login'
,
...
...
src/views/login.vue
View file @
3a7b46a5
...
...
@@ -57,8 +57,8 @@ export default {
if
(
res
.
data
.
resultCode
===
"200"
)
{
let
data
=
res
.
data
;
const
isOpt
=
data
.
user
.
type
;
local
Storage
.
setItem
(
"token"
,
data
.
token
);
local
Storage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
data
.
user
));
session
Storage
.
setItem
(
"token"
,
data
.
token
);
session
Storage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
data
.
user
));
if
(
isOpt
==
"4"
)
{
this
.
$router
.
push
(
"/opt"
);
}
else
if
(
isOpt
==
"2"
)
{
...
...
src/views/user/admin.vue
View file @
3a7b46a5
...
...
@@ -27,7 +27,7 @@ export default {
data
()
{
return
{
list
:
[],
currentUserId
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
id
,
currentUserId
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
id
,
};
},
mounted
()
{
...
...
@@ -40,7 +40,7 @@ export default {
let
param
=
{
_index
:
1
,
_size
:
10
,
type
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
type
,
type
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
type
,
};
vm
.
$https
(
{
...
...
src/views/user/components/adminInfo.vue
View file @
3a7b46a5
<
template
>
<div
class=
"admin-detail-content"
>
<Header
title=
"管理员详情"
/>
<van-form
ref=
'form'
>
<van-form
validate-first
ref=
'form'
@
submit=
"onSubmit"
>
<div
class=
"input-box"
>
<van-field
label=
"管理员姓名"
...
...
@@ -27,10 +27,6 @@
v-model=
"form.telephone"
placeholder=
"请输入固定电话"
input-align=
"right"
:rules=
"[
{ required: true, message: '请填写您的固定电话!' },
{ pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/, message: '固定电话格式错误!'}
]"
/>
<van-field
label=
"微信"
...
...
@@ -38,11 +34,6 @@
v-model=
"form.weChat"
placeholder=
"请输入微信"
input-align=
"right"
:rules=
"[
{ required: true, message: '请填写您的微信号!' },
{ pattern: /^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/, message: '微信号格式错误!'}
]"
/>
<van-field
label=
"邮箱"
...
...
@@ -50,24 +41,23 @@
v-model=
"form.email"
placeholder=
"请输入邮箱"
input-align=
"right"
:rules=
"[
{ required: true, message: '请填写您的邮箱!' },
{ pattern: /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/, message: '邮箱格式错误!'}
]"
/>
</div>
<div
class=
"admin-detail-button"
v-if=
"!disabled"
>
<van-button
type=
"default"
plain
@
click=
"onCancel"
>
取消
</van-button>
<van-button
type=
"default"
@
click=
"onS
ubmit"
>
提交
</van-button>
<van-button
type=
"default"
plain
native-type=
"button"
@
click=
"onCancel"
>
取消
</van-button>
<van-button
type=
"default"
native-type=
"s
ubmit"
>
提交
</van-button>
</div>
<div
class=
"admin-detail-button cancel"
v-if=
"disabled"
>
<van-button
type=
"default"
@
click=
"onCancel"
>
返回
</van-button>
<van-button
type=
"default"
native-type=
"button"
@
click=
"onCancel"
>
返回
</van-button>
</div>
</van-form>
</div>
</
template
>
<
script
>
// { pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/, message: '固定电话格式错误!'}
// { pattern: /^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/, message: '微信号格式错误!'}
// { pattern: /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/, message: '邮箱格式错误!'}
import
Header
from
"@/components/Header/index.vue"
;
export
default
{
components
:
{
Header
},
...
...
@@ -147,6 +137,7 @@ export default {
.
catch
(
function
(
err
)
{
console
.
log
(
err
);
});
},
},
};
...
...
src/views/user/components/commitTab.vue
View file @
3a7b46a5
...
...
@@ -81,10 +81,9 @@
<div
class=
"uplaod-video"
style=
"min-height: 60px"
>
<van-uploader
:max-count=
"3"
:max-size=
"500 * 1024"
@
oversize=
"onOversize"
v-model=
"fileList"
accept=
"video/*"
:before-read=
"beforeVideo"
:after-read=
"uploadVideo"
:before-delete=
"deleteVideo"
multiple
...
...
@@ -155,8 +154,8 @@ export default {
data
()
{
return
{
form
:
{
username
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
orgName
,
organId
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
orgId
,
username
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
orgName
,
organId
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
orgId
,
images
:
[],
// 文件地址
videos
:
[],
// 文件地址
},
...
...
@@ -200,9 +199,25 @@ export default {
this
.
form
.
boardId
=
this
.
boardList
[
index
].
id
;
this
.
showBoard
=
false
;
},
onOversize
(
file
)
{
console
.
log
(
file
);
this
.
$toast
(
"文件大小不能超过 500kb"
);
beforeVideo
(
file
)
{
this
.
timeOutVideo
=
false
let
_URL
=
window
.
URL
||
window
.
webkitURL
;
let
videoUrl
=
_URL
.
createObjectURL
(
file
);
let
audioElement
=
new
Audio
(
videoUrl
);
audioElement
.
addEventListener
(
"loadedmetadata"
,
()
=>
{
let
duration
=
audioElement
.
duration
;
//时长为秒,小数,182.36
if
(
duration
>
21
)
{
this
.
timeOutVideo
=
true
this
.
fileList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
file
.
lastModified
===
file
.
lastModified
){
this
.
fileList
.
splice
(
index
,
1
)
}
})
this
.
$toast
.
fail
(
"上传视频时长不能超过20秒"
);
return
false
;
}
});
return
true
},
// 打开日历
onDisplay
()
{
...
...
@@ -342,10 +357,13 @@ export default {
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
resultCode
===
'200'
){
res
.
data
.
data
.
fileList
.
forEach
(
item
=>
{
this
.
form
.
videos
.
push
(
item
.
fileUrl
);
this
.
videoIds
.
push
(
item
.
id
);
})
if
(
!
this
.
timeOutVideo
){
res
.
data
.
data
.
fileList
.
forEach
(
item
=>
{
this
.
form
.
videos
.
push
(
item
.
fileUrl
);
this
.
videoIds
.
push
(
item
.
id
);
})
}
}
else
{
this
.
$toast
(
res
.
data
.
message
)
}
...
...
@@ -463,8 +481,15 @@ export default {
}
}
.commit-page-button
{
position
:
fixed
;
bottom
:
50px
;
left
:
0
;
right
:
0
;
padding
:
0
40px
;
background-color
:
#fff
;
box-sizing
:
border-box
;
padding-top
:
10px
;
padding-bottom
:
10px
;
width
:
100%
;
.van-button--normal
{
background
:
#a4151d
;
...
...
src/views/user/components/contentTab.vue
View file @
3a7b46a5
...
...
@@ -32,7 +32,7 @@
<van-button
@
click=
"optFn(item)"
square
:text=
"active ? '启用' : '
删除
'"
:text=
"active ? '启用' : '
禁用
'"
type=
"danger"
:class=
"
{
'delete-button': active === 0,
...
...
src/views/user/components/historyTab.vue
View file @
3a7b46a5
...
...
@@ -95,7 +95,7 @@ export default {
let
param
=
{
_index
:
this
.
pageNum
,
_size
:
this
.
pageSize
,
orgId
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
orgId
orgId
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
orgId
};
vm
.
$https
(
{
...
...
src/views/user/editPsd.vue
View file @
3a7b46a5
...
...
@@ -53,7 +53,7 @@ export default {
data
()
{
return
{
form
:
{
username
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
userName
,
username
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
userName
,
},
};
},
...
...
@@ -63,7 +63,7 @@ export default {
methods
:
{
onCancle
()
{
this
.
form
=
{
username
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
userName
,
username
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
userName
,
};
},
// 提交数据
...
...
@@ -87,8 +87,8 @@ export default {
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
resultCode
===
"200"
)
{
local
Storage
.
removeItem
(
"token"
);
local
Storage
.
removeItem
(
"userInfo"
);
session
Storage
.
removeItem
(
"token"
);
session
Storage
.
removeItem
(
"userInfo"
);
this
.
$router
.
replace
({
path
:
"/success"
,
query
:
{
...
...
src/views/user/learn.vue
View file @
3a7b46a5
...
...
@@ -48,7 +48,7 @@ export default {
let
param
=
{
_index
:
this
.
pageNum
,
_size
:
this
.
pageSize
,
type
:
JSON
.
parse
(
local
Storage
.
getItem
(
"userInfo"
)).
type
,
type
:
JSON
.
parse
(
session
Storage
.
getItem
(
"userInfo"
)).
type
,
};
vm
.
$https
(
{
...
...
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