add logout
parent
9671d60555
commit
cdf57806d6
|
@ -65,3 +65,12 @@ export function refreshTokenFn(refresh_token) {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取密码状态
|
||||||
|
export function logout () {
|
||||||
|
return http.request({
|
||||||
|
url: '/members/logout',
|
||||||
|
method: "POST",
|
||||||
|
needToken: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { logout } from "@/api/login";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
export default {
|
export default {
|
||||||
|
@ -56,10 +57,12 @@ export default {
|
||||||
* 清除缓存重新登录
|
* 清除缓存重新登录
|
||||||
*/
|
*/
|
||||||
confirm() {
|
confirm() {
|
||||||
|
logout().then(res => {
|
||||||
storage.setAccessToken("");
|
storage.setAccessToken("");
|
||||||
storage.setRefreshToken("");
|
storage.setRefreshToken("");
|
||||||
storage.setUserInfo({});
|
storage.setUserInfo({});
|
||||||
this.$options.filters.navigateToLogin("redirectTo");
|
this.$options.filters.navigateToLogin("redirectTo");
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue