mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
feat: 更新用户注销功能
This commit is contained in:
@@ -130,3 +130,12 @@ export function scannerCodeLoginConfirm(params){
|
|||||||
needToken: true,
|
needToken: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注销用户
|
||||||
|
export function logoffConfirm() {
|
||||||
|
return http.request({
|
||||||
|
url: '/passport/member/cancellation',
|
||||||
|
method: "POST",
|
||||||
|
needToken: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
<u-cell-item title="安全中心" @click="navigateTo('/pages/mine/set/securityCenter/securityCenter')"></u-cell-item>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
<u-cell-item title="用户注销" v-if="userInfo.id" @click="logoff"></u-cell-item>
|
||||||
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
<u-cell-item title="意见反馈" @click="navigateTo('/pages/mine/set/feedBack')"></u-cell-item>
|
||||||
<!-- #ifndef H5 -->
|
<!-- #ifndef H5 -->
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
@@ -56,7 +57,12 @@ export default {
|
|||||||
this.$options.filters.quiteLoginOut();
|
this.$options.filters.quiteLoginOut();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销
|
||||||
|
*/
|
||||||
|
logoff(){
|
||||||
|
this.$options.filters.logoff();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取当前缓存
|
* 读取当前缓存
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { logout } from "@/api/login";
|
import { logout, logoffConfirm } from "@/api/login";
|
||||||
import { getUserInfo } from "@/api/members";
|
import { getUserInfo } from "@/api/members";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
@@ -361,6 +361,28 @@ export function quiteLoginOut () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注销
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function logoff () {
|
||||||
|
uni.showModal({
|
||||||
|
title: "提示",
|
||||||
|
content: "确认注销用户么?注销用户将无法再次登录并失去当前数据就。根据法规数据最长保留6个月,期间可以联系客服人员进行恢复数据。",
|
||||||
|
confirmColor: Vue.prototype.$mainColor,
|
||||||
|
async success (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
await logoffConfirm();
|
||||||
|
storage.setAccessToken("");
|
||||||
|
storage.setRefreshToken("");
|
||||||
|
storage.setUserInfo({});
|
||||||
|
navigateToLogin("redirectTo");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转im
|
* 跳转im
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user