Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
shishuangxi
2024-04-26 15:12:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
65c96a06bdd4c57d5948c0f5ca343254fd8e25ba
65c96a06
1 parent
8cef1183
注销bug处理
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
View file @
65c96a0
import HashMap from '@ohos.util.HashMap';
import { UserDataLocal } from 'wdKit/Index';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork';
export class LogoutModel{
requestLogout(){
let bean: Record<string, string> = {};
bean['refreshToken'] = HttpUrlUtils.getRefreshToken()
bean['refreshToken'] = 'ddrqreeee'
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<string>((success, fail) => {
Http
Request
.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => {
Http
BizUtil
.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => {
if (!data) {
fail("数据为空")
return
...
...
@@ -23,7 +20,6 @@ export class LogoutModel{
success(data.message)
}, (error: Error) => {
fail(error.message)
// Logger.debug("LoginViewModel:error ", error.toString())
})
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
View file @
65c96a0
import { SpConstants } from 'wdConstant/Index'
import { SPHelper } from 'wdKit/Index'
import { SPHelper
, UserDataLocal
} from 'wdKit/Index'
import { HttpUrlUtils } from 'wdNetwork/Index'
import { LogoutModel } from '../model/LogoutModel'
...
...
@@ -32,5 +32,6 @@ export class LogoutViewModel{
HttpUrlUtils.setUserId("")
HttpUrlUtils.setUserType("")
HttpUrlUtils.setUserToken('')
UserDataLocal.clearUserData()
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment