Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xzzxzmj
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
qd01
xzzxzmj
Commits
d9750b45
Commit
d9750b45
authored
Feb 19, 2025
by
zhangsan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d3bd5730
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
26 deletions
+81
-26
components.d.ts
src/components.d.ts
+1
-0
index.ts
src/router/index.ts
+1
-2
index.vue
src/views/czwj/index.vue
+6
-1
index.vue
src/views/login/index.vue
+64
-19
index.vue
src/views/slzmj/index.vue
+5
-1
index.vue
src/views/user/index.vue
+2
-1
vite.config.ts
vite.config.ts
+2
-2
No files found.
src/components.d.ts
View file @
d9750b45
...
@@ -33,6 +33,7 @@ declare module 'vue' {
...
@@ -33,6 +33,7 @@ declare module 'vue' {
VanSwipeItem
:
typeof
import
(
'
vant/es
'
)[
'
SwipeItem
'
]
VanSwipeItem
:
typeof
import
(
'
vant/es
'
)[
'
SwipeItem
'
]
VanTag
:
typeof
import
(
'
vant/es
'
)[
'
Tag
'
]
VanTag
:
typeof
import
(
'
vant/es
'
)[
'
Tag
'
]
VarButton
:
typeof
import
(
'
@varlet/ui
'
)[
'
Button
'
]
VarButton
:
typeof
import
(
'
@varlet/ui
'
)[
'
Button
'
]
VarCheckbox
:
typeof
import
(
'
@varlet/ui
'
)[
'
Checkbox
'
]
VarForm
:
typeof
import
(
'
@varlet/ui
'
)[
'
Form
'
]
VarForm
:
typeof
import
(
'
@varlet/ui
'
)[
'
Form
'
]
VarIcon
:
typeof
import
(
'
@varlet/ui
'
)[
'
Icon
'
]
VarIcon
:
typeof
import
(
'
@varlet/ui
'
)[
'
Icon
'
]
VarInput
:
typeof
import
(
'
@varlet/ui
'
)[
'
Input
'
]
VarInput
:
typeof
import
(
'
@varlet/ui
'
)[
'
Input
'
]
...
...
src/router/index.ts
View file @
d9750b45
...
@@ -22,7 +22,7 @@ let isVersionChecking = false;
...
@@ -22,7 +22,7 @@ let isVersionChecking = false;
// 路由守卫
// 路由守卫
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
NProgress
.
start
();
NProgress
.
start
();
document
.
title
=
(
to
.
meta
.
title
as
string
)
||
"
Vue App
"
;
document
.
title
=
(
to
.
meta
.
title
as
string
)
||
"
人民助梦金
"
;
// 检查版本更新
// 检查版本更新
if
(
process
.
env
.
NODE_ENV
===
"
production
"
&&
!
isVersionChecking
)
{
if
(
process
.
env
.
NODE_ENV
===
"
production
"
&&
!
isVersionChecking
)
{
...
@@ -45,7 +45,6 @@ router.beforeEach(async (to, from, next) => {
...
@@ -45,7 +45,6 @@ router.beforeEach(async (to, from, next) => {
// 获取用户信息
// 获取用户信息
const
token
=
sessionStorage
.
getItem
(
"
token
"
);
const
token
=
sessionStorage
.
getItem
(
"
token
"
);
// 登录页面判断
// 登录页面判断
if
(
to
.
path
===
"
/login
"
)
{
if
(
to
.
path
===
"
/login
"
)
{
if
(
token
)
{
if
(
token
)
{
...
...
src/views/czwj/index.vue
View file @
d9750b45
...
@@ -7,7 +7,12 @@
...
@@ -7,7 +7,12 @@
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
isEealNameAuthentication
}
from
'
@/utils/userInfoCheck
'
import
{
useRouter
}
from
'
vue-router
'
const
router
=
useRouter
()
if
(
!
isEealNameAuthentication
()){
router
.
replace
(
'
/user/shiming
'
)
}
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.container
{
.container
{
...
...
src/views/login/index.vue
View file @
d9750b45
...
@@ -20,8 +20,7 @@
...
@@ -20,8 +20,7 @@
</
template
>
</
template
>
</var-input>
</var-input>
<var-input
v-model=
"loginPassword"
type=
"password"
placeholder=
"密码"
<var-input
v-model=
"loginPassword"
type=
"password"
placeholder=
"密码"
:rules=
"[(value: string) => {
:rules=
"[(value) => {
if (!value) return '请填写密码';
if (!value) return '请填写密码';
return true;
return true;
}]"
>
}]"
>
...
@@ -31,9 +30,12 @@
...
@@ -31,9 +30,12 @@
</var-input>
</var-input>
<div
class=
"action-row"
>
<div
class=
"action-row"
>
<var-checkbox
v-model=
"rememberPassword"
>
记住密码
</var-checkbox>
<div>
<span
class=
"forgot-password"
@
click=
"downloadApp"
>
APP下载
</span>
<span
class=
"forgot-password"
@
click=
"downloadApp"
>
APP下载
</span>
<span
class=
"verify-login"
@
click=
"onLineService"
>
在线客服
</span>
<span
class=
"verify-login"
@
click=
"onLineService"
>
在线客服
</span>
</div>
</div>
</div>
<var-button
class=
"submit-btn"
type=
"primary"
block
native-type=
"submit"
:loading=
"loginLoading"
>
<var-button
class=
"submit-btn"
type=
"primary"
block
native-type=
"submit"
:loading=
"loginLoading"
>
立即登录
立即登录
...
@@ -48,28 +50,64 @@
...
@@ -48,28 +50,64 @@
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
}
from
'
vue
'
import
{
ref
,
onMounted
}
from
'
vue
'
import
{
useRouter
}
from
'
vue-router
'
import
{
useRouter
}
from
'
vue-router
'
import
request
from
'
@/utils/request
'
import
request
from
'
@/utils/request
'
import
{
clearCookie
}
from
'
@/utils/cookie
'
import
{
clearCookie
}
from
'
@/utils/cookie
'
interface
LoginResponse
{
code
:
number
msg
:
string
token
:
string
data
?:
any
}
const
router
=
useRouter
()
const
router
=
useRouter
()
const
loginFormRef
=
ref
()
const
loginFormRef
=
ref
()
const
loginUsername
=
ref
(
''
)
const
loginUsername
=
ref
(
''
)
const
loginPassword
=
ref
(
''
)
const
loginPassword
=
ref
(
''
)
const
loginLoading
=
ref
(
false
)
const
loginLoading
=
ref
(
false
)
const
rememberPassword
=
ref
(
false
)
sessionStorage
.
clear
()
sessionStorage
.
clear
()
clearCookie
()
clearCookie
()
// 页面加载时获取存储的账号密码
onMounted
(()
=>
{
const
savedUsername
=
localStorage
.
getItem
(
'
rememberedUsername
'
)
const
savedPassword
=
localStorage
.
getItem
(
'
rememberedPassword
'
)
const
remembered
=
localStorage
.
getItem
(
'
rememberPassword
'
)
if
(
remembered
===
'
true
'
&&
savedUsername
&&
savedPassword
)
{
loginUsername
.
value
=
savedUsername
loginPassword
.
value
=
savedPassword
rememberPassword
.
value
=
true
}
})
const
onLoginSubmit
=
async
()
=>
{
const
onLoginSubmit
=
async
()
=>
{
const
isValid
=
await
loginFormRef
.
value
?.
validate
()
const
isValid
=
await
loginFormRef
.
value
?.
validate
()
if
(
isValid
)
{
if
(
isValid
)
{
try
{
try
{
loginLoading
.
value
=
true
loginLoading
.
value
=
true
const
res
=
await
request
.
post
(
'
/login
'
,
{
const
res
=
await
request
.
post
<
LoginResponse
>
(
'
/login
'
,
{
username
:
loginUsername
.
value
,
username
:
loginUsername
.
value
,
password
:
loginPassword
.
value
,
password
:
loginPassword
.
value
,
type
:
'
app
'
type
:
'
app
'
})
})
if
(
res
.
code
==
200
)
{
if
(
res
.
code
===
200
)
{
// 保存或清除记住的账号密码
if
(
rememberPassword
.
value
)
{
localStorage
.
setItem
(
'
rememberedUsername
'
,
loginUsername
.
value
)
localStorage
.
setItem
(
'
rememberedPassword
'
,
loginPassword
.
value
)
localStorage
.
setItem
(
'
rememberPassword
'
,
'
true
'
)
}
else
{
localStorage
.
removeItem
(
'
rememberedUsername
'
)
localStorage
.
removeItem
(
'
rememberedPassword
'
)
localStorage
.
removeItem
(
'
rememberPassword
'
)
}
showToast
(
res
.
msg
)
showToast
(
res
.
msg
)
sessionStorage
.
setItem
(
'
token
'
,
res
.
token
)
sessionStorage
.
setItem
(
'
token
'
,
res
.
token
)
router
.
replace
(
'
/
'
)
router
.
replace
(
'
/
'
)
...
@@ -85,7 +123,7 @@ const onLoginSubmit = async () => {
...
@@ -85,7 +123,7 @@ const onLoginSubmit = async () => {
}
}
}
}
// kfurl,appdownload,appVersion
// kfurl,appdownload,appVersion
request
.
get
(
'
/system/config/configKeys?code=appVersion
'
).
then
(
res
=>
{
request
.
get
(
'
/system/config/configKeys?code=appVersion
,appdownload,kfurl
'
).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
sessionStorage
.
setItem
(
'
kfurl
'
,
res
?.
data
?.
kfurl
)
sessionStorage
.
setItem
(
'
kfurl
'
,
res
?.
data
?.
kfurl
)
sessionStorage
.
setItem
(
'
appdownload
'
,
res
?.
data
?.
appdownload
)
sessionStorage
.
setItem
(
'
appdownload
'
,
res
?.
data
?.
appdownload
)
...
@@ -108,7 +146,10 @@ const onLineService = () => {
...
@@ -108,7 +146,10 @@ const onLineService = () => {
background
:
#fff
;
background
:
#fff
;
padding
:
20px
;
padding
:
20px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
::v-deep
.var-checkbox__action
{
margin
:
0
0
;
padding
:
0
0
;
}
.logo
{
.logo
{
padding
:
80px
0
20px
;
padding
:
80px
0
20px
;
display
:
flex
;
display
:
flex
;
...
@@ -118,7 +159,8 @@ const onLineService = () => {
...
@@ -118,7 +159,8 @@ const onLineService = () => {
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
border-radius
:
16px
;
border-radius
:
16px
;
img
{
img
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
}
}
...
@@ -165,14 +207,17 @@ const onLineService = () => {
...
@@ -165,14 +207,17 @@ const onLineService = () => {
font-size
:
14px
;
font-size
:
14px
;
color
:
#666
;
color
:
#666
;
div
{
span
{
span
{
cursor
:
pointer
;
cursor
:
pointer
;
margin-left
:
12px
;
&
:hover
{
&
:hover
{
color
:
#ff6b35
;
color
:
#ff6b35
;
}
}
}
}
}
}
}
.submit-btn
{
.submit-btn
{
height
:
44px
;
height
:
44px
;
...
...
src/views/slzmj/index.vue
View file @
d9750b45
...
@@ -63,6 +63,7 @@ import { usePageHook } from "@/hooks/usePageHook";
...
@@ -63,6 +63,7 @@ import { usePageHook } from "@/hooks/usePageHook";
import
{
addApply
,
editApply
,
getApplyList
}
from
"
@/api/czwj
"
;
import
{
addApply
,
editApply
,
getApplyList
}
from
"
@/api/czwj
"
;
import
{
ref
}
from
"
vue
"
;
import
{
ref
}
from
"
vue
"
;
import
{
isEealNameAuthentication
}
from
"
@/utils/userInfoCheck
"
;
import
{
isEealNameAuthentication
}
from
"
@/utils/userInfoCheck
"
;
import
{
useRouter
}
from
"
vue-router
"
;
const
form
=
ref
();
const
form
=
ref
();
const
formData
=
reactive
({
const
formData
=
reactive
({
a3
:
""
,
a3
:
""
,
...
@@ -166,7 +167,10 @@ const handleModify = () => {
...
@@ -166,7 +167,10 @@ const handleModify = () => {
}
}
};
};
const
router
=
useRouter
()
if
(
!
isEealNameAuthentication
()){
router
.
replace
(
'
/user/shiming
'
)
}
usePageHook
({
usePageHook
({
onPageShow
:
()
=>
{
onPageShow
:
()
=>
{
getApplyRecord
();
getApplyRecord
();
...
...
src/views/user/index.vue
View file @
d9750b45
...
@@ -131,7 +131,8 @@ const handleLogout = () => {
...
@@ -131,7 +131,8 @@ const handleLogout = () => {
showCancelButton
:
true
,
showCancelButton
:
true
,
}).
then
(()
=>
{
}).
then
(()
=>
{
sessionStorage
.
clear
();
sessionStorage
.
clear
();
router
.
push
(
"
/login
"
);
router
.
replace
(
"
/login
"
);
window
.
location
.
reload
();
});
});
};
};
const
userInfo
=
ref
({});
const
userInfo
=
ref
({});
...
...
vite.config.ts
View file @
d9750b45
...
@@ -77,8 +77,8 @@ export default defineConfig({
...
@@ -77,8 +77,8 @@ export default defineConfig({
port
:
8080
,
port
:
8080
,
proxy
:
{
proxy
:
{
'
/api
'
:
{
'
/api
'
:
{
target
:
'
http://27.124.5.14:9023
'
,
//
target: 'http://27.124.5.14:9023',
//
target: 'http://43.199.109.243:3000/api',
target
:
'
http://43.199.109.243:3000/api
'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
}
}
...
...
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