Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
f076ef5b
Commit
f076ef5b
authored
Oct 31, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注销清除数据
parent
ba786b2f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
8 deletions
+58
-8
global.js
stores/global.js
+15
-1
home.js
stores/home.js
+10
-0
user.js
stores/user.js
+15
-0
logoffConfirmPage.vue
v3/logoffConfirmPage/logoffConfirmPage.vue
+18
-7
No files found.
stores/global.js
View file @
f076ef5b
...
@@ -101,6 +101,20 @@ export const useGlobalStore = defineStore('global', {
...
@@ -101,6 +101,20 @@ export const useGlobalStore = defineStore('global', {
*/
*/
closeTaskPerson
()
{
closeTaskPerson
()
{
this
.
isShowTaskPerson
=
false
;
this
.
isShowTaskPerson
=
false
;
}
},
/**
* 清除认证信息(注销时使用)
*/
clearAuthData
()
{
this
.
cuk
=
null
;
this
.
openId
=
null
;
this
.
unionId
=
null
;
// 清除本地存储
uni
.
removeStorageSync
(
'cuk'
);
uni
.
removeStorageSync
(
'openId'
);
uni
.
removeStorageSync
(
'unionId'
);
},
},
},
});
});
\ No newline at end of file
stores/home.js
View file @
f076ef5b
...
@@ -69,5 +69,15 @@ this.hasShownPopup = false
...
@@ -69,5 +69,15 @@ this.hasShownPopup = false
md
.
login
(
mdData
);
md
.
login
(
mdData
);
}
}
},
},
/**
* 清除首页信息(注销时使用)
*/
clearHomeData
()
{
this
.
homeInfo
=
null
;
this
.
isLogin
=
false
;
this
.
babyExistence
=
false
;
this
.
hasShownPopup
=
false
;
},
},
},
});
});
stores/user.js
View file @
f076ef5b
...
@@ -381,5 +381,20 @@ export const useUserStore = defineStore("userInfo", {
...
@@ -381,5 +381,20 @@ export const useUserStore = defineStore("userInfo", {
return
false
;
return
false
;
}
}
},
},
/**
* 清除用户信息(注销时使用)
*/
clearUserData
()
{
this
.
userInfo
=
null
;
this
.
babyInfo
=
null
;
this
.
memberInfo
=
null
;
this
.
babyNickCache
=
[];
this
.
cepingjieguoInfo
=
null
;
// 清除本地存储
uni
.
removeStorageSync
(
'memberId'
);
uni
.
removeStorageSync
(
'loginStatus'
);
},
},
},
});
});
\ No newline at end of file
v3/logoffConfirmPage/logoffConfirmPage.vue
View file @
f076ef5b
...
@@ -38,6 +38,9 @@
...
@@ -38,6 +38,9 @@
<
script
>
<
script
>
import
{
doTerminate
}
from
'@/api/user.js'
;
import
{
doTerminate
}
from
'@/api/user.js'
;
import
{
jump
,
JumpType
}
from
'../../utils'
;
import
{
jump
,
JumpType
}
from
'../../utils'
;
import
{
useUserStore
}
from
'../../stores/user.js'
;
import
{
useGlobalStore
}
from
'../../stores/global.js'
;
import
{
useHomeStore
}
from
'../../stores/home.js'
;
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -77,20 +80,28 @@ export default {
...
@@ -77,20 +80,28 @@ export default {
// 跳转到注销页面
// 跳转到注销页面
navigateToLogoff
()
{
navigateToLogoff
()
{
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'正在处理
注销
申请...'
title
:
'正在处理申请...'
});
});
doTerminate
().
then
(
res
=>
{
doTerminate
().
then
(
res
=>
{
console
.
log
(
'注销接口返回结果:'
,
res
);
console
.
log
(
'注销接口返回结果:'
,
res
);
uni
.
hideLoading
();
uni
.
hideLoading
();
if
(
res
.
ok
)
{
if
(
res
.
ok
)
{
// 清除本地缓存的用户信息
const
userStore
=
useUserStore
();
const
globalStore
=
useGlobalStore
();
const
homeStore
=
useHomeStore
();
// 可以跳转到登录页面或首页
userStore
.
clearUserData
();
setTimeout
(()
=>
{
globalStore
.
clearAuthData
();
uni
.
reLaunch
({
homeStore
.
clearHomeData
();
url
:
'/pages/index/index'
});
console
.
log
(
'用户信息已清除'
);
},
1500
);
// 跳转到首页
uni
.
reLaunch
({
url
:
'/pages/index/index?pageType=home'
});
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
||
'注销申请失败'
,
title
:
res
.
message
||
'注销申请失败'
,
...
...
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