Skip to content

Commit 5d44c0c

Browse files
committed
fix: mock login 200 httpstatus
1 parent 2a4730e commit 5d44c0c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

β€Žpackage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"lodash.get": "^4.4.2",
2121
"lodash.pick": "^4.4.0",
2222
"md5": "^2.2.1",
23-
"mockjs2": "^1.0.2",
23+
"mockjs2": "^1.0.5",
2424
"moment": "^2.24.0",
2525
"nprogress": "^0.2.0",
2626
"viser-vue": "^2.3.3",

β€Žsrc/mock/services/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const login = (options) => {
88
const body = getBody(options)
99
console.log('mock: body', body)
1010
if (!username.includes(body.username) || !password.includes(body.password)) {
11-
return builder({}, 'θ΄¦ζˆ·ζˆ–ε―†η ι”™θ――', 401)
11+
return builder({ isLogin: true }, 'θ΄¦ζˆ·ζˆ–ε―†η ι”™θ――', 401)
1212
}
1313

1414
return builder({

β€Žsrc/utils/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const err = (error) => {
2525
description: data.message
2626
})
2727
}
28-
if (error.response.status === 401) {
28+
if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
2929
notification.error({
3030
message: 'Unauthorized',
3131
description: 'Authorization verification failed'

β€Žyarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7190,10 +7190,10 @@ [email protected], [email protected], mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@
71907190
dependencies:
71917191
minimist "0.0.8"
71927192

7193-
mockjs2@^1.0.2:
7194-
version "1.0.2"
7195-
resolved "https://registry.yarnpkg.com/mockjs2/-/mockjs2-1.0.2.tgz#419707a03cf5852c8e9ce37acb0f44ef8ee06fc6"
7196-
integrity sha512-O2xujQxSQ526TGtz0kUQTfFln+0V085r4mcms1aMKCmnoSW704N46BbIIwpY1DJmLuDOHJasYtfN1wwOUeA2Ow==
7193+
mockjs2@^1.0.5:
7194+
version "1.0.5"
7195+
resolved "https://registry.npmjs.org/mockjs2/-/mockjs2-1.0.5.tgz#be80f670e0468092b15454169591e936c3bd29f9"
7196+
integrity sha512-2RPYSxVuIsmV0S8FwUh2srTm+K1EWr57GyUgjA5+6H49ZwqtFUlRfZAVJNYwKtswxehP4FDTsfuCRMd290bFTA==
71977197
dependencies:
71987198
commander "*"
71997199

0 commit comments

Comments
Β (0)