提交 c7255ddf authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'master' into yc-3.1.0

......@@ -2,10 +2,10 @@
ENV = 'development'
# 正式环境
#VUE_APP_BASE_API = 'http://sj.jxhh.com/api/v1'
VUE_APP_BASE_API = 'http://sj.jxhh.com/api/v1'
# 测试环境
VUE_APP_BASE_API = 'http://192.168.26.179:6605/api/v1'
#VUE_APP_BASE_API = 'http://192.168.26.179:6605/api/v1'
#VUE_APP_BASE_API = 'http://192.168.111.240:6605/api/v1'
# 文档模块 直接调用 sys开放接口
......
......@@ -205,32 +205,38 @@
</div>
</body>
<script>
window.onload = function() {
var op = 'open'
var ssa = window.location.host
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
var channel_id = JSON.parse(xhttp.response).data.channel_id
if (channel_id == 0) {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon';
link.rel = 'icon';
link.href = '<%= BASE_URL %>icon.ico'
document.getElementsByTagName('head')[0].appendChild(link);
} else {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon';
link.rel = 'icon';
link.href = '<%= BASE_URL %>favicon.ico'
document.getElementsByTagName('head')[0].appendChild(link);
}
}
};
xhttp.open("GET", '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 正式环境
// xhttp.open("GET", '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 内网开发
// xhttp.open("GET", '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 测试环境
xhttp.send();
}
// window.onload = function() {
// var op = 'open'
// var ssa = window.location.host
// var xhttp = new XMLHttpRequest();
// xhttp.onreadystatechange = function() {
// if (xhttp.readyState == 4 && xhttp.status == 200) {
// var channel_id = JSON.parse(xhttp.response).data.channel.id
// if (channel_id == 0) {
// var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
// link.type = 'image/x-inon';
// link.rel = 'icon';
// link.href = '<%= BASE_URL %>icon.ico'
// document.getElementsByTagName('head')[0].appendChild(link);
// } else {
// var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
// link.type = 'image/x-inon';
// link.rel = 'icon';
// link.href = '<%= BASE_URL %>favicon.ico'
// document.getElementsByTagName('head')[0].appendChild(link);
// }
// }
// };
// // xhttp.open("GET", '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 正式环境
// // xhttp.open("GET", '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 内网开发
// // xhttp.open("GET", '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel?domain='+ssa+'&field='+op, true); // 测试环境
// xhttp.open("post", '//sysapi.jxhh.com/api/v1/channelSite/domain/info', true);
// let data = {
// domain: ssa,
// type: 1,
// site_type: 4
// }
// xhttp.send(JSON.stringify(data));
// }
</script>
</html>
......@@ -137,10 +137,10 @@ export function importTemplate() {
})
}
export function getBaseSettingTitle(params) {
export function getBaseSettingTitle(data) {
return request({
url: '/system/oem/getBaseSettingTitle',
method: 'get',
params
url: '/system/channelSite/info',
method: 'POST',
data: data
})
}
import request from '@/utils/request'
// 获取渠道id
export function indexInfo(params) {
export function indexInfo(data) {
return request({
url: '//sysapi.jxhh.com/api/v1/oem/webSite/domainChannel',
url: '/system/channelSite/info',
// url: '//192.168.26.179:6601/api/v1/oem/webSite/domainChannel',
// url: '//newsys.jxhh.com/api/v1/oem/webSite/domainChannel',
method: 'get',
params
method: 'post',
data
})
}
// 获取所有域名
......@@ -21,13 +21,13 @@ export function getdomain(params) {
})
}
// 获取官网设置接口
export function webSite(params) {
export function webSite(data) {
return request({
url: '//sysapi.jxhh.com/api/v1/oem/common/counsel',
url: '/channelSite/domain/info',
// url: '//192.168.26.179:6601/api/v1/oem/common/counsel',
// url: '//newsys.jxhh.com/api/v1/oem/common/counsel',
method: 'get',
params
method: 'post',
data
})
}
......@@ -44,19 +44,19 @@ export function getallCloudList(params) {
//获取sso域名
export function getssoUrl(data) {
return request({
url: '//sysapi.jxhh.com/api/v1/oem/webSite/ssoChannel',
url: '/channelSite/domain/info',
// url: '//192.168.26.179:6601/api/v1/oem/webSite/ssoChannel',
// url: '//newsys.jxhh.com/api/v1/oem/webSite/ssoChannel',
method: 'get',
params: data
method: 'post',
data
})
}
// 获取logo
export function backDetailsView(params) {
export function backDetailsView(data) {
return request({
url: '/local/oem/backDetails',
method: 'get',
params
url: '/system/channelSite/info',
method: 'post',
data
})
}
......@@ -91,6 +91,9 @@ export default {
value: val
})
}
},
channelInfo() {
return this.$store.getters.channelInfo
}
},
data(){
......@@ -101,21 +104,30 @@ export default {
},
created() {
/** 获取渠道id */
this.getChannelId()
// this.getChannelId()
},
methods: {
/** 判断渠道 值=0才显示 查看历史数据 链接 */
getChannelId() {
let ssa = window.location.host
const data = {
domain: ssa,
watch: {
channelInfo() {
if (this.channelInfo) {
this.channel_id = this.$store.state.user.channelInfo.channel_id
}
indexInfo(data).then(res=> {
if (res.code == 1) {
this.channel_id = res.data.channel_id
}
});
},
},
methods: {
/** 判断渠道 值=0才显示 查看历史数据 链接 */
// getChannelId() {
// let ssa = window.location.host
// const data = {
// type: 2,
// site_type: 4,
// // domain: ssa,
// }
// indexInfo(data).then(res=> {
// if (res.code == 1) {
// this.channel_id = res.data.channel.id
// }
// });
// },
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
......@@ -123,11 +135,13 @@ export default {
ssooutinfo(){
var ssa = window.location.host
let data={
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl',data).then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.logout()
}
})
......
......@@ -30,25 +30,49 @@ export default {
},
data() {
return {
title: '云仓',
title: '',
logo: logoImg
}
},
computed: {
},
watch: {
},
created() {
// const data = {
// type: 2,
// site_type: 4
// }
// this.$store.dispatch('getChannelSiteInfo', data).then(res=>{
this.getlog()
// })
},
mounted() {
this.getBackDetailsView()
},
methods: {
getBackDetailsView() {
let params = {
type: 'SHOP',
}
backDetailsView(params).then(res => {
if (res.code == 1) {
this.title = res.data[0]['SHOP'].shop_name
this.logo = res.data[0]['SHOP'].shop_logo
}
})
getlog(){
let logotitle = this.$store.state.user.channelInfo
this.title = logotitle.title
this.logo = logotitle.imgUrl
// document.title = logotitle.documentTitle
}
// getBackDetailsView() {
// let params = {
// type: 2,
// site_type: 4
// }
// backDetailsView(params).then(res => {
// if (res.code == 1) {
// this.title = res.data.channel_site[0].base_setting_res.name
// this.logo = res.data.channel_site[0].base_setting_res.logo
// document.title = res.data.channel_site[0].base_setting_res.title
// }
// })
// }
}
}
</script>
......
......@@ -49,6 +49,13 @@ export default {
}
}
},
mounted() {
// const data = {
// type: 2,
// site_type: 4
// }
// this.$store.dispatch('getChannelSiteInfo', data)
},
methods: {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
......
......@@ -16,20 +16,25 @@ router.beforeEach((to, from, next) => {
const hasToken = getToken()
// console.log("getToken()",getToken())
if (hasToken) {
if (sessionStorage.getItem('saveTitle')) {
document.title = sessionStorage.getItem('saveTitle')
} else {
getPageTitle()
}
// if (sessionStorage.getItem('saveTitle')) {
// document.title = sessionStorage.getItem('saveTitle')
// } else {
// getPageTitle()
// }
/* has token*/
if (to.path === '/platformlogin') {
next({ path: '/home/index' })
next({ path: '/index' })
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
//debugger
// 判断当前用户是否已拉取完user_info信息
const data = {
type: 2,
site_type: 4
}
store.dispatch('getChannelSiteInfo', data)
store.dispatch('GetInfo').then(res => {
// 拉取user_info
const roles = res.data.roles
......@@ -56,7 +61,7 @@ router.beforeEach((to, from, next) => {
}).catch(err => {
store.dispatch('FedLogOut').then(() => {
Message.error(err)
next({ path: '/home/index' })
next({ path: '/index' })
})
})
} else {
......
......@@ -82,11 +82,11 @@ export const constantRoutes = [
component: () => import('@/views/returnurl'),
hidden: true
},
{
path: '/',
component: (resolve) => require(['@/views/entry/newyuncang'], resolve),
hidden: true
},
// {
// path: '/',
// component: (resolve) => require(['@/views/entry/newyuncang'], resolve),
// hidden: true
// },
// 总体流程
{
path: '/process',
......@@ -131,7 +131,7 @@ export const constantRoutes = [
hidden: true
},
{
path: '/home',
path: '/',
component: Layout,
redirect: 'index',
children: [
......
module.exports = {
title: '云仓管理系统',
title: '',
/**
* 是否系统布局配置
......
......@@ -10,6 +10,7 @@ const getters = {
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes
permission_routes: state => state.permission.routes,
channelInfo: state => state.user.channelInfo
}
export default getters
import { login, login2,logout, getInfo, getStatistics } from '@/api/login'
import { getssoUrl } from '@/api/webSite'
import { getssoUrl, backDetailsView } from '@/api/webSite'
import { getToken, setToken, removeToken } from '@/utils/auth'
const user = {
......@@ -18,9 +18,18 @@ const user = {
// 3-审核拒绝;
applyState: -1,
cateFee: 0,
channelInfo: {
title:'',
imgUrl:'',
documentTitle: '',
channel_id:''
}
},
mutations: {
SET_CHANNELINFO: (state, channelInfo) => {
state.channelInfo = channelInfo
},
SET_SSOURL:(state,ssourl)=>{
state.ssourl = ssourl
},
......@@ -51,13 +60,32 @@ const user = {
},
actions: {
getChannelSiteInfo({commit}, data) {
return new Promise((resolve, reject) => {
backDetailsView(data).then(response => {
if (response.code == 1) {
let date = {
title: response.data.channel_site[0].base_setting_res.name,
imgUrl: response.data.channel_site[0].base_setting_res.logo,
documentTitle: response.data.channel_site[0].base_setting_res.title,
channel_id:response.data.channel_site[0].channel_id
}
document.title = response.data.channel_site[0].base_setting_res.title
commit('SET_CHANNELINFO', date)
resolve(response)
}
}).catch(error => {
reject(error)
})
})
},
getssourl({commit},data){
return new Promise((resolve, reject) => {
getssoUrl(data).then(response => {
const date = response.data
const date = response.data.channel_site[0]
//debugger
if (response.code == 1) {
commit('SET_SSOURL', date.access_token)
commit('SET_SSOURL', date.domain)
}
resolve(response)
}).catch(error => {
......@@ -114,6 +142,35 @@ const user = {
commit('SET_SELLERID', user.SellerId)
commit('SET_APPLYSTATE', user.state) // 记录 商户入驻后的审核状态
commit('SET_AVATAR', avatar)
let data = {
domain: window.location.host,
type: 2,
site_type: 4
}
backDetailsView(data).then(response => {
if (response.code == 1) {
let channel_id = response.data.channel.id
if (channel_id == 0) {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon';
link.rel = 'icon';
link.href = '/icon.ico'
document.getElementsByTagName('head')[0].appendChild(link);
} else {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-inon';
link.rel = 'icon';
link.href = '/favicon.ico'
document.getElementsByTagName('head')[0].appendChild(link);
}
// document.title = response.data.channel_site[0].title
}
})
resolve(res)
}).catch(error => {
reject(error)
......
import defaultSettings from '@/settings'
import { getBaseSettingTitle } from '@/api/system/user'
const title = defaultSettings.title || '胜天半子'
\ No newline at end of file
export default function getPageTitle() {
getBaseSettingTitle({ type: 'SHOP' }).then(res => {
if (res.code == 1) {
document.title = res.data
sessionStorage.setItem('saveTitle', res.data)
}
})
}
\ No newline at end of file
......@@ -31,7 +31,7 @@
<swiper :options="swiperOption" v-if="bannerList && bannerList.length > 0">
<swiper-slide v-for="(item,index) in bannerList" :key="index">
<a :href="aLinkRes(item.redirect_url) " :target="returnBlank(item.redirect_url)">
<img style="width: 100%;height: 562px;" :src="item.image_url" alt="">
<img style="width: 100%;height: 562px;" :src="item.img_url" alt="">
</a>
</swiper-slide>
</swiper>
......@@ -242,7 +242,7 @@
<swiper class="mb-banner-con mobile-content" :options="swiperOption" v-if="bannerList && bannerList.length > 0">
<swiper-slide v-for="(item,index) in bannerList" :key="index">
<a :href="aLinkRes(item.redirect_url) " :target="returnBlank(item.redirect_url)">
<img :src="item.image_url" alt="">
<img :src="item.img_url" alt="">
</a>
</swiper-slide>
</swiper>
......@@ -613,7 +613,7 @@
// console.log(222,navigator.userAgent);
},
mounted() {
this.getIndexInfo()
// this.getIndexInfo()
window.addEventListener('scroll', this.handleScroll, true);
},
destroyed() {
......@@ -624,11 +624,23 @@
/** 动态获取 sso 配置域名 */
getssourl() {
var ssa = window.location.host
let data = {domain: ssa}
let data = {
type: 2,
site_type: 7,
domain: ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if (res.code == 1) {
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.channel_id = res.data.channel_site[0].channel_id
this.keyTitle = res.data.channel_site[0].title;
this.keyWords = res.data.channel_site[0].keywords;
this.keyDescriptions = res.data.channel_site[0].describe;
this.getWebSite()
this.getDomain()
this.getAllcloud()
//this.gotosso()
}
}).catch(() => {
......@@ -651,15 +663,17 @@
}
const data = {
// domain: 'newsys.jxhh.com',
domain: ssa,
type: 2,
site_type: 4,
// domain: ssa,
// field: op
}
indexInfo(data).then(res => {
if (res.code == 1) {
this.channel_id = res.data.channel_id
this.keyTitle = res.data.title;
this.keyWords = res.data.keywords;
this.keyDescriptions = res.data.describe;
this.channel_id = res.data.channel_site[0].channel_id
this.keyTitle = res.data.channel_site[0].title;
this.keyWords = res.data.channel_site[0].keywords;
this.keyDescriptions = res.data.channel_site[0].describe;
this.getWebSite()
this.getDomain()
this.getAllcloud()
......@@ -669,7 +683,9 @@
/** 获取通用设置 */
getWebSite() {
let params = {
channel_ids: this.channel_id
domain: window.location.host,
type: 2,
site_type: 4
}
webSite(params).then(res => {
if (res.code == 1) {
......@@ -708,7 +724,7 @@
if (res.data.cloud_banner_lst && res.data.cloud_banner_lst.banners_json && res.data.cloud_banner_lst.banners_json.length > 0) {
let bannerArr = []
res.data.cloud_banner_lst.banners_json.forEach(element => {
if (element.image_url) {
if (element.img_url) {
bannerArr.push(element);
}
});
......
......@@ -50,25 +50,31 @@
let op = 'open'
let ssa = window.location.host
const data = {
domain: ssa,
type: 2,
site_type: 4,
// domain: ssa,
}
indexInfo(data).then(res => {
if (res.code == 1) {
this.channel_id = res.data.channel_id
this.getWebSite()
this.channel_id = res.data.channel.id
this.settitle.topLogo = res.data.channel_site[0].logo
// this.getWebSite()
}
})
},
/** 获取通用设置 */
getWebSite() {
let params = {
channel_ids: this.channel_id
domain: window.location.host,
type: 2,
site_type: 4
}
webSite(params).then(res => {
if (res.code == 1) {
if (res.data.universal_lst && res.data.universal_lst != 'null') {
this.settitle = res.data.universal_lst
}
// if (res.data.universal_lst && res.data.universal_lst != 'null') {
// this.settitle = res.data.universal_lst
// }
this.settitle.topLogo = res.data.channel_site[0].logo
}
})
},
......
......@@ -45,7 +45,7 @@
getInfo().then(res=> {
if (res.code == 1 && res.data.user) {
if (res.data.user.state == 1) {
this.$router.push({path: '/home/index'});
this.$router.push({path: '/index'});
}
if (res.data.user.state == 2) {
this.$router.push({path: '/reviewing'})
......
......@@ -39,7 +39,7 @@
getInfo().then(res=> {
if (res.code == 1 && res.data.user) {
if (res.data.user.state == 1) {
this.$router.push({path: '/home/index'});
this.$router.push({path: '/index'});
}
if (res.data.user.state == 2) {
this.$router.push({path: '/reviewing'})
......
......@@ -45,12 +45,14 @@ export default {
var ssa = window.location.host
// var ssa = 'scm.jxhh.com'
let data = {
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.tiaozuan()
}
})
......
......@@ -20,12 +20,14 @@
var ssa = window.location.host
// var ssa = 'scm.jxhh.com'
let data = {
type: 2,
site_type: 7,
domain:ssa
}
this.$store.dispatch('getssourl', data)
.then((res) => {
if(res.code==1){
this.ssourl = res.data.sso_url
this.ssourl = res.data.channel_site[0].domain
this.gotosso()
}
})
......@@ -53,7 +55,7 @@
}
break;
case 1: // 审核成功,要跳转到首页
this.$router.push({path: '/home/index'});
this.$router.push({path: '/index'});
break;
case 2: // 审核中
this.$router.push({path: '/reviewing'});
......
......@@ -410,11 +410,13 @@
getChannelId() {
let ssa = window.location.host
const data = {
domain: ssa,
type: 2,
site_type: 4,
// domain: ssa,
}
indexInfo(data).then(res=> {
if (res.code == 1) {
this.channel_id = res.data.channel_id
this.channel_id = res.data.channel.id
}
});
},
......
......@@ -6,9 +6,9 @@ function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || '云仓' // 标题
const name = defaultSettings.title || '' // 标题
const port = process.env.port || process.env.npm_config_port || 8080 // 端口
const port = process.env.port || process.env.npm_config_port || 9600 // 端口
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论