Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
million
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
viitto
million
Commits
3cebdea6
Commit
3cebdea6
authored
Jun 29, 2020
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时提交
parent
cb10135f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
167 additions
and
108 deletions
+167
-108
utils.js
src/boot/utils.js
+73
-73
tofu-head.vue
src/components/search_p/tofu-head.vue
+13
-0
Search.vue
src/pages/Search.vue
+42
-0
routes.js
src/router/routes.js
+39
-35
No files found.
src/boot/utils.js
View file @
3cebdea6
...
...
@@ -3,90 +3,90 @@ import axios from 'axios'
import
md5
from
'js-md5'
//域名管理对象
Vue
.
prototype
.
domainManager
=
function
()
{
let
domainUrl
=
''
;
domainUrl
=
"http://192.168.2.214:8082"
;
domainUrl
=
"http://192.168.0.110"
;
let
locationName
=
window
.
location
.
hostname
;
if
(
locationName
.
indexOf
(
'testerp.oytour'
)
!==
-
1
)
{
domainUrl
=
"http://testapi.oytour.com"
;
}
else
if
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
)
{
domainUrl
=
"http://reborn.oytour.com"
;
}
var
obj
=
{
//主地址
DomainUrl
:
domainUrl
,
//常用提交数据URL
PostUrl
:
domainUrl
+
"/api/common/post"
,
};
return
obj
;
Vue
.
prototype
.
domainManager
=
function
()
{
let
domainUrl
=
''
;
domainUrl
=
"http://192.168.2.214:8082"
;
//
domainUrl="http://192.168.0.110";
let
locationName
=
window
.
location
.
hostname
;
if
(
locationName
.
indexOf
(
'testerp.oytour'
)
!==
-
1
)
{
domainUrl
=
"http://testapi.oytour.com"
;
}
else
if
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
)
{
domainUrl
=
"http://reborn.oytour.com"
;
}
var
obj
=
{
//主地址
DomainUrl
:
domainUrl
,
//常用提交数据URL
PostUrl
:
domainUrl
+
"/api/common/post"
,
};
return
obj
;
}
//HTTP提交数据
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
successCall
,
faildCall
)
{
if
(
msg
==
null
||
msg
==
""
)
{
msg
=
{}
}
var
timestamp
=
(
new
Date
()).
valueOf
();
var
apiurl
=
this
.
domainManager
().
PostUrl
;
var
token
=
""
;
var
key
=
""
;
var
tempLanguage
=
0
;
if
(
this
.
getLocalStorage
()
!=
null
)
{
token
=
this
.
getLocalStorage
().
token
;
key
=
this
.
getLocalStorage
().
SecretKey
;
}
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
var
md5Str
=
md5
(
`cmd=
${
cmd
}
&msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
successCall
,
faildCall
)
{
if
(
msg
==
null
||
msg
==
""
)
{
msg
=
{}
}
var
timestamp
=
(
new
Date
()).
valueOf
();
var
apiurl
=
this
.
domainManager
().
PostUrl
;
var
token
=
""
;
var
key
=
""
;
var
tempLanguage
=
0
;
if
(
this
.
getLocalStorage
()
!=
null
)
{
token
=
this
.
getLocalStorage
().
token
;
key
=
this
.
getLocalStorage
().
SecretKey
;
}
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
var
md5Str
=
md5
(
`cmd=
${
cmd
}
&msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
var
postData
=
{
msg
:
msg
,
cmd
:
cmd
,
timestamp
:
timestamp
,
token
:
token
,
sign
:
md5Str
,
languageId
:
tempLanguage
}
this
.
$axios
.
post
(
apiurl
,
postData
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Referer-Viitto'
:
this
.
$route
.
path
}
})
.
then
(
res
=>
{
successCall
(
res
);
},
faildCall
)
var
postData
=
{
msg
:
msg
,
cmd
:
cmd
,
timestamp
:
timestamp
,
token
:
token
,
sign
:
md5Str
,
languageId
:
tempLanguage
}
this
.
$axios
.
post
(
apiurl
,
postData
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Referer-Viitto'
:
this
.
$route
.
path
}
})
.
then
(
res
=>
{
successCall
(
res
);
},
faildCall
)
}
//获取缓存
Vue
.
prototype
.
getLocalStorage
=
function
()
{
var
localStorageData
=
window
.
localStorage
[
"b2bUser"
];
if
(
localStorageData
!==
undefined
&&
localStorageData
!=
'undefined'
)
{
return
JSON
.
parse
(
localStorageData
);
}
else
{
return
null
;
}
Vue
.
prototype
.
getLocalStorage
=
function
()
{
var
localStorageData
=
window
.
localStorage
[
"b2bUser"
];
if
(
localStorageData
!==
undefined
&&
localStorageData
!=
'undefined'
)
{
return
JSON
.
parse
(
localStorageData
);
}
else
{
return
null
;
}
}
//向外跳转
Vue
.
prototype
.
OpenNewUrl
=
function
(
URL
)
{
if
(
URL
&&
URL
!=
''
)
{
if
(
URL
.
indexOf
(
"https"
)
!=
-
1
)
{
var
str
=
'http://'
+
URL
.
substring
(
8
);
window
.
open
(
str
,
'_blank'
);
}
else
if
(
URL
.
indexOf
(
"http"
)
!=
-
1
)
{
var
str
=
'http://'
+
URL
.
substring
(
7
);
window
.
open
(
str
,
'_blank'
);
}
else
{
window
.
open
(
"http://"
+
URL
,
'_blank'
);
Vue
.
prototype
.
OpenNewUrl
=
function
(
URL
)
{
if
(
URL
&&
URL
!=
''
)
{
if
(
URL
.
indexOf
(
"https"
)
!=
-
1
)
{
var
str
=
'http://'
+
URL
.
substring
(
8
);
window
.
open
(
str
,
'_blank'
);
}
else
if
(
URL
.
indexOf
(
"http"
)
!=
-
1
)
{
var
str
=
'http://'
+
URL
.
substring
(
7
);
window
.
open
(
str
,
'_blank'
);
}
else
{
window
.
open
(
"http://"
+
URL
,
'_blank'
);
}
}
}
}
//公用跳转
Vue
.
prototype
.
CommonJump
=
function
(
path
,
obj
)
{
this
.
$router
.
push
({
path
:
path
,
query
:
obj
});
}
Vue
.
prototype
.
CommonJump
=
function
(
path
,
obj
)
{
this
.
$router
.
push
({
path
:
path
,
query
:
obj
});
}
\ No newline at end of file
src/components/search_p/tofu-head.vue
0 → 100644
View file @
3cebdea6
<
template
>
</
template
>
<
script
>
export
default
{
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/pages/Search.vue
0 → 100644
View file @
3cebdea6
<
template
>
<div>
{{
r
}}
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
r
:
""
,
r2
:
{
code
:
0
,
msg
:
"请求成功"
,
data
:
{
detail
:
{
id
:
157017
,
mall_id
:
1285
,
user_id
:
57936
,
token
:
"JP2RJdnGiUP3Kx-UKJpWVzT3mcBlqu"
,
data
:
{
id
:
167282
,
user_id
:
57936
,
qr_code_id
:
157017
},
created_at
:
"2020-06-28 11:45:58"
,
path
:
"pages/goods/goods"
,
use_number
:
0
}
}
}
};
},
mounted
()
{
this
.
r
=
this
.
format
(
this
.
r2
.
data
.
detail
.
data
);
},
methods
:
{
format
(
e
,
t
)
{
var
n
=
""
;
for
(
var
i
in
this
.
r2
.
data
.
detail
.
data
)
n
+=
"&"
+
i
+
"="
+
(
t
?
encodeURIComponent
(
e
[
i
])
:
e
[
i
]);
return
n
.
substr
(
1
);
}
}
};
</
script
>
<
style
></
style
>
src/router/routes.js
View file @
3cebdea6
const
routes
=
[{
path
:
'/'
,
component
:
()
=>
import
(
'layouts/HomeLayout.vue'
),
children
:
[{
path
:
''
,
path
:
'/'
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/Index'
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/About'
,
//关于我们
component
:
()
=>
import
(
'pages/About.vue'
)
},
{
path
:
'/contract'
,
//契约管理
component
:
()
=>
import
(
'pages/contract.vue'
)
},
{
path
:
'/tour_visa'
,
//签证护照管理
component
:
()
=>
import
(
'pages/tour_visa.vue'
)
}
]
},
import
(
'layouts/HomeLayout.vue'
),
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/Index'
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/About'
,
//关于我们
component
:
()
=>
import
(
'pages/About.vue'
)
},
{
path
:
'/contract'
,
//契约管理
component
:
()
=>
import
(
'pages/contract.vue'
)
},
{
path
:
'/tour_visa'
,
//签证护照管理
component
:
()
=>
import
(
'pages/tour_visa.vue'
)
},
{
path
:
'/search'
,
//签证护照管理
component
:
()
=>
import
(
'pages/search.vue'
)
}
]
},
]
// Always leave this as last one
if
(
process
.
env
.
MODE
!==
'ssr'
)
{
routes
.
push
({
path
:
'*'
,
component
:
()
=>
import
(
'pages/Error404.vue'
)
})
}
//
if (process.env.MODE !== 'ssr') {
routes
.
push
({
path
:
'*'
,
component
:
()
=>
import
(
'pages/Error404.vue'
)
})
//
}
export
default
routes
export
default
routes
\ No newline at end of file
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