Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
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
李伟
cust-app
Commits
ff4cc78b
Commit
ff4cc78b
authored
Feb 14, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了我的页面的校验,如果用户被禁用,则显示未登录,去除localstorage存储的信息
parent
66de7e5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
my.vue
pages/tab/my.vue
+7
-0
index.vue
pageslogin/index.vue
+13
-0
No files found.
pages/tab/my.vue
View file @
ff4cc78b
...
@@ -247,6 +247,13 @@ import {articleList, getOssUrl} from "../../api/article";
...
@@ -247,6 +247,13 @@ import {articleList, getOssUrl} from "../../api/article";
//获取用户详情信息
//获取用户详情信息
getUserDetail
(){
getUserDetail
(){
userDetail
(
this
.
userInfo
.
memberId
).
then
(
res
=>
{
userDetail
(
this
.
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
){
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
this
.
nologin
=
true
return
;
}
//处理头像
//处理头像
if
(
res
.
data
.
data
.
avatar
!=
null
){
if
(
res
.
data
.
data
.
avatar
!=
null
){
getOssUrl
(
res
.
data
.
data
.
avatar
).
then
(
imgRes
=>
{
getOssUrl
(
res
.
data
.
data
.
avatar
).
then
(
imgRes
=>
{
...
...
pageslogin/index.vue
View file @
ff4cc78b
...
@@ -54,6 +54,19 @@
...
@@ -54,6 +54,19 @@
}
}
login
(
code
).
then
(
res
=>
{
login
(
code
).
then
(
res
=>
{
this
.
openId
=
res
.
data
.
openId
this
.
openId
=
res
.
data
.
openId
if
(
res
.
data
.
code
==
1001
){
//用户已被停用 提示报错信息 返回首页
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
//间隔1秒 跳转到首页
setTimeout
(()
=>
{
uni
.
switchTab
({
url
:
'/pages/tab/index'
});
},
1500
)
}
//证明不是第一次登录
//证明不是第一次登录
if
(
res
.
data
.
token
!==
undefined
&&
res
.
data
.
token
!==
null
)
{
if
(
res
.
data
.
token
!==
undefined
&&
res
.
data
.
token
!==
null
)
{
this
.
token
=
res
.
data
.
token
this
.
token
=
res
.
data
.
token
...
...
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