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
502a887a
Commit
502a887a
authored
Jun 23, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f0a818d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
66 deletions
+168
-66
axios.js
src/boot/axios.js
+84
-0
HomeLayout.vue
src/layouts/HomeLayout.vue
+84
-66
No files found.
src/boot/axios.js
View file @
502a887a
import
Vue
from
'vue'
import
axios
from
'axios'
import
md5
from
'js-md5'
Vue
.
prototype
.
$axios
=
axios
//域名管理对象
Vue
.
prototype
.
domainManager
=
function
()
{
let
domainUrl
=
''
;
domainUrl
=
"http://127.0.0.1"
;
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
apiurl
=
this
.
domainManager
().
PostUrl
;
var
timestamp
=
(
new
Date
()).
valueOf
();
this
.
apiurl
=
apiurl
;
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
=>
{
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
}
else
if
(
res
.
resultCode
==
10005
)
{
this
.
$router
.
go
(
-
1
);
}
else
{
successCall
(
res
);
}
},
faildCall
)
}
//ERP本地缓存
Vue
.
prototype
.
getLocalStorage
=
function
()
{
var
localStorageData
=
window
.
localStorage
[
"b2bUser"
];
if
(
localStorageData
!==
undefined
&&
localStorageData
!=
'undefined'
)
{
return
JSON
.
parse
(
localStorageData
);
}
else
{
return
null
;
}
}
export
default
({
app
})
=>
{
// Set i18n instance on app
app
.
axios
=
axios
}
export
{
axios
}
src/layouts/HomeLayout.vue
View file @
502a887a
<
template
>
<q-layout
view=
"hHh lpr fFf"
>
<hor-big-one
v-if=
"headType==1"
:base-data=
"baseinfo"
ref=
"webhead"
></hor-big-one>
<hor-big-two
v-if=
"headType==2"
:base-data=
"baseinfo"
ref=
"webhead"
></hor-big-two>
<hor-big-two
v-if=
"headType==2"
:base-data=
"baseinfo"
ref=
"webhead"
></hor-big-two>
<q-page-container>
<router-view
/>
</q-page-container>
...
...
@@ -19,71 +19,89 @@
</
template
>
<
script
>
import
horBigOne
from
"../components/navs/hor-big-one"
;
import
horBigTwo
from
"../components/navs/hor-big-tow"
;
export
default
{
components
:
{
horBigOne
,
horBigTwo
},
data
()
{
return
{
leftDrawerOpen
:
false
,
baseinfo
:
{
logo
:
"https://de0s2vtm6rzpn.cloudfront.net/white_label/575/logo_1583290210_rsz.png"
,
name
:
"玩家旅遊"
,
nav
:
{
bg
:
"rgba(255,255,255,.95)"
,
color
:
"#222"
,
navs
:
[
{
title
:
"極上•深之旅"
,
url
:
"http://17658.byethost18.com/"
,
icon
:
""
},
{
title
:
"519住宿趣"
,
url
:
"http://winterfavor.byethost7.com/"
,
icon
:
""
},
{
title
:
"玩家旅遊論壇"
,
url
:
"https://www.facebook.com/papago17658/"
,
icon
:
""
},
{
title
:
"全球租車"
,
url
:
"https://yvonne.tripsaas.com/"
,
icon
:
""
},
{
title
:
"歐洲團體行程"
,
url
:
"https://yvonne.tripsaas.com/search/search_result?keyword=%E5%85%A8%E5%8D%80%20%E6%AD%90&type=area&from=2019-07-10&to=2020-01-06"
,
icon
:
""
},
{
title
:
"茸茸毛寵物用品商城"
,
url
:
"https://petsiloveyou.123web.tw/"
,
icon
:
""
}
]
import
horBigOne
from
"../components/navs/hor-big-one"
;
import
horBigTwo
from
"../components/navs/hor-big-tow"
;
export
default
{
components
:
{
horBigOne
,
horBigTwo
},
data
()
{
return
{
leftDrawerOpen
:
false
,
baseinfo
:
{
logo
:
"https://de0s2vtm6rzpn.cloudfront.net/white_label/575/logo_1583290210_rsz.png"
,
name
:
"玩家旅遊"
,
nav
:
{
bg
:
"rgba(255,255,255,.95)"
,
color
:
"#222"
,
navs
:
[{
title
:
"極上•深之旅"
,
url
:
"http://17658.byethost18.com/"
,
icon
:
""
},
{
title
:
"519住宿趣"
,
url
:
"http://winterfavor.byethost7.com/"
,
icon
:
""
},
{
title
:
"玩家旅遊論壇"
,
url
:
"https://www.facebook.com/papago17658/"
,
icon
:
""
},
{
title
:
"全球租車"
,
url
:
"https://yvonne.tripsaas.com/"
,
icon
:
""
},
{
title
:
"歐洲團體行程"
,
url
:
"https://yvonne.tripsaas.com/search/search_result?keyword=%E5%85%A8%E5%8D%80%20%E6%AD%90&type=area&from=2019-07-10&to=2020-01-06"
,
icon
:
""
},
{
title
:
"茸茸毛寵物用品商城"
,
url
:
"https://petsiloveyou.123web.tw/"
,
icon
:
""
}
]
},
desc
:
"這是一家非常牛逼的旅遊網站"
},
desc
:
"這是一家非常牛逼的旅遊網站"
headType
:
0
};
},
created
()
{
this
.
$root
.
$on
(
'change-head-style'
,
param
=>
{
this
.
changeHeadHandler
(
param
);
this
.
getData
()
})
},
methods
:
{
getData
()
{
this
.
apipost
(
"ws_get_GetHomePage"
,
{
RB_Group_Id
:
2
},
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
resultCode
==
1
)
{
}
else
{
}
},
err
=>
{}
);
},
headType
:
0
};
},
created
()
{
this
.
$root
.
$on
(
'change-head-style'
,
param
=>
{
this
.
changeHeadHandler
(
param
)
})
},
methods
:
{
changeHeadHandler
(
t
)
{
this
.
headType
=
t
;
}
},
};
changeHeadHandler
(
t
)
{
this
.
headType
=
t
;
}
},
};
</
script
>
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