lemon橪 2021-11-15 16:19:55 +08:00
commit 7c85460fbb
2 changed files with 16 additions and 4 deletions

View File

@ -65,3 +65,12 @@ export function refreshTokenFn(refresh_token) {
method: "GET",
});
}
// 获取密码状态
export function logout () {
return http.request({
url: '/members/logout',
method: "POST",
needToken: true,
})
}

View File

@ -27,6 +27,7 @@
</template>
<script>
import { logout } from "@/api/login";
import storage from "@/utils/storage.js";
import config from "@/config/config";
export default {
@ -56,10 +57,12 @@ export default {
* 清除缓存重新登录
*/
confirm() {
logout().then(res => {
storage.setAccessToken("");
storage.setRefreshToken("");
storage.setUserInfo({});
this.$options.filters.navigateToLogin("redirectTo");
});
},
/**