Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mongo-ui
Commits
5784020a
Commit
5784020a
authored
Aug 31, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/goods' into 'master'
fix: 问题修复 See merge request
!166
parents
30f30651
dde64c91
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
16 deletions
+25
-16
LoginModal.vue
src/components/LoginModal.vue
+3
-4
localStorage.js
src/service/localStorage.js
+10
-0
MIDetail.vue
src/views/Goods/Detail/MIDetail.vue
+0
-1
detailPay.mixin.js
src/views/Goods/Detail/modules/detailPay.mixin.js
+4
-1
index.vue
src/views/Policy/PayWaiting/index.vue
+8
-10
No files found.
src/components/LoginModal.vue
View file @
5784020a
...
@@ -51,8 +51,8 @@ import { mapState, mapActions } from "vuex";
...
@@ -51,8 +51,8 @@ import { mapState, mapActions } from "vuex";
import
Modal
from
"
@/components/Modal
"
;
import
Modal
from
"
@/components/Modal
"
;
import
{
loginByPhone
,
getCaptchaSms
}
from
"
@/api/user
"
;
import
{
loginByPhone
,
getCaptchaSms
}
from
"
@/api/user
"
;
import
protocol
from
"
@/api/protocol
"
;
import
protocol
from
"
@/api/protocol
"
;
import
cookies
from
"
cookies-js
"
;
import
{
isPhone
,
isWeixinBrower
}
from
"
@/service/validation
"
;
import
{
isPhone
,
isWeixinBrower
}
from
"
@/service/validation
"
;
import
localStorage
from
"
@/service/localStorage
"
;
export
default
{
export
default
{
name
:
"
LoginModal
"
,
name
:
"
LoginModal
"
,
components
:
{
components
:
{
...
@@ -101,13 +101,12 @@ export default {
...
@@ -101,13 +101,12 @@ export default {
},
},
async
login
()
{
async
login
()
{
this
.
formData
.
loginChannel
=
isWeixinBrower
?
1
:
2
;
this
.
formData
.
loginChannel
=
isWeixinBrower
?
1
:
2
;
this
.
formData
.
openId
=
localStorage
.
get
Item
(
"
openId
"
)
||
null
;
this
.
formData
.
openId
=
localStorage
.
get
(
"
openId
"
)
||
null
;
const
res
=
await
loginByPhone
(
this
.
formData
);
const
res
=
await
loginByPhone
(
this
.
formData
);
if
(
res
)
{
if
(
res
)
{
this
.
$notify
({
type
:
"
success
"
,
message
:
"
登录成功
"
});
this
.
$notify
({
type
:
"
success
"
,
message
:
"
登录成功
"
});
this
.
setIsShowLogin
(
false
);
this
.
setIsShowLogin
(
false
);
localStorage
.
setItem
(
"
mongoToken
"
,
res
.
token
);
localStorage
.
set
(
"
mongoToken
"
,
res
.
token
);
cookies
.
set
(
"
mongoToken
"
,
res
.
token
,
{
expires
:
"
01/01/2030
"
});
// TODO 开发目前使用这个token
// TODO 开发目前使用这个token
// localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
// localStorage.setItem("mongoToken", "6ae7da7dd4c543f1a36c702c6f419f12");
}
}
...
...
src/service/localStorage.js
View file @
5784020a
import
cookies
from
"
cookies-js
"
;
export
default
{
export
default
{
get
(
key
)
{
get
(
key
)
{
let
result
=
window
.
localStorage
.
getItem
(
key
);
let
result
=
window
.
localStorage
.
getItem
(
key
);
// 如果本地存储拿不到tokenn,那就去cookies拿
if
(
!
result
&&
key
===
"
mongoToken
"
)
{
return
cookies
.
get
(
key
)
||
""
;
}
try
{
try
{
return
JSON
.
parse
(
result
);
return
JSON
.
parse
(
result
);
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -13,6 +19,10 @@ export default {
...
@@ -13,6 +19,10 @@ export default {
if
(
toString
.
call
(
value
)
===
"
[object Array]
"
||
toString
.
call
(
value
)
===
"
[object Object]
"
)
{
if
(
toString
.
call
(
value
)
===
"
[object Array]
"
||
toString
.
call
(
value
)
===
"
[object Object]
"
)
{
value
=
JSON
.
stringify
(
value
);
value
=
JSON
.
stringify
(
value
);
}
}
// token存cookies一份,做备份
if
(
key
===
"
mongoToken
"
)
{
cookies
.
set
(
key
,
value
,
{
expires
:
"
01/01/2030
"
});
}
return
window
.
localStorage
.
setItem
(
key
,
value
);
return
window
.
localStorage
.
setItem
(
key
,
value
);
},
},
remove
(
key
)
{
remove
(
key
)
{
...
...
src/views/Goods/Detail/MIDetail.vue
View file @
5784020a
...
@@ -271,7 +271,6 @@ export default {
...
@@ -271,7 +271,6 @@ export default {
"
relativeName
"
,
"
relativeName
"
,
"
relativeIdNo
"
"
relativeIdNo
"
];
];
console
.
log
(
errorInfo
);
if
(
!
noMsgArr
.
includes
(
errors
[
0
].
name
))
{
if
(
!
noMsgArr
.
includes
(
errors
[
0
].
name
))
{
this
.
$notify
({
type
:
"
warning
"
,
message
:
errors
[
0
].
message
});
this
.
$notify
({
type
:
"
warning
"
,
message
:
errors
[
0
].
message
});
}
}
...
...
src/views/Goods/Detail/modules/detailPay.mixin.js
View file @
5784020a
...
@@ -31,8 +31,11 @@ export default {
...
@@ -31,8 +31,11 @@ export default {
...
this
.
subFormData
...
this
.
subFormData
});
});
if
(
res
)
{
if
(
res
)
{
if
(
detailType
)
{
const
_key
=
detailType
===
"
li
"
?
"
PolicyFormData
"
:
detailType
+
"
DetailFormData
"
;
localStorage
.
remove
(
_key
);
}
this
.
orderInfo
=
res
;
this
.
orderInfo
=
res
;
detailType
&&
localStorage
.
remove
(
detailType
+
"
DetailFormData
"
);
this
.
goPay
();
this
.
goPay
();
}
}
},
},
...
...
src/views/Policy/PayWaiting/index.vue
View file @
5784020a
...
@@ -26,18 +26,16 @@ export default {
...
@@ -26,18 +26,16 @@ export default {
// }
// }
this
.
isPayWait
=
true
;
this
.
isPayWait
=
true
;
this
.
orderInfo
=
this
.
$route
.
query
;
this
.
orderInfo
=
this
.
$route
.
query
;
let
thirdParams
=
""
;
if
(
this
.
orderInfo
.
third
)
{
thirdParams
=
decodeURIComponent
(
this
.
orderInfo
.
third
);
}
// 如果存在isXyqb,同时当前不是在信用钱包环境
// 如果存在isXyqb,同时当前不是在信用钱包环境
if
((
this
.
orderInfo
.
isXyqb
==
1
&&
!
isXyqb
)
||
thi
rdParams
.
indexOf
(
"
1
"
)
===
0
)
{
if
((
this
.
orderInfo
.
isXyqb
==
1
&&
!
isXyqb
)
||
thi
s
.
orderInfo
.
third
.
indexOf
(
"
1
"
)
===
0
)
{
window
.
location
.
href
=
"
xyqb://my
"
;
window
.
location
.
href
=
"
xyqb://my
"
;
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
setTimeout
(()
=>
{
this
.
$router
.
replace
(
"
/policy
"
);
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
}
else
{
this
.
$router
.
replace
(
"
/policy
"
);
this
.
$router
.
replace
(
"
/home
"
);
}
else
{
}
this
.
$router
.
replace
(
"
/home
"
);
}
},
1000
);
return
;
return
;
}
}
// 没有订单信息的情况
// 没有订单信息的情况
...
...
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