Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2af77db9
authored
Nov 21, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
e77faf9e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
6 deletions
+20
-6
.env.test
+14
-0
mock/user.js
+1
-2
package.json
+1
-0
src/store/modules/user.js
+3
-3
src/utils/request.js
+1
-1
No files found.
.env.test
0 → 100644
View file @
2af77db9
# just a flag
ENV
=
'production'
# base api
VUE_APP_BASE_API
=
'http://39.97.179.60:8092'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES
=
true
mock/user.js
View file @
2af77db9
...
...
@@ -64,8 +64,7 @@ export default [
}
return
{
code
:
20000
,
data
:
info
info
}
}
},
...
...
package.json
View file @
2af77db9
...
...
@@ -7,6 +7,7 @@
"scripts"
:
{
"dev"
:
"vue-cli-service serve"
,
"build:prod"
:
"vue-cli-service build"
,
"build:test"
:
"vue-cli-service build --mode test"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
"preview"
:
"node build/index.js --preview"
,
"lint"
:
"eslint --fix --ext .js,.vue src"
,
...
...
src/store/modules/user.js
View file @
2af77db9
...
...
@@ -35,8 +35,8 @@ const actions = {
return
new
Promise
((
resolve
,
reject
)
=>
{
login
({
username
:
username
.
trim
(),
password
:
password
}).
then
(
response
=>
{
const
{
data
}
=
response
commit
(
'SET_TOKEN'
,
data
.
token
)
setToken
(
data
.
token
)
commit
(
'SET_TOKEN'
,
data
)
setToken
(
data
)
resolve
()
}).
catch
(
error
=>
{
reject
(
error
)
...
...
@@ -48,7 +48,7 @@ const actions = {
getInfo
({
commit
,
state
})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getInfo
(
state
.
token
).
then
(
response
=>
{
const
{
data
}
=
response
const
data
=
response
if
(
!
data
)
{
reject
(
'Verification failed, please Login again.'
)
...
...
src/utils/request.js
View file @
2af77db9
...
...
@@ -44,7 +44,7 @@ service.interceptors.response.use(
*/
response
=>
{
const
res
=
response
.
data
console
.
log
(
res
.
code
,
res
.
code
!==
'
undefined
'
,
String
(
res
.
code
))
console
.
log
(
res
.
code
,
res
.
code
!==
'
0
'
,
String
(
res
.
code
))
// if the custom code is not 20000, it is judged as an error.
if
(
res
.
code
!==
'0'
&&
res
.
code
)
{
Message
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment