Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uni-app-ddh-shop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
zhanhai
uni-app-ddh-shop
Commits
4c60c5ab
Commit
4c60c5ab
authored
Sep 13, 2024
by
ly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取设备信息相关修改
parent
8179316a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
27 deletions
+30
-27
App.vue
App.vue
+3
-2
index.vue
pages/indexfinance/index.vue
+11
-13
app-service.js
unpackage/dist/dev/app-plus/app-service.js
+6
-6
app-view.js
unpackage/dist/dev/app-plus/app-view.js
+1
-1
header.js
utils/header.js
+5
-2
request.js
utils/request.js
+4
-3
No files found.
App.vue
View file @
4c60c5ab
...
@@ -221,7 +221,7 @@
...
@@ -221,7 +221,7 @@
}
}
},
},
onShow
:
function
()
{
onShow
:
function
()
{
this
.
checkVersion
()
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
if
(
!
common
&&
plus
.
os
.
name
==
'iOS'
)
{
if
(
!
common
&&
plus
.
os
.
name
==
'iOS'
)
{
console
.
log
(
plus
.
os
.
name
,
'9'
)
console
.
log
(
plus
.
os
.
name
,
'9'
)
...
@@ -230,6 +230,7 @@
...
@@ -230,6 +230,7 @@
this
.
loadLocation
();
this
.
loadLocation
();
this
.
loadUuid
()
this
.
loadUuid
()
}
}
this
.
checkVersion
()
},
},
onHide
:
function
()
{
onHide
:
function
()
{
...
...
pages/indexfinance/index.vue
View file @
4c60c5ab
...
@@ -74,16 +74,16 @@
...
@@ -74,16 +74,16 @@
}
}
},
},
onLoad
()
{
onLoad
()
{
const
token
=
uni
.
getStorageSync
(
'token'
)
const
token
=
uni
.
getStorageSync
(
'token
Finance
'
)
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
this
.
init
()
console
.
log
(
'onLoad'
)
if
(
!
common
&&
plus
.
os
.
name
!=
'iOS'
&&
token
){
if
(
!
common
&&
plus
.
os
.
name
!=
'iOS'
&&
token
){
loadDevice
()
loadDevice
()
loadNetwork
()
loadNetwork
()
loadUuid
()
loadUuid
()
loadLocation
()
loadLocation
()
this
.
init
()
}
else
{
this
.
init
()
}
}
},
},
...
@@ -141,17 +141,15 @@
...
@@ -141,17 +141,15 @@
}
}
},
},
onShow
(){
onShow
(){
console
.
log
(
'onShow2x'
)
const
token
=
uni
.
getStorageSync
(
'token'
)
this
.
init
()
const
token
=
uni
.
getStorageSync
(
'tokenFinance'
)
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
const
common
=
uni
.
getStorageSync
(
"m-header-device"
)
if
(
!
common
&&
plus
.
os
.
name
!=
'iOS'
&&
token
){
if
(
!
common
&&
plus
.
os
.
name
!=
'iOS'
&&
token
){
loadDevice
()
loadDevice
()
loadNetwork
()
loadNetwork
()
loadUuid
()
loadUuid
()
loadLocation
()
loadLocation
()
this
.
init
()
}
else
{
this
.
init
()
}
}
}
}
...
...
unpackage/dist/dev/app-plus/app-service.js
View file @
4c60c5ab
This source diff could not be displayed because it is too large. You can
view the blob
instead.
unpackage/dist/dev/app-plus/app-view.js
View file @
4c60c5ab
...
@@ -17510,7 +17510,7 @@ if(false) {}
...
@@ -17510,7 +17510,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../Applications/HBuilderX 2.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../Applications/HBuilderX 2.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 10);
exports = ___CSS_LOADER_API_IMPORT___(false);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
// Module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/*每个页面公共css */\n", ""]);
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
/*每个页面公共css */\n", ""]);
// Exports
// Exports
module.exports = exports;
module.exports = exports;
utils/header.js
View file @
4c60c5ab
...
@@ -19,14 +19,17 @@ export const convertPromise = function (FnName, params = {}) {
...
@@ -19,14 +19,17 @@ export const convertPromise = function (FnName, params = {}) {
export
const
initHeaderInfo
=
function
(){
export
const
initHeaderInfo
=
function
(){
const
versionNew
=
uni
.
getStorageSync
(
'version'
)
const
versionNew
=
uni
.
getStorageSync
(
'version'
)
console
.
log
(
versionNew
,
'versionNew'
)
let
deviceName
if
(
plus
.
os
.
name
==
'Android'
){
deviceName
=
'android'
}
// 根据当前时间戳生成一个随机整数
// 根据当前时间戳生成一个随机整数
var
randomNum
=
new
Date
().
getTime
();
var
randomNum
=
new
Date
().
getTime
();
const
commons
=
{
const
commons
=
{
"appName"
:
"DDH"
,
"appName"
:
"DDH"
,
"appSourceId"
:
"1"
,
"appSourceId"
:
"1"
,
"token"
:
randomNum
,
"token"
:
randomNum
,
"device"
:
plus
.
os
.
n
ame
,
"device"
:
deviceN
ame
,
"appVersion"
:
versionNew
,
"appVersion"
:
versionNew
,
}
}
return
commons
return
commons
...
...
utils/request.js
View file @
4c60c5ab
...
@@ -6,20 +6,21 @@ const request=async(url,type,data)=>{
...
@@ -6,20 +6,21 @@ const request=async(url,type,data)=>{
const
headerDevice
=
uni
.
getStorageSync
(
'm-header-device'
)
const
headerDevice
=
uni
.
getStorageSync
(
'm-header-device'
)
const
versionNew
=
uni
.
getStorageSync
(
'version'
)
const
versionNew
=
uni
.
getStorageSync
(
'version'
)
const
deviceInfo
=
uni
.
getStorageSync
(
'm-device-info'
)
// 根据当前时间戳生成一个随机整数
// 根据当前时间戳生成一个随机整数
var
randomNum
=
new
Date
().
getTime
();
var
randomNum
=
new
Date
().
getTime
();
let
rd
let
rd
console
.
log
(
deviceInfo
,
'networkInfo'
)
const
tokenF
=
uni
.
getStorageSync
(
'tokenFinance'
)
const
tokenF
=
uni
.
getStorageSync
(
'tokenFinance'
)
if
(
tokenF
==
''
&&
plus
.
os
.
name
!=
'iOS'
){
if
(
!
deviceInfo
||
tokenF
==
''
&&
plus
.
os
.
name
!=
'iOS'
){
rd
=
initHeaderInfo
()
rd
=
initHeaderInfo
()
}
else
{
}
else
{
if
(
headerDevice
)
{
if
(
headerDevice
)
{
rd
=
headerDevice
rd
=
headerDevice
// console.log(headerDevice,'headerDevice')
}
else
{
}
else
{
const
common
=
initHeaderDevice
()
const
common
=
initHeaderDevice
()
rd
=
JSON
.
stringify
(
common
)
rd
=
JSON
.
stringify
(
common
)
// console.log(rd,'rd3333')
}
}
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
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