Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
hmd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5e000efa
authored
Jul 18, 2023
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改登录
1 parent
227893b6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
9 deletions
api/request/http.js
pages/Login/Login.js
pages/Login/Login.wxml
pages/Login/Login.wxss
pages/tab/index/index.scss
pages/tab/index/index.wxml
api/request/http.js
View file @
5e000ef
...
@@ -81,8 +81,18 @@ class Request {
...
@@ -81,8 +81,18 @@ class Request {
}
}
if
(
code
==
20
||
code
==
21
)
{
if
(
code
==
20
||
code
==
21
)
{
wx
.
hideLoading
()
wx
.
hideLoading
()
return
wx
.
reLaunch
({
const
thisPage
=
wx
.
p
.
router
.
getPageInstance
(),
url
:
'/pages/loading/loading'
options
=
Object
.
keys
(
thisPage
.
options
)
let
currentRoute
=
thisPage
.
route
,
query
=
[]
if
(
options
.
length
)
{
options
.
map
(
key
=>
{
query
.
push
(
`
${
key
}
=
${
options
[
key
]}
`
)
})
}
if
(
query
.
length
)
currentRoute
+=
`?
${
query
.
join
(
'&'
)}
`
return
wx
.
p
.
router
.
redirectTo
(
'/pages/loading/loading'
,
{
url
:
`/
${
currentRoute
}
`
})
})
}
else
{
}
else
{
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
...
...
pages/Login/Login.js
View file @
5e000ef
...
@@ -35,8 +35,14 @@ Page({
...
@@ -35,8 +35,14 @@ Page({
async
onLoad
()
{
async
onLoad
()
{
wx
.
p
.
wxApi
.
showLoading
()
wx
.
p
.
wxApi
.
showLoading
()
const
{
const
{
data
data
,
code
}
=
await
wx
.
p
.
api
.
userApi
.
login
()
}
=
await
wx
.
p
.
api
.
userApi
.
login
()
if
(
code
==
'0'
)
{
wx
.
p
.
storage
.
set
(
'userInfo'
,
data
)
wx
.
p
.
storage
.
set
(
'sessionId'
,
data
.
sessionId
)
wx
.
p
.
router
.
back
()
}
if
(
data
)
this
.
sessionId
=
data
.
sessionId
if
(
data
)
this
.
sessionId
=
data
.
sessionId
wx
.
hideLoading
()
wx
.
hideLoading
()
},
},
...
@@ -159,7 +165,7 @@ Page({
...
@@ -159,7 +165,7 @@ Page({
wx
.
p
.
storage
.
set
(
'sessionId'
,
data
.
sessionId
)
wx
.
p
.
storage
.
set
(
'sessionId'
,
data
.
sessionId
)
// 返回上一页
// 返回上一页
wx
.
p
.
router
.
back
(
thisPage
=>
{
wx
.
p
.
router
.
back
(
thisPage
=>
{
thisPage
.
setData
({
thisPage
&&
thisPage
.
setData
({
userInfo
:
data
userInfo
:
data
})
})
})
})
...
...
pages/Login/Login.wxml
View file @
5e000ef
...
@@ -64,5 +64,4 @@
...
@@ -64,5 +64,4 @@
<text class="txt-orange" catchtap="handleAgree" data-name="agreement">《服务使用协议》</text>
<text class="txt-orange" catchtap="handleAgree" data-name="agreement">《服务使用协议》</text>
</view>
</view>
</view>
</view>
<view class="login-bottom"></view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
pages/Login/Login.wxss
View file @
5e000ef
...
@@ -7,10 +7,20 @@ page {}
...
@@ -7,10 +7,20 @@ page {}
width: 1350rpx;
width: 1350rpx;
height: 1664rpx;
height: 1664rpx;
top: -60rpx;
top: -60rpx;
}
}
.layout::before{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 600rpx;
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 100%);
z-index: -1;
content: '';
}
.l
ogin-bottom
{
.l
ayout::after
{
position: fixed;
position: fixed;
left: 0;
left: 0;
bottom: 0;
bottom: 0;
...
@@ -19,6 +29,7 @@ page {}
...
@@ -19,6 +29,7 @@ page {}
transform: scaleY(-1);
transform: scaleY(-1);
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 90%);
background-image: linear-gradient(0deg, #0a030300 22%, #0A0303 90%);
z-index: -1;
z-index: -1;
content: '';
}
}
.nav-bar {
.nav-bar {
...
...
pages/tab/index/index.scss
View file @
5e000ef
...
@@ -38,7 +38,6 @@ page {
...
@@ -38,7 +38,6 @@ page {
.layout
{
.layout
{
padding-bottom
:
200rpx
;
position
:
relative
;
position
:
relative
;
padding-top
:
16rpx
;
padding-top
:
16rpx
;
background
:
transparent
;
background
:
transparent
;
...
...
pages/tab/index/index.wxml
View file @
5e000ef
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color:
transparent
;">
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color:
#F9F7F7
;">
<view class="home-top flex">
<view class="home-top flex">
海马刀
海马刀
<view class="widget-box" bindtap="openKF">
<view class="widget-box" bindtap="openKF">
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment