Commit 637ef1cb authored by 黄奎's avatar 黄奎

新增js验证文件和方法

parent 7bb9af01
/**
* Created by Administrator on 2018/7/17.
*/
var AuthCode = {
};
export default googleMap;
\ No newline at end of file
......@@ -26,6 +26,7 @@ import chartsUtils from './assets/utils/chartsUtils' //图标工具类
import calendarUtils from './assets/utils/calendarUtils' //日历帮助类
import lunarCalendar from './assets/utils/lunarCalendar' //农历日历帮助类
import googleMap from './assets/utils/googleMap' //引入谷歌地图
import AuthCode from './assets/utils/AuthCode' //权限编码JS
import store from './store'
import languageUtils from './assets/utils/languageUtils' //引入语言转换帮助类
// import htmlToPdf from './assets/utils/htmlToPdf'
......@@ -53,6 +54,7 @@ Vue.languageUtils=Vue.prototype.$languageUtils=languageUtils
Vue.calendarUtils=Vue.prototype.$calendarUtils=calendarUtils
Vue.lunarCalendar=Vue.prototype.$lunarCalendar=lunarCalendar
Vue.googleMap=Vue.prototype.$googleMap=googleMap
Vue.AuthCode=Vue.prototype.$AuthCode=AuthCode
Vue.prototype.$echarts = echarts
Vue.chartsUtils=Vue.prototype.$chartsUtils=chartsUtils
Vue.prototype.$VueBarcode = VueBarcode
......
......@@ -22,6 +22,7 @@ export default {
var sorttype = type || "asc";
var results = [];
var totalSum = {};
function grouporder(source, orders, totalSum) {
source.sort(function (a, b) {
var convertA = a[orders[0]];
......@@ -72,7 +73,6 @@ export default {
return source;
}
},
Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight = itemHeight
try {
......@@ -90,8 +90,7 @@ export default {
yuHeight -= x.offsetHeight ? x.offsetHeight : 0
}
})
} catch (error) {
}
} catch (error) {}
return Math.floor(yuHeight / itemHeight)
}
Vue.prototype.random_string = function (len) {
......@@ -114,13 +113,14 @@ export default {
domainUrl = "http://127.0.0.1:8082";
let locationName = window.location.hostname;
let javaUrldo="";
javaUrldo=locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://efficient.oytour.com" : "http://47.96.12.235:9001") : "http://192.168.2.215:9000";
let javaUrldo = "";
javaUrldo = locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://efficient.oytour.com" : "http://47.96.12.235:9001") : "http://192.168.2.215:9000";
if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com";
}
else if (locationName.indexOf('oytour') !== -1) {
//domainUrl = "http://reborn.oytour.com";
//domainUrl = "http://127.0.0.1"
} else if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com";
}
var obj = {
......@@ -230,7 +230,7 @@ export default {
//HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('clientConfirm') === -1 && this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1&& this.$route.name.indexOf('TravelContractConfirm') === -1) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('clientConfirm') === -1 && this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 && this.$route.name.indexOf('TravelContractConfirm') === -1) {
let previousPathInfo = {
path: this.$route.name,
......@@ -253,15 +253,24 @@ export default {
this.$router.push({
path: '/signature'
})
} else if (this.$route.path == "/clientConfirm") {
let TCID = this.$route.query.TCID;
let orderID = this.$route.query.orderID;
this.$router.push({
name: "clientConfirm",
query: {
TCID: TCID,
orderID: orderID
}
else if (this.$route.path == "/clientConfirm") {
let TCID=this.$route.query.TCID;
let orderID=this.$route.query.orderID;
this.$router.push({ name: "clientConfirm",query: {TCID:TCID,orderID:orderID}})
})
} else if (this.$route.path == "/TravelContractConfirm") {
let ContractId = this.$route.query.ContractId;
this.$router.push({
name: "TravelContractConfirm",
query: {
ContractId: ContractId
}
else if (this.$route.path == "/TravelContractConfirm") {
let ContractId=this.$route.query.ContractId;
this.$router.push({ name: "TravelContractConfirm",query: {ContractId:ContractId}})
})
} else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({
......@@ -277,12 +286,12 @@ export default {
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage=0;
if(localStorage.language && localStorage.language!=''){
if(localStorage.language=="zh-TW"){
tempLanguage=1;
}else if(localStorage.language=="Japanese"){
tempLanguage=2;
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var postData = {
......@@ -291,7 +300,7 @@ export default {
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId":tempLanguage
"languageId": tempLanguage
}
this.$http.post(apiurl, postData, {
headers: {
......@@ -312,6 +321,12 @@ export default {
}, faildCall)
},
//用户权限验证
Vue.prototype.CheckUserAuth = function (authCode, successCall, faildCall) {
this.apipost("userauth_get_GetCheckUserAuthService", {
actionMenuCode: authCode
}, successCall, faildCall);
},
//供应商版请求接口方法
Vue.prototype.ApiPost2 = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
......@@ -719,8 +734,8 @@ export default {
bucket: 'vt-im-bucket'
})
let that = this;
let checkpoint=null;
let percentage=0;
let checkpoint = null;
let percentage = 0;
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
......@@ -755,7 +770,7 @@ export default {
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
}).catch(function(reason){
}).catch(function (reason) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
that.MsgBus.$emit('UploadSelfFileErr')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment