Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
高东东-金蝶建发
/
jf-yzj-yunying-sheet
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cdab3edc
authored
Nov 17, 2023
by
golton_gao
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 更新ios端小程序storage问题
parent
e24a4054
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
src/libraries/utils/common.js
src/libraries/utils/common.js
View file @
cdab3edc
...
...
@@ -26,13 +26,17 @@ export function randomNumber(minNum, maxNum) {
//获取cookie、
export
function
getCookie
(
name
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
qing
.
call
(
'
storage.getItem
'
,
{
qing
.
call
(
'
getStorage
'
,
{
key
:
name
,
success
:
(
result
)
=>
{
const
success
=
(
result
||
{}).
success
||
false
result
=
result
||
{}
const
success
=
result
.
success
||
false
if
(
`
${
success
}
`
.
toLowerCase
()
===
'true'
)
{
const
data
=
(
result
||
{}).
data
||
{}
let
val
=
data
.
value
let
val
=
result
.
data
if
(
!
val
)
{
resolve
(
null
)
return
}
try
{
val
=
JSON
.
parse
(
val
)
resolve
(
...
...
@@ -64,9 +68,9 @@ export function setCookie(name, value, days) {
expired
:
expireTime
,
}
return
new
Promise
((
resolve
,
reject
)
=>
{
qing
.
call
(
's
torage.setItem
'
,
{
qing
.
call
(
's
etStorage
'
,
{
key
:
name
,
value
:
JSON
.
stringify
(
val
),
data
:
JSON
.
stringify
(
val
),
success
:
(
result
)
=>
{
const
success
=
(
result
||
{}).
success
||
false
if
(
`
${
success
}
`
.
toLowerCase
()
===
'true'
)
{
...
...
@@ -91,7 +95,7 @@ export function delCookie(name) {
resolve
()
return
}
qing
.
call
(
'
storage.removeItem
'
,
{
qing
.
call
(
'
removeStorage
'
,
{
key
:
name
,
success
:
(
result
)
=>
{
const
success
=
(
result
||
{}).
success
||
false
...
...
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