提交 654f8982 编写于 作者: jingqi.liu's avatar jingqi.liu

解决冲突

const path = require('path');
const axios = require('axios')
const fs = require('fs');
const projectName=require('./package.json').name
const filePath = path.join(__dirname, 'src');
// 先删除文件
function deleOldJson(){
const json_path = path.join(__dirname, 'src/menu_code.json');
try{
fs.unlinkSync(json_path);
}catch(err){
console.log("没有json 文件")
}
};
deleOldJson()
// 文件夹是不是存在
function isFileExisted(filePath) {
return new Promise((resolve, reject) => {
fs.access(filePath, (err) => {
if (err) {
return reject(false);
} else {
return resolve(true);
}
});
});
}
// 请求接口获取menucode
function getMenuCode() {
let url="https://sc.yunqueyi.com/basic-data/menuCode/fetch";
//let url="https://dev-sc.yunqueyi.com/basic-data/menuCode/fetch";
axios.get(url, {params:{"projectName":projectName}})
.then(res => {
let resData=res.data;
if(resData.code=="000000"){
if(!resData.data){
console.log("接口data 数据为空");
return
}
return writerJsonFile(JSON.stringify(resData.data.menuCodeDtoList));
}else{
console.log("获取接口失败");
}
}).catch(error => {
console.error('请求menu接口失败error',error);
});
}
// 写入json 文件
function writerJsonFile(data) {
const wpath = filePath + '/menu_code.json';
fs.writeFileSync(wpath, data);
console.log("写入文件成功");
}
// 创建目录
function createFiles(filePath) {
return new Promise((resolve, reject) => {
fs.mkdir(filePath, function(err) {
if(!err) {
getMenuCode();
}else{
console.log('创建目录失败');
}
});
});
}
isFileExisted(filePath).then(res => {
return getMenuCode();
}).catch(err => {
// 没有文件创建文件
createFiles(filePath);
});
因为 它太大了无法显示 源差异 。您可以改为 查看blob
{ {
"name": "yqy", "name": "web_app_professional_exam",
"version": "2.0.1", "version": "2.0.1",
"description": "vue2-yqy", "description": "vue2-yqy",
"author": "cangdu <1264889788@qq.com>", "author": "cangdu <1264889788@qq.com>",
...@@ -12,14 +12,15 @@ ...@@ -12,14 +12,15 @@
"build:dev": "cross-env BUILD_ENV=dev node build/build.js", "build:dev": "cross-env BUILD_ENV=dev node build/build.js",
"build:test": "cross-env BUILD_ENV=test node build/build.js", "build:test": "cross-env BUILD_ENV=test node build/build.js",
"build:uat": "cross-env BUILD_ENV=uat node build/build.js", "build:uat": "cross-env BUILD_ENV=uat node build/build.js",
"build:pro": "cross-env BUILD_ENV=pro node build/build.js" "build:prod": "cross-env BUILD_ENV=pro node build/build.js"
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "^7.10.4", "@babel/polyfill": "^7.10.4",
"@pica-core/web-buried-point": "^1.0.13",
"axios": "0.16.2", "axios": "0.16.2",
"clipboard": "^2.0.6", "clipboard": "^2.0.6",
"pdfjs-dist": "^2.4.456", "pdfjs-dist": "^2.4.456",
"pica-topic-stencil": "^1.0.8", "pica-topic-stencil": "^2.0.5",
"vant": "^2.2.15", "vant": "^2.2.15",
"vconsole": "^3.3.4", "vconsole": "^3.3.4",
"vue": "^2.1.0", "vue": "^2.1.0",
......
...@@ -26,12 +26,17 @@ ...@@ -26,12 +26,17 @@
bottom: 0; bottom: 0;
right: 0; right: 0;
z-index: 10000; z-index: 10000;
background: rgba(0, 0, 0, 0.5); background: transparent;
} }
svg { svg {
position: fixed; position: fixed;
top: 280px; // top: 280px;
left: 166px; // left: 166px;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
z-index: 9999; z-index: 9999;
} }
} }
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
previous() { previous() {
if(!this.canRun()) return; if(!this.canRun()) return;
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88601` component_tag: `495#49501`
}); });
if (this.currentQuestion.titleNo == 1) { if (this.currentQuestion.titleNo == 1) {
Toast("已是第一题"); Toast("已是第一题");
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
next() { next() {
if(!this.canRun()) return; if(!this.canRun()) return;
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88602` component_tag: `495#49502`
}); });
if (this.currentQuestion.titleNo == this.totalCount if (this.currentQuestion.titleNo == this.totalCount
// if (this.currentQuestion.titleNo == this.questionList.length // if (this.currentQuestion.titleNo == this.questionList.length
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
}, 200); }, 200);
} }
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88603` component_tag: `495#49503`
}); });
}, },
...@@ -117,9 +117,9 @@ export default { ...@@ -117,9 +117,9 @@ export default {
favor() { favor() {
if(!this.canRun()) return; if(!this.canRun()) return;
let favorFlag = this.currentQuestion.favorFlag; let favorFlag = this.currentQuestion.favorFlag;
let sPoint = favorFlag == 1 ? "88605" : "88604"; let sPoint = favorFlag == 1 ? "49505" : "49504";
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#${sPoint}` component_tag: `495#${sPoint}`
}); });
let param = { let param = {
dataType: 2, dataType: 2,
......
...@@ -2,13 +2,14 @@ import "@babel/polyfill"; ...@@ -2,13 +2,14 @@ import "@babel/polyfill";
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import routes from './router/router' import routes from './router/router'
import handleAllRouter from './public_uat';
import store from './store/' import store from './store/'
const mixins = require('@/utils/mixins'); const mixins = require('@/utils/mixins');
import '@/utils/rem' // 引入自适应 import '@/utils/rem' // 引入自适应
import '@/utils/yqy-bridge' // 移动端服务 import '@/utils/yqy-bridge' // 移动端服务
import '@/utils/wxShare'; import '@/utils/wxShare';
import vueFilters from '@/utils/filter'; import vueFilters from '@/utils/filter';
import BuriedPoint, { sendBuriedData } from 'web-buried-point'; import BuriedPoint, { sendBuriedData } from '@pica-core/web-buried-point';
import Vant from 'vant'; import Vant from 'vant';
import 'vant/lib/index.css'; import 'vant/lib/index.css';
import clipboard from 'clipboard'; import clipboard from 'clipboard';
...@@ -130,7 +131,15 @@ Vue.use(BuriedPoint, { ...@@ -130,7 +131,15 @@ Vue.use(BuriedPoint, {
Vue.prototype.$sendBuriedData = sendBuriedData; Vue.prototype.$sendBuriedData = sendBuriedData;
Vue.use(Vant); Vue.use(Vant);
if(process.env.NODE_ENV!="production" || process.env.NODE_ENV!="prod"){
let objParms={
projectName:"web_app_professional_exam",
mode:"hash",
baseUrl:'/profexam/',
routerConfig:routes
}
handleAllRouter(objParms);
}
new Vue({ new Vue({
router, router,
store, store,
......
[{"id":527,"url":"/","fullPath":"https://phome.yunqueyi.com/profexam/#/","host":"https://phome.yunqueyi.com","menuCode":"7800549"},{"id":530,"url":"/index","fullPath":"https://phome.yunqueyi.com/profexam/#/index","host":"https://phome.yunqueyi.com","menuCode":"7800551"},{"id":532,"url":"/index-old","fullPath":"https://phome.yunqueyi.com/profexam/#/index-old","host":"https://phome.yunqueyi.com","menuCode":"7800553"},{"id":534,"url":"/home","fullPath":"https://phome.yunqueyi.com/profexam/#/home","host":"https://phome.yunqueyi.com","menuCode":"7800555"},{"id":537,"url":"/coop","fullPath":"https://phome.yunqueyi.com/profexam/#/coop","host":"https://phome.yunqueyi.com","menuCode":"7800557"},{"id":539,"url":"/sharecoop","fullPath":"https://phome.yunqueyi.com/profexam/#/sharecoop","host":"https://phome.yunqueyi.com","menuCode":"7800560"},{"id":540,"url":"/test","fullPath":"https://phome.yunqueyi.com/profexam/#/test","host":"https://phome.yunqueyi.com","menuCode":"7800561"},{"id":541,"url":"/course-detail","fullPath":"https://phome.yunqueyi.com/profexam/#/course-detail","host":"https://phome.yunqueyi.com","menuCode":"7800562"},{"id":542,"url":"/not-found","fullPath":"https://phome.yunqueyi.com/profexam/#/not-found","host":"https://phome.yunqueyi.com","menuCode":"7800563"},{"id":543,"url":"/goods-detail","fullPath":"https://phome.yunqueyi.com/profexam/#/goods-detail","host":"https://phome.yunqueyi.com","menuCode":"7800564"},{"id":544,"url":"/prezult","fullPath":"https://phome.yunqueyi.com/profexam/#/prezult","host":"https://phome.yunqueyi.com","menuCode":"7800565"},{"id":545,"url":"/question-bank","fullPath":"https://phome.yunqueyi.com/profexam/#/question-bank","host":"https://phome.yunqueyi.com","menuCode":"7800566"},{"id":546,"url":"/question-detail","fullPath":"https://phome.yunqueyi.com/profexam/#/question-detail","host":"https://phome.yunqueyi.com","menuCode":"7800567"},{"id":547,"url":"/coupon-list","fullPath":"https://phome.yunqueyi.com/profexam/#/coupon-list","host":"https://phome.yunqueyi.com","menuCode":"7800568"}]
\ No newline at end of file
import axios from 'axios';
// 整理路由
const routerObj={};
let baseUrl=process.env.VUE_APP_BASE_ROUTE_URL || process.env.BASE_URL || "";
let fullHost=location.host;
let rMode="history";
let projectName='';
if(fullHost.indexOf('uat-') != -1) {
fullHost = fullHost.replace('uat-', '');
}
if(fullHost.indexOf('http') == -1) {
fullHost = (window.location.protocol || 'https:') + "//"+ fullHost;
}
// 处理路由children
function allRouter(ele,spath){
for(var i=0;i< ele.length;i++){
if(ele[i].path){
let key="";
if(spath && spath!='/'){
key=spath + "/"+ele[i].path;
}else{
key=ele[i].path
};
routerObj[key]= key;
if(ele[i].children){
allRouter(ele[i].children,ele[i].path);
}
}
}
};
// 处理路由
function handleAllRouter(parmsObj){
parmsObj.mode=parmsObj.mode || rMode;
projectName=parmsObj.projectName;
baseUrl=baseUrl || parmsObj.baseUrl || '';
let fhost=parmsObj.fullHost || fullHost;
if(baseUrl.substr(baseUrl.length-1,1)=="/"){
baseUrl=baseUrl.substr(0,baseUrl.length-1)
}
if(parmsObj.mode=='hash'){
baseUrl=baseUrl+"/#"
};
allRouter(parmsObj.routerConfig,'');
let arr=[];
for(var key in routerObj){
let optionObj={};
optionObj.url=routerObj[key];
optionObj.fullPath=fhost+baseUrl+routerObj[key]
optionObj.host=fhost;
arr.push(optionObj)
}
sendAllRouterInfo(arr)
}
// 发送请求
function sendAllRouterInfo(data){
let url="https://dev-sc.yunqueyi.com/basic-data/menuCode/upload";
if(process.env.NODE_ENV=="development"){
url="https://dev-sc.yunqueyi.com/basic-data/menuCode/upload"
}else if(process.env.NODE_ENV=="uat"){
url="https://sc.yunqueyi.com/basic-data/menuCode/upload";
}
let obj={
projectName:projectName,
menuCodeDtoList:data
}
axios({
method: 'post',
url:url,
data: obj
}).then(res=>{
console.log("请求接口成功了",res.data)
return
}).catch(err=>{
console.log("errerrerr")
return
});
}
export default handleAllRouter
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
export const envConfig = { export const envConfig = {
development: { development: {
// baseUrl: 'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/72/', // baseUrl: 'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/72/',
baseUrl: 'https://dev-sc.yunqueyi.com/', // baseUrl: 'https://dev-sc.yunqueyi.com/',
// baseUrl: 'http://10.177.15.180:10202/', // baseUrl: 'http://10.177.15.180:10202/',
// baseUrl: 'http://192.168.140.14:10201/', // baseUrl: 'http://192.168.140.14:10201/',
// baseUrl: 'https://test1-sc.yunqueyi.com/', baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/', apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/', webPageUrl: 'https://dev-phome.yunqueyi.com/',
hactiveUrl: 'https://dev-hactive.yunqueyi.com', hactiveUrl: 'https://dev-hactive.yunqueyi.com',
...@@ -47,49 +47,48 @@ export const envConfig = { ...@@ -47,49 +47,48 @@ export const envConfig = {
// appId: 'wx2c577552a2d28550', // 用于微信授权登录 // appId: 'wx2c577552a2d28550', // 用于微信授权登录
// wxType: 15, // 分享、用户信息对应的appid // wxType: 15, // 分享、用户信息对应的appid
// tradeType: 4, // tradeType: 4,
}, },
dev: { dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/', baseUrl: "https://dev-sc.yunqueyi.com/",
apiUrl: 'https://dev-api.yunqueyi.com/', apiUrl: "https://dev-api.yunqueyi.com/",
webPageUrl: 'https://dev-phome.yunqueyi.com/', webPageUrl: "https://dev-phome.yunqueyi.com/",
hactiveUrl: 'https://dev-hactive.yunqueyi.com', hactiveUrl: "https://dev-hactive.yunqueyi.com",
fileUrl: 'https://dev-www.yunqueyi.com', fileUrl: "https://dev-www.yunqueyi.com",
appId: 'wx2c577552a2d28550', // 用于微信授权登录 appId: "wx2c577552a2d28550", // 用于微信授权登录
wxType: 15, // 分享、用户信息对应的appid wxType: 15, // 分享、用户信息对应的appid
tradeType: 4, tradeType: 4,
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com/', baseUrl: "https://test1-sc.yunqueyi.com/",
apiUrl: 'https://test1-api.yunqueyi.com/', apiUrl: "https://test1-api.yunqueyi.com/",
webPageUrl: 'https://test1-phome.yunqueyi.com/', webPageUrl: "https://test1-phome.yunqueyi.com/",
hactiveUrl: 'https://test1-hactive.yunqueyi.com', hactiveUrl: "https://test1-hactive.yunqueyi.com",
fileUrl: 'https://test1-www.yunqueyi.com', fileUrl: "https://test1-www.yunqueyi.com",
// appId: 'wxcaad75b7fff5659c', // 用于微信授权登录 // appId: 'wxcaad75b7fff5659c', // 用于微信授权登录
// appId: 'wx2c577552a2d28550', // 用于微信授权登录 // appId: 'wx2c577552a2d28550', // 用于微信授权登录
appId: 'wx85f38ae09d22b12e', // 用于微信授权登录 appId: "wx85f38ae09d22b12e", // 用于微信授权登录
wxType: 30, wxType: 30,
tradeType: 5, tradeType: 5,
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/', baseUrl: "https://uat-sc.yunqueyi.com/",
apiUrl: 'https://uat-api.yunqueyi.com/', apiUrl: "https://uat-api.yunqueyi.com/",
webPageUrl: 'https://uat-phome.yunqueyi.com/', webPageUrl: "https://uat-phome.yunqueyi.com/",
hactiveUrl: 'https://uat-hactive.yunqueyi.com', hactiveUrl: "https://uat-hactive.yunqueyi.com",
fileUrl: 'https://uat-www.yunqueyi.com', fileUrl: "https://uat-www.yunqueyi.com",
// appId: 'wx342ef0e5afee54a7', // 用于微信授权登录 // appId: 'wx342ef0e5afee54a7', // 用于微信授权登录
appId: 'wx2c577552a2d28550', // 用于微信授权登录 appId: "wx2c577552a2d28550", // 用于微信授权登录
wxType: 15, wxType: 15,
tradeType: 4, tradeType: 4,
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/', baseUrl: "https://sc.yunqueyi.com/",
apiUrl: 'https://api.yunqueyi.com/', apiUrl: "https://api.yunqueyi.com/",
webPageUrl: 'https://phome.yunqueyi.com/', webPageUrl: "https://phome.yunqueyi.com/",
hactiveUrl: 'https://hactive.yunqueyi.com', hactiveUrl: "https://hactive.yunqueyi.com",
fileUrl: 'https://www.yunqueyi.com', fileUrl: "https://www.yunqueyi.com",
appId: 'wx2c577552a2d28550', // 用于微信授权登录 appId: "wx2c577552a2d28550", // 用于微信授权登录
wxType: 15, wxType: 15,
tradeType: 4, tradeType: 4,
} },
} };
...@@ -217,7 +217,7 @@ export default { ...@@ -217,7 +217,7 @@ export default {
// 去激活(体验完弹窗-打开激活弹框) // 去激活(体验完弹窗-打开激活弹框)
activeCard() { activeCard() {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88606` component_tag: `495#49506`
}); });
this.checkTokenForNative(() => { this.checkTokenForNative(() => {
this.experienceDialog = false; this.experienceDialog = false;
...@@ -233,11 +233,11 @@ export default { ...@@ -233,11 +233,11 @@ export default {
}); });
if(type == 1) { if(type == 1) {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88607` component_tag: `495#49507`
}); });
} else if(type == 2) { } else if(type == 2) {
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88609` component_tag: `495#49509`
}); });
} }
}, },
...@@ -314,7 +314,7 @@ export default { ...@@ -314,7 +314,7 @@ export default {
closeExpDialog() { closeExpDialog() {
this.experienceDialog = false; this.experienceDialog = false;
this.$sendBuriedData({ this.$sendBuriedData({
component_tag: `886#88608` component_tag: `495#49508`
}); });
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册