修改高德地图key更新此commit 之前请务必确认一下创建的高德key日期。修改部分方法名称
							parent
							
								
									32dffe96ed
								
							
						
					
					
						commit
						1b4c05f70b
					
				|  | @ -1,40 +1,39 @@ | |||
| <template> | ||||
|   <div id="app"> | ||||
|     <router-view/> | ||||
|     <router-view /> | ||||
|   </div> | ||||
| </template> | ||||
| 
 | ||||
| <script> | ||||
| 
 | ||||
| import storage from '@/plugins/storage'; | ||||
| import { getLogoImg} from '@/api/common.js'; | ||||
| import storage from "@/plugins/storage"; | ||||
| import { getBaseSite } from "@/api/common.js"; | ||||
| export default { | ||||
|   name: 'App', | ||||
|   name: "App", | ||||
| 
 | ||||
|   mounted(){ | ||||
|     //获取LOGO图片 | ||||
|       getLogoImg().then(res => { | ||||
|          if(res.success&&res.result.settingValue){ | ||||
|           let data = JSON.parse(res.result.settingValue); | ||||
|           this.$store.commit("SET_LOGOIMG", data.buyerSideLogo); | ||||
|           this.$store.commit("SET_SITENAME", data.siteName); | ||||
|           storage.setItem("siteName", data.siteName); | ||||
|           window.document.title = data.siteName; | ||||
|            //动态获取icon | ||||
|           let link = | ||||
|             document.querySelector("link[rel*='icon']") || | ||||
|             document.createElement("link"); | ||||
|           link.type = "image/x-icon"; | ||||
|           link.href = data.buyerSideLogo; | ||||
|           link.rel = "shortcut icon"; | ||||
|           document.getElementsByTagName("head")[0].appendChild(link); | ||||
|         } | ||||
|       }) | ||||
|   } | ||||
|   mounted() { | ||||
|     //获取基本站点信息 | ||||
|     getBaseSite().then((res) => { | ||||
|       if (res.success && res.result.settingValue) { | ||||
|         let data = JSON.parse(res.result.settingValue); | ||||
|         this.$store.commit("SET_LOGOIMG", data.buyerSideLogo); | ||||
|         this.$store.commit("SET_SITENAME", data.siteName); | ||||
|         storage.setItem("siteName", data.siteName); | ||||
|         window.document.title = data.siteName; | ||||
|         //动态获取icon | ||||
|         let link = | ||||
|           document.querySelector("link[rel*='icon']") || | ||||
|           document.createElement("link"); | ||||
|         link.type = "image/x-icon"; | ||||
|         link.href = data.buyerSideLogo; | ||||
|         link.rel = "shortcut icon"; | ||||
|         document.getElementsByTagName("head")[0].appendChild(link); | ||||
|       } | ||||
|     }); | ||||
|   }, | ||||
| }; | ||||
| </script> | ||||
| <style lang="scss"> | ||||
| #app{ | ||||
| #app { | ||||
|   @include background_color($light_background_color); | ||||
| } | ||||
| </style> | ||||
|  |  | |||
|  | @ -32,16 +32,7 @@ export function sendSms (params) { | |||
|     params | ||||
|   }); | ||||
| } | ||||
| /** | ||||
|  * 获取logo图标 | ||||
|  */ | ||||
| export function getLogo () { | ||||
|   return request({ | ||||
|     url: `${commonUrl}/common/logo`, | ||||
|     method: Method.GET, | ||||
|     needToken: false | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| // 地区数据,用于三级联动
 | ||||
| export function getRegion (id) { | ||||
|   return request({ | ||||
|  | @ -95,9 +86,9 @@ export function getIMDetail () { | |||
| 
 | ||||
| 
 | ||||
| //获取图片logo
 | ||||
| export function getLogoImg(){ | ||||
| export function getBaseSite(){ | ||||
|   return request ({ | ||||
|     url:`${commonUrl}/common/common/logo`, | ||||
|     url:`${commonUrl}/common/common/site`, | ||||
|     method: Method.GET, | ||||
|     needToken: false | ||||
|   }) | ||||
|  |  | |||
|  | @ -12,14 +12,10 @@ module.exports = { | |||
|    * 高德地图申请链接 | ||||
|    * https://lbs.amap.com/api/javascript-api/guide/abc/prepare
 | ||||
|    * 添加成功后,可获取到key值和安全密钥jscode(自2021年12月02日升级,升级之后所申请的 key 必须配备安全密钥 jscode 一起使用) | ||||
|    * 如果是2021年12月02日之后的需要在main.js中添加如下代码 | ||||
|    * window._AMapSecurityConfig = { | ||||
|    *   securityJsCode:'您申请的安全密钥', | ||||
|    * } | ||||
|    * | ||||
|    * 如果2021年12月02日之前申请的无视上面代码 | ||||
|    */ | ||||
|   aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
 | ||||
|   //FIXME 请检查当前高德key创建的日期,如果2021年12月02日之前申请的 无需填写安全密钥
 | ||||
|   aMapSecurityJsCode:"2bd0fbf621881f4c77be74f0e76495f3", // 高德web端js申请的安全密钥
 | ||||
|   aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key
 | ||||
|   enableCDN: true, //生产环境 是否启用cdn加载 vue等js
 | ||||
|   port: 10000, //端口
 | ||||
| }; | ||||
|  |  | |||
|  | @ -1,54 +1,65 @@ | |||
| import Vue from 'vue'; | ||||
| import App from './App'; | ||||
| import router from './router'; | ||||
| import ViewUI from 'view-design'; | ||||
| import './assets/styles/theme.less'; | ||||
| import Vue from "vue"; | ||||
| import App from "./App"; | ||||
| import router from "./router"; | ||||
| import ViewUI from "view-design"; | ||||
| import "./assets/styles/theme.less"; | ||||
| // import './assets/iconfont/iconfont.css';
 | ||||
| import * as filters from './plugins/filters'; | ||||
| import store from '@/vuex/store' | ||||
| import storage from '@/plugins/storage'; | ||||
| import * as filters from "./plugins/filters"; | ||||
| import store from "@/vuex/store"; | ||||
| import storage from "@/plugins/storage"; | ||||
| // 全局引入封装组件
 | ||||
| import {InstallAll} from '@/components/global.js'; | ||||
| import { InstallAll } from "@/components/global.js"; | ||||
| 
 | ||||
| let title = require('@/config').title | ||||
| const { aMapSecurityJsCode, title } = require("@/config"); | ||||
| Vue.use(ViewUI); | ||||
| Vue.use(InstallAll); | ||||
| Vue.config.productionTip = false; | ||||
| 
 | ||||
| Object.keys(filters).forEach(key => { | ||||
| Object.keys(filters).forEach((key) => { | ||||
|   Vue.filter(key, filters[key]); | ||||
| }); | ||||
| 
 | ||||
| // 高德安全密钥
 | ||||
| if (aMapSecurityJsCode) { | ||||
|   window._AMapSecurityConfig = { | ||||
|     securityJsCode: aMapSecurityJsCode, | ||||
|   }; | ||||
| } | ||||
| 
 | ||||
| router.beforeEach((to, from, next) => { | ||||
|   ViewUI.LoadingBar.start(); | ||||
|   window.document.title = to.meta.title === undefined ? title : to.meta.title | ||||
|   window.document.title = to.meta.title === undefined ? title : to.meta.title; | ||||
|   next(); | ||||
| }); | ||||
| 
 | ||||
| router.afterEach(route => { | ||||
| router.afterEach((route) => { | ||||
|   ViewUI.LoadingBar.finish(); | ||||
| }); | ||||
| 
 | ||||
| Vue.prototype.linkTo = function (url) { | ||||
|   if (url.substr(0, 1) === '/') { // 非外部链接,没有origin,只有路由地址
 | ||||
|     if (router.mode === 'hash') { | ||||
|       window.open(location.origin + '/#' + url, '_blank'); | ||||
|   if (url.substr(0, 1) === "/") { | ||||
|     // 非外部链接,没有origin,只有路由地址
 | ||||
|     if (router.mode === "hash") { | ||||
|       window.open(location.origin + "/#" + url, "_blank"); | ||||
|     } else { | ||||
|       window.open(location.origin + url, '_blank'); | ||||
|       window.open(location.origin + url, "_blank"); | ||||
|     } | ||||
|   } else { // 外部链接,完整的url地址
 | ||||
|     window.open(url, '_blank') | ||||
|   } else { | ||||
|     // 外部链接,完整的url地址
 | ||||
|     window.open(url, "_blank"); | ||||
|   } | ||||
| } | ||||
| }; | ||||
| // 联系客服
 | ||||
| Vue.prototype.connectCs = function (sign = '37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca') {  | ||||
|   const url = 'https://yzf.qq.com/xv/web/static/chat/index.html?sign=' + sign | ||||
|   window.open(url, '_blank') | ||||
| } | ||||
| Vue.prototype.Cookies = storage | ||||
| Vue.prototype.connectCs = function ( | ||||
|   sign = "37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca" | ||||
| ) { | ||||
|   const url = "https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + sign; | ||||
|   window.open(url, "_blank"); | ||||
| }; | ||||
| Vue.prototype.Cookies = storage; | ||||
| /* eslint-disable no-new */ | ||||
| new Vue({ | ||||
|   router, | ||||
|   store, | ||||
|   render: h => h(App) | ||||
| }).$mount("#app") | ||||
|   render: (h) => h(App), | ||||
| }).$mount("#app"); | ||||
|  |  | |||
|  | @ -19,12 +19,9 @@ export const getVerifyImg = (verificationEnums) => { | |||
| export const postVerifyImg = (params) => { | ||||
|   return postRequestWithNoToken(`${commonUrl}/common/common/slider/${params.verificationEnums}`, params); | ||||
| }; | ||||
| //获取LOGO
 | ||||
| export const getLogo = ()=>{ | ||||
|   return getRequest (`${commonUrl}/common/common/logo`); | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
| // 获取系统基础信息
 | ||||
| export const getSetsite = () => { | ||||
| export const getBaseSite = () => { | ||||
|   return getRequest(`${commonUrl}/common/common/site`); | ||||
| }; | ||||
| }; | ||||
|  |  | |||
|  | @ -4,14 +4,10 @@ module.exports = { | |||
|    * 高德地图申请链接 | ||||
|    * https://lbs.amap.com/api/javascript-api/guide/abc/prepare
 | ||||
|    * 添加成功后,可获取到key值和安全密钥jscode(自2021年12月02日升级,升级之后所申请的 key 必须配备安全密钥 jscode 一起使用) | ||||
|    * 如果是2021年12月02日之后的需要在main.js中添加如下代码 | ||||
|    * window._AMapSecurityConfig = { | ||||
|    *   securityJsCode:'您申请的安全密钥', | ||||
|    * } | ||||
|    * | ||||
|    * 如果2021年12月02日之前申请的无视上面代码 | ||||
|    */ | ||||
|   aMapKey: "b440952723253aa9fe483e698057bf7d", | ||||
|   //FIXME 请检查当前高德key创建的日期,如果2021年12月02日之前申请的 无需填写安全密钥
 | ||||
|   aMapSecurityJsCode:"2bd0fbf621881f4c77be74f0e76495f3", // 高德web端js申请的安全密钥
 | ||||
|   aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key
 | ||||
|   website: "https://www.pickmall.cn", //官网地址
 | ||||
|   enableCDN: true, //生产环境 是否启用cdn加载 vue等js
 | ||||
|   port: 10003, //端口
 | ||||
|  |  | |||
|  | @ -24,6 +24,14 @@ import {md5} from '@/utils/md5.js'; | |||
| // 打印
 | ||||
| import Print from 'vue-print-nb'; | ||||
| Vue.use(Print); | ||||
| const { aMapSecurityJsCode } = require("@/config"); | ||||
| // 高德安全密钥
 | ||||
| if (aMapSecurityJsCode) { | ||||
|   window._AMapSecurityConfig = { | ||||
|     securityJsCode: aMapSecurityJsCode, | ||||
|   }; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| Vue.config.devtools = true; | ||||
| Vue.config.productionTip = false | ||||
|  |  | |||
|  | @ -84,7 +84,7 @@ import circleLoading from "@/views/my-components/lili/circle-loading.vue"; | |||
| import Cookies from "js-cookie"; | ||||
| import util from "@/libs/util.js"; | ||||
| import { getNoticePage, logout } from "@/api/index"; | ||||
| import { getLogo, getSetsite } from "@/api/common"; | ||||
| import { getBaseSite } from "@/api/common"; | ||||
| 
 | ||||
| var client; | ||||
| export default { | ||||
|  | @ -130,18 +130,15 @@ export default { | |||
|         this.sliceNum = 2; | ||||
|       } | ||||
|       //获取domainLogo | ||||
|       getSetsite().then((res) => { | ||||
|       getBaseSite().then((res) => { | ||||
|         const { domainLogo, siteName } = JSON.parse(res.result.settingValue); | ||||
|         // console.log(data, "ressss"); | ||||
| 
 | ||||
|         //list:res.result.settingValue.join(",") | ||||
|         this.domainLogo = domainLogo; | ||||
|         //动态获取icon | ||||
|         this.setStore("icon", this.domainLogo); | ||||
|         // this.domainLogo = this.domainLogo; | ||||
|         let link = | ||||
|           document.querySelector("link[rel*='icon']") || | ||||
|           document.ceateElement("link"); | ||||
|           document.createElement("link"); | ||||
|         link.type = "image/x-icon"; | ||||
|         link.href = this.domainLogo; | ||||
|         link.rel = "shortcut icon"; | ||||
|  | @ -150,13 +147,7 @@ export default { | |||
|         this.setStore("title", siteName); | ||||
|         window.document.title = siteName + " - 运营后台"; | ||||
|       }), | ||||
|         getLogo().then((res) => { | ||||
|           if (res.success && res.result.settingValue) { | ||||
|             let data = JSON.parse(res.result.settingValue); | ||||
| 
 | ||||
|             console.log(data); | ||||
|           } | ||||
|         }); | ||||
|       // 读取未读消息数 | ||||
|       getNoticePage({}).then((res) => { | ||||
|         if (res.success) { | ||||
|  |  | |||
|  | @ -1,17 +1,13 @@ | |||
| module.exports = { | ||||
|   title: "lilishop", //配置显示在浏览器标签的title
 | ||||
|   /** | ||||
|    /** | ||||
|    * 高德地图申请链接 | ||||
|    * https://lbs.amap.com/api/javascript-api/guide/abc/prepare
 | ||||
|    * 添加成功后,可获取到key值和安全密钥jscode(自2021年12月02日升级,升级之后所申请的 key 必须配备安全密钥 jscode 一起使用) | ||||
|    * 如果是2021年12月02日之后的需要在main.js中添加如下代码 | ||||
|    * window._AMapSecurityConfig = { | ||||
|    *   securityJsCode:'您申请的安全密钥', | ||||
|    * } | ||||
|    * | ||||
|    * 如果2021年12月02日之前申请的无视上面代码 | ||||
|    */ | ||||
|   aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
 | ||||
|   //FIXME 请检查当前高德key创建的日期,如果2021年12月02日之前申请的 无需填写安全密钥
 | ||||
|   aMapSecurityJsCode:"2bd0fbf621881f4c77be74f0e76495f3", // 高德web端js申请的安全密钥
 | ||||
|   aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key
 | ||||
|   website: "https://www.pickmall.cn", //官网地址
 | ||||
|   enableCDN: true, //生产环境 是否启用cdn加载 vue等js
 | ||||
|   port: 10002, //端口
 | ||||
|  |  | |||
|  | @ -27,6 +27,13 @@ import VueLazyload from "vue-lazyload"; | |||
| import * as filters from "@/utils/filters"; // global filter
 | ||||
| 
 | ||||
| import { md5 } from "@/utils/md5.js"; | ||||
| const { aMapSecurityJsCode } = require("@/config"); | ||||
| // 高德安全密钥
 | ||||
| if (aMapSecurityJsCode) { | ||||
|   window._AMapSecurityConfig = { | ||||
|     securityJsCode: aMapSecurityJsCode, | ||||
|   }; | ||||
| } | ||||
| Vue.config.devtools = true; | ||||
| Vue.config.productionTip = false; | ||||
| Vue.use(VueLazyload, { | ||||
|  | @ -84,7 +91,7 @@ new Vue({ | |||
|   mounted() { | ||||
|     // 初始化菜单
 | ||||
|     util.initRouter(this); | ||||
|     | ||||
| 
 | ||||
|     this.currentPageName = this.$route.name; | ||||
|     // 显示打开的页面的列表
 | ||||
|     this.$store.commit("setOpenedList"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue