Commit 17cfcddc by 李伟康

退出账号清空文件缓存

1 parent 5129117a
// pages/tab/mine/mine.js // pages/tab/mine/mine.js
import { IMG_URL } from '~/utils/constantData' import {
IMG_URL
} from '~/utils/constantData'
import USERAPI from '~/api/usersApi/index' import USERAPI from '~/api/usersApi/index'
import mineApi from '~/api/mineApi/index' import mineApi from '~/api/mineApi/index'
const IMAGES = Object.freeze({ const IMAGES = Object.freeze({
...@@ -17,7 +19,9 @@ Page({ ...@@ -17,7 +19,9 @@ Page({
isRead: false isRead: false
}, },
navGO(e) { navGO(e) {
let { path } = e.currentTarget.dataset let {
path
} = e.currentTarget.dataset
wx.$router.go(path) wx.$router.go(path)
}, },
logout() { logout() {
...@@ -31,6 +35,20 @@ Page({ ...@@ -31,6 +35,20 @@ Page({
// _this.showLoading() // _this.showLoading()
wx.$api.showLoading() wx.$api.showLoading()
USERAPI.logout().then(_res_ => { USERAPI.logout().then(_res_ => {
const fn = wx.getFileSystemManager()
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
files.length && files.map(e => {
fn.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${e}`
})
})
}
})
wx.$storage.rm('fileList')
wx.$storage.rm('sessionId') wx.$storage.rm('sessionId')
wx.$storage.rm('auto_login_object') wx.$storage.rm('auto_login_object')
wx.$storage.rm('userInfo') wx.$storage.rm('userInfo')
...@@ -41,7 +59,10 @@ Page({ ...@@ -41,7 +59,10 @@ Page({
}) })
}, },
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail let {
height,
statusBarHeight
} = e.detail
this.setData({ this.setData({
tabBarStyle: height / 2 + statusBarHeight tabBarStyle: height / 2 + statusBarHeight
}) })
...@@ -49,9 +70,13 @@ Page({ ...@@ -49,9 +70,13 @@ Page({
}, },
messageBoxPageIsRead() { messageBoxPageIsRead() {
console.log(111) console.log(111)
let { serviceMerchantId } = this.data let {
serviceMerchantId
} = this.data
mineApi mineApi
.messageBoxPageIsRead({ serviceMerchantId }) .messageBoxPageIsRead({
serviceMerchantId
})
.then(result => { .then(result => {
console.log(result) console.log(result)
this.setData({ this.setData({
...@@ -66,7 +91,9 @@ Page({ ...@@ -66,7 +91,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let { userInfo } = wx.$storage.get() let {
userInfo
} = wx.$storage.get()
let serviceMerchantId = userInfo.subLoginUser.merchantId let serviceMerchantId = userInfo.subLoginUser.merchantId
this.setData({ this.setData({
serviceMerchantId, serviceMerchantId,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!