Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
928c441b
Commit
928c441b
authored
Sep 18, 2023
by
wuwangwolihui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营地2.0-整合修改
parent
b614583b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
48 deletions
+63
-48
src/components/Header.vue
src/components/Header.vue
+0
-1
src/request/network.js
src/request/network.js
+33
-24
src/router/index.js
src/router/index.js
+8
-6
src/store/index.js
src/store/index.js
+1
-1
src/store/mutations.js
src/store/mutations.js
+9
-4
src/views/base/home/Home.vue
src/views/base/home/Home.vue
+8
-8
src/views/base/login/Login.vue
src/views/base/login/Login.vue
+1
-1
src/views/base/login/Register.vue
src/views/base/login/Register.vue
+1
-1
src/views/index/login/Login.vue
src/views/index/login/Login.vue
+1
-1
src/views/index/login/Register.vue
src/views/index/login/Register.vue
+1
-1
No files found.
src/components/Header.vue
View file @
928c441b
...
@@ -91,7 +91,6 @@
...
@@ -91,7 +91,6 @@
},
},
// 去登录页
// 去登录页
toLogin
()
{
toLogin
()
{
console
.
log
(
this
.
type
)
if
(
this
.
type
==
1
)
{
if
(
this
.
type
==
1
)
{
this
.
$router
.
push
(
"
/baseLogin
"
);
this
.
$router
.
push
(
"
/baseLogin
"
);
}
else
if
(
this
.
type
==
2
)
{
}
else
if
(
this
.
type
==
2
)
{
...
...
src/request/network.js
View file @
928c441b
...
@@ -108,6 +108,7 @@ export function request(config) {
...
@@ -108,6 +108,7 @@ export function request(config) {
const
LabelType
=
'
/activity/labelType
'
;
const
LabelType
=
'
/activity/labelType
'
;
const
HotList
=
'
/activityCenter/hotList
'
;
const
HotList
=
'
/activityCenter/hotList
'
;
const
GetActiveInfo
=
'
/activityCenter/detail/
'
;
const
GetActiveInfo
=
'
/activityCenter/detail/
'
;
const
HomeHot
=
'
/activityCenter/hot
'
;
if
((
config
.
url
.
indexOf
(
loginUrl
)
!=
-
1
&&
config
.
url
.
indexOf
(
loginOut
)
==
-
1
)
||
if
((
config
.
url
.
indexOf
(
loginUrl
)
!=
-
1
&&
config
.
url
.
indexOf
(
loginOut
)
==
-
1
)
||
config
.
url
.
indexOf
(
setAccountInfo
)
!=
-
1
||
config
.
url
.
indexOf
(
setAccountInfo
)
!=
-
1
||
config
.
url
.
indexOf
(
passMsgOld
)
!=
-
1
||
config
.
url
.
indexOf
(
passMsgOld
)
!=
-
1
||
...
@@ -121,27 +122,32 @@ export function request(config) {
...
@@ -121,27 +122,32 @@ export function request(config) {
config
.
url
.
indexOf
(
setLog
)
!=
-
1
||
config
.
url
.
indexOf
(
setLog
)
!=
-
1
||
config
.
url
.
indexOf
(
LabelType
)
!=
-
1
||
config
.
url
.
indexOf
(
LabelType
)
!=
-
1
||
config
.
url
.
indexOf
(
HotList
)
!=
-
1
||
config
.
url
.
indexOf
(
HotList
)
!=
-
1
||
config
.
url
.
indexOf
(
GetActiveInfo
)
!=
-
1
)
{
config
.
url
.
indexOf
(
GetActiveInfo
)
!=
-
1
||
config
.
url
.
indexOf
(
HomeHot
)
!=
-
1
)
{
return
config
return
config
}
}
const
token
=
localStorage
.
getItem
(
'
index-token-all
'
);
const
token
=
localStorage
.
getItem
(
'
index-token-all
'
);
console
.
log
(
token
,
store
.
state
.
isLogin
)
if
(
token
)
{
if
(
token
)
{
config
.
headers
.
token
=
token
;
config
.
headers
.
token
=
token
;
}
else
{
}
else
{
// router.push({
// path: '/login',
// query: {
// redirect: router.currentRoute.fullPath
// } // 从哪个页面跳转
// })
router
.
push
({
router
.
push
({
path
:
'
/login
'
,
path
:
'
/
'
+
store
.
state
.
indexIdentity
,
query
:
{
redirect
:
router
.
currentRoute
.
fullPath
}
// 从哪个页面跳转
})
})
const
error
=
new
Error
(
'
请登录!
'
)
const
error
=
new
Error
(
'
请登录!
'
)
;
return
Promise
.
reject
(
error
)
return
Promise
.
reject
(
error
)
;
}
}
let
cancel
let
cancel
;
// 设置cancelToken对象
// 设置cancelToken对象
config
.
cancelToken
=
new
axios
.
CancelToken
((
c
)
=>
{
config
.
cancelToken
=
new
axios
.
CancelToken
((
c
)
=>
{
cancel
=
c
cancel
=
c
;
})
})
if
(
config
.
url
.
indexOf
(
'
/web/config/getUniversity
'
)
==
-
1
&&
if
(
config
.
url
.
indexOf
(
'
/web/config/getUniversity
'
)
==
-
1
&&
config
.
url
.
indexOf
(
'
/web/config/getProfession
'
)
==
-
1
)
{
config
.
url
.
indexOf
(
'
/web/config/getProfession
'
)
==
-
1
)
{
...
@@ -174,7 +180,6 @@ export function request(config) {
...
@@ -174,7 +180,6 @@ export function request(config) {
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
data
.
code
==
400034
||
if
(
res
.
data
.
code
==
400034
||
res
.
data
.
code
==
400035
||
res
.
data
.
code
==
400035
||
// res.data.code == 400001 ||
res
.
data
.
code
==
400002
||
res
.
data
.
code
==
400002
||
res
.
data
.
code
==
400003
)
{
res
.
data
.
code
==
400003
)
{
router
.
push
({
router
.
push
({
...
@@ -184,7 +189,7 @@ export function request(config) {
...
@@ -184,7 +189,7 @@ export function request(config) {
message
:
res
.
data
.
message
,
message
:
res
.
data
.
message
,
duration
:
1000
,
duration
:
1000
,
});
});
return
return
false
;
}
}
if
(
res
.
data
.
code
==
400023
)
{
if
(
res
.
data
.
code
==
400023
)
{
let
isLogout
=
res
.
config
.
url
==
'
/web/auth/loginOut
'
;
let
isLogout
=
res
.
config
.
url
==
'
/web/auth/loginOut
'
;
...
@@ -199,30 +204,35 @@ export function request(config) {
...
@@ -199,30 +204,35 @@ export function request(config) {
duration
:
3000
,
duration
:
3000
,
});
});
}
}
return
return
false
;
}
}
if
(
res
.
data
.
code
==
400003
)
{
if
(
res
.
data
.
code
==
400003
||
res
.
data
.
code
==
401
)
{
// 清除本地缓存 除了特殊缓存
// 清除本地缓存 除了特殊缓存
store
.
commit
(
'
removeLocalStorage
'
);
store
.
commit
(
'
removeLocalStorage
'
);
// router.push({
// path: '/login',
// query: {
// redirect: router.currentRoute.fullPath
// } // 从哪个页面跳转
// })
router
.
push
({
router
.
push
({
path
:
'
/login
'
,
path
:
'
/
'
+
store
.
state
.
indexIdentity
,
query
:
{
redirect
:
router
.
currentRoute
.
fullPath
}
// 从哪个页面跳转
})
})
}
}
loadingInstance
&&
loadingInstance
.
close
()
loadingInstance
&&
loadingInstance
.
close
()
setTimeout
(()
=>
{
setTimeout
(()
=>
{
allowRequest
(
reqList
,
res
.
config
.
url
)
allowRequest
(
reqList
,
res
.
config
.
url
)
},
1000
)
},
1000
)
return
res
return
res
;
},
},
(
error
)
=>
{
(
error
)
=>
{
console
.
log
(
error
,
'
err
'
)
Message
.
closeAll
();
Message
.
closeAll
()
if
(
error
.
message
==
'
请登录!
'
)
{
if
(
error
.
message
==
'
请登录!
'
)
{
// router.push({
// path: "/login?code=" + store.state.indexIdentity,
// })
router
.
push
({
router
.
push
({
path
:
"
/login?code=
"
+
store
.
state
.
indexIdentity
,
path
:
'
/
'
+
store
.
state
.
indexIdentity
,
})
})
}
}
if
(
error
.
response
.
status
==
404
)
{
if
(
error
.
response
.
status
==
404
)
{
...
@@ -236,15 +246,14 @@ export function request(config) {
...
@@ -236,15 +246,14 @@ export function request(config) {
}
else
{
}
else
{
// 增加延迟,相同请求不得在短时间内重复发送
// 增加延迟,相同请求不得在短时间内重复发送
setTimeout
(()
=>
{
setTimeout
(()
=>
{
console
.
log
(
error
)
allowRequest
(
reqList
,
error
.
config
.
url
)
allowRequest
(
reqList
,
error
.
config
.
url
)
},
1000
)
},
1000
)
}
}
loadingInstance
&&
loadingInstance
.
close
()
loadingInstance
&&
loadingInstance
.
close
()
return
Promise
.
reject
(
error
)
return
Promise
.
reject
(
error
)
;
}
}
)
)
return
instance
(
config
)
return
instance
(
config
)
;
}
}
/**
/**
...
...
src/router/index.js
View file @
928c441b
...
@@ -239,17 +239,19 @@ router.beforeEach((to, from, next) => {
...
@@ -239,17 +239,19 @@ router.beforeEach((to, from, next) => {
if
(
!
token
)
{
if
(
!
token
)
{
checkCam
(
code
,
(
res
)
=>
{
checkCam
(
code
,
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
return
next
(
toLogin
);
// return next(toLogin);
return
next
(
"
/
"
+
code
);
}
}
});
});
}
else
{
}
else
{
checkCam
(
code
,
(
res
)
=>
{
checkCam
(
code
,
(
res
)
=>
{
if
(
res
)
{
if
(
res
)
{
if
(
token
)
{
return
next
();
return
next
();
}
else
{
// if (token) {
next
(
"
/
"
+
code
);
// return next();
}
// } else {
// next("/" + code);
// }
}
}
});
});
}
}
...
...
src/store/index.js
View file @
928c441b
...
@@ -12,7 +12,6 @@ let state = {
...
@@ -12,7 +12,6 @@ let state = {
fullPath
:
localStorage
.
getItem
(
"
index-fullPath
"
)
||
"
/
"
,
fullPath
:
localStorage
.
getItem
(
"
index-fullPath
"
)
||
"
/
"
,
// 数据
// 数据
data
:
[],
data
:
[],
token
:
''
,
indexIdentity
:
localStorage
.
getItem
(
"
index-identity
"
)
||
""
,
indexIdentity
:
localStorage
.
getItem
(
"
index-identity
"
)
||
""
,
human
:
0
,
//清华人文学院
human
:
0
,
//清华人文学院
baseSchool
:
0
,
//基地
baseSchool
:
0
,
//基地
...
@@ -23,6 +22,7 @@ let state = {
...
@@ -23,6 +22,7 @@ let state = {
info
:
{},
info
:
{},
isCloseCamp
:
0
,
//是否关闭营地
isCloseCamp
:
0
,
//是否关闭营地
signUpInfo
:
{},
signUpInfo
:
{},
token
:
localStorage
.
getItem
(
"
index-token-all
"
)
||
""
,
isLogin
:
localStorage
.
getItem
(
"
isLogin
"
)
||
"
0
"
,
// 只有1为已登录
isLogin
:
localStorage
.
getItem
(
"
isLogin
"
)
||
"
0
"
,
// 只有1为已登录
activeIndex
:
window
.
localStorage
.
getItem
(
'
index-active-path
'
)
||
"
0
"
,
activeIndex
:
window
.
localStorage
.
getItem
(
'
index-active-path
'
)
||
"
0
"
,
};
};
...
...
src/store/mutations.js
View file @
928c441b
...
@@ -8,14 +8,17 @@ export default {
...
@@ -8,14 +8,17 @@ export default {
setData
(
state
,
city
)
{
setData
(
state
,
city
)
{
state
.
data
=
city
;
state
.
data
=
city
;
},
},
login
(
state
)
{
login
(
state
,
token
)
{
state
.
isLogin
=
"
1
"
;
state
.
isLogin
=
"
1
"
;
state
.
token
=
token
;
localStorage
.
setItem
(
"
isLogin
"
,
"
1
"
);
localStorage
.
setItem
(
"
isLogin
"
,
"
1
"
);
localStorage
.
setItem
(
"
index-token-all
"
,
token
);
},
},
loginOut
(
state
)
{
loginOut
(
state
)
{
state
.
isLogin
=
"
0
"
;
state
.
isLogin
=
"
0
"
;
localStorage
.
removeItem
(
"
token
"
)
;
state
.
token
=
""
;
localStorage
.
removeItem
(
"
isLogin
"
);
localStorage
.
removeItem
(
"
isLogin
"
);
localStorage
.
removeItem
(
"
index-token-all
"
);
},
},
setIndexIdentity
(
state
,
code
)
{
setIndexIdentity
(
state
,
code
)
{
state
.
indexIdentity
=
code
;
state
.
indexIdentity
=
code
;
...
@@ -26,11 +29,11 @@ export default {
...
@@ -26,11 +29,11 @@ export default {
state
.
activeIndex
=
key
;
state
.
activeIndex
=
key
;
window
.
localStorage
.
setItem
(
'
index-active-path
'
,
key
);
window
.
localStorage
.
setItem
(
'
index-active-path
'
,
key
);
},
},
setFullPath
(
state
,
path
){
setFullPath
(
state
,
path
)
{
state
.
fullPath
=
path
;
state
.
fullPath
=
path
;
window
.
localStorage
.
setItem
(
'
index-fullPath
'
,
path
);
window
.
localStorage
.
setItem
(
'
index-fullPath
'
,
path
);
},
},
removeLocalStorage
(
state
){
removeLocalStorage
(
state
)
{
for
(
let
key
in
window
.
localStorage
)
{
for
(
let
key
in
window
.
localStorage
)
{
if
(
key
.
indexOf
(
'
email
'
)
==
-
1
&&
if
(
key
.
indexOf
(
'
email
'
)
==
-
1
&&
key
.
indexOf
(
'
multiform
'
)
==
-
1
&&
key
.
indexOf
(
'
multiform
'
)
==
-
1
&&
...
@@ -42,5 +45,7 @@ export default {
...
@@ -42,5 +45,7 @@ export default {
window
.
localStorage
.
removeItem
(
key
);
window
.
localStorage
.
removeItem
(
key
);
}
}
}
}
state
.
isLogin
=
"
0
"
;
state
.
token
=
""
;
},
},
};
};
src/views/base/home/Home.vue
View file @
928c441b
...
@@ -117,7 +117,8 @@
...
@@ -117,7 +117,8 @@
url
:
banner2
url
:
banner2
}],
}],
activeList
:
[],
activeList
:
[],
reflectionsList
:
[{
reflectionsList
:
[
{
name
:
'
同学
'
,
name
:
'
同学
'
,
think
:
'
我想小鸟肯定是害怕了,小鸟失去了自由,一定高兴不起来了,只有外面的天空才是小鸟的家,小鸟被细绳牵着失去自由实在是太可怜了,我决心把小鸟放走我轻轻的走过去,把小鸟腿上的细绳解开了。我把小鸟放在窗台上,我站在远处看着它,只见小鸟趴在窗台上还是一动也不动,嘴巴张着。妈妈说小鸟可能吓坏了,我有点后悔。后来过了好一会儿,小鸟才回过神来,它眨了眨眼睛,慢慢飞了起来。我看我觉的小鸟是我们人类的朋友,我们不能伤害小鸟,只有让小鸟在天空中自由的飞翔,它才会感到快乐
'
,
think
:
'
我想小鸟肯定是害怕了,小鸟失去了自由,一定高兴不起来了,只有外面的天空才是小鸟的家,小鸟被细绳牵着失去自由实在是太可怜了,我决心把小鸟放走我轻轻的走过去,把小鸟腿上的细绳解开了。我把小鸟放在窗台上,我站在远处看着它,只见小鸟趴在窗台上还是一动也不动,嘴巴张着。妈妈说小鸟可能吓坏了,我有点后悔。后来过了好一会儿,小鸟才回过神来,它眨了眨眼睛,慢慢飞了起来。我看我觉的小鸟是我们人类的朋友,我们不能伤害小鸟,只有让小鸟在天空中自由的飞翔,它才会感到快乐
'
,
tag
:
[
'
北京市第八中序
'
,
'
2023南开历史营
'
]
tag
:
[
'
北京市第八中序
'
,
'
2023南开历史营
'
]
...
@@ -166,11 +167,10 @@
...
@@ -166,11 +167,10 @@
getHot
()
{
getHot
()
{
hot
().
then
((
res
)
=>
{
hot
().
then
((
res
)
=>
{
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
m
essage
);
return
this
.
$message
.
error
(
res
.
data
.
m
sg
);
}
}
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
activeList
=
res
.
data
.
data
;
this
.
activeList
=
res
.
data
.
data
;
})
})
.
catch
(
err
=>
{})
},
},
}
}
}
}
...
...
src/views/base/login/Login.vue
View file @
928c441b
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
return
this
.
$message
.
error
(
res
.
data
.
message
);
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
}
this
.
$message
.
success
(
"
登录成功
"
);
this
.
$message
.
success
(
"
登录成功
"
);
window
.
localStorage
.
setItem
(
"
index-token-all
"
,
res
.
data
.
token
);
this
.
$store
.
commit
(
'
login
'
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
loginForm
.
phone
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
loginForm
.
phone
);
window
.
localStorage
.
setItem
(
"
email
"
,
res
.
data
.
email
);
window
.
localStorage
.
setItem
(
"
email
"
,
res
.
data
.
email
);
let
fullPath
=
this
.
$store
.
state
.
fullPath
;
let
fullPath
=
this
.
$store
.
state
.
fullPath
;
...
...
src/views/base/login/Register.vue
View file @
928c441b
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
}
}
// this.$message.success(res.data.message);
// this.$message.success(res.data.message);
// token存储
// token存储
window
.
localStorage
.
setItem
(
"
index-token-all
"
,
res
.
data
.
token
);
this
.
$store
.
commit
(
'
login
'
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
registerForm
.
phone
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
registerForm
.
phone
);
// 跳转到报名
// 跳转到报名
this
.
$router
.
replace
(
"
/signUpList
"
);
this
.
$router
.
replace
(
"
/signUpList
"
);
...
...
src/views/index/login/Login.vue
View file @
928c441b
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
// 跳转到报名
// 跳转到报名
const
code
=
this
.
$store
.
state
.
indexIdentity
;
const
code
=
this
.
$store
.
state
.
indexIdentity
;
// token存储
// token存储
window
.
localStorage
.
setItem
(
"
index-token-all
"
,
res
.
data
.
token
);
this
.
$store
.
commit
(
'
login
'
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
loginForm
.
phone
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
loginForm
.
phone
);
window
.
localStorage
.
setItem
(
"
email
"
+
code
,
res
.
data
.
email
);
window
.
localStorage
.
setItem
(
"
email
"
+
code
,
res
.
data
.
email
);
// 报名信息
// 报名信息
...
...
src/views/index/login/Register.vue
View file @
928c441b
...
@@ -301,7 +301,7 @@
...
@@ -301,7 +301,7 @@
// this.$message.success(res.data.message);
// this.$message.success(res.data.message);
let
code
=
this
.
$store
.
state
.
indexIdentity
;
let
code
=
this
.
$store
.
state
.
indexIdentity
;
// token存储
// token存储
window
.
localStorage
.
setItem
(
"
index-token-all
"
,
res
.
data
.
token
);
this
.
$store
.
commit
(
'
login
'
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
registerForm
.
phone
);
window
.
localStorage
.
setItem
(
"
index-phone-all
"
,
this
.
registerForm
.
phone
);
// window.localStorage.setItem("email" + code, this.registerForm.email);
// window.localStorage.setItem("email" + code, this.registerForm.email);
// 报名信息
// 报名信息
...
...
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