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' //图标工具类 ...@@ -26,6 +26,7 @@ import chartsUtils from './assets/utils/chartsUtils' //图标工具类
import calendarUtils from './assets/utils/calendarUtils' //日历帮助类 import calendarUtils from './assets/utils/calendarUtils' //日历帮助类
import lunarCalendar from './assets/utils/lunarCalendar' //农历日历帮助类 import lunarCalendar from './assets/utils/lunarCalendar' //农历日历帮助类
import googleMap from './assets/utils/googleMap' //引入谷歌地图 import googleMap from './assets/utils/googleMap' //引入谷歌地图
import AuthCode from './assets/utils/AuthCode' //权限编码JS
import store from './store' import store from './store'
import languageUtils from './assets/utils/languageUtils' //引入语言转换帮助类 import languageUtils from './assets/utils/languageUtils' //引入语言转换帮助类
// import htmlToPdf from './assets/utils/htmlToPdf' // import htmlToPdf from './assets/utils/htmlToPdf'
...@@ -53,6 +54,7 @@ Vue.languageUtils=Vue.prototype.$languageUtils=languageUtils ...@@ -53,6 +54,7 @@ Vue.languageUtils=Vue.prototype.$languageUtils=languageUtils
Vue.calendarUtils=Vue.prototype.$calendarUtils=calendarUtils Vue.calendarUtils=Vue.prototype.$calendarUtils=calendarUtils
Vue.lunarCalendar=Vue.prototype.$lunarCalendar=lunarCalendar Vue.lunarCalendar=Vue.prototype.$lunarCalendar=lunarCalendar
Vue.googleMap=Vue.prototype.$googleMap=googleMap Vue.googleMap=Vue.prototype.$googleMap=googleMap
Vue.AuthCode=Vue.prototype.$AuthCode=AuthCode
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
Vue.chartsUtils=Vue.prototype.$chartsUtils=chartsUtils Vue.chartsUtils=Vue.prototype.$chartsUtils=chartsUtils
Vue.prototype.$VueBarcode = VueBarcode Vue.prototype.$VueBarcode = VueBarcode
......
...@@ -22,6 +22,7 @@ export default { ...@@ -22,6 +22,7 @@ export default {
var sorttype = type || "asc"; var sorttype = type || "asc";
var results = []; var results = [];
var totalSum = {}; var totalSum = {};
function grouporder(source, orders, totalSum) { function grouporder(source, orders, totalSum) {
source.sort(function (a, b) { source.sort(function (a, b) {
var convertA = a[orders[0]]; var convertA = a[orders[0]];
...@@ -72,7 +73,6 @@ export default { ...@@ -72,7 +73,6 @@ export default {
return source; return source;
} }
}, },
Vue.prototype.calcPageSize = function (itemHeight) { Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight = itemHeight let yuHeight = itemHeight
try { try {
...@@ -90,8 +90,7 @@ export default { ...@@ -90,8 +90,7 @@ export default {
yuHeight -= x.offsetHeight ? x.offsetHeight : 0 yuHeight -= x.offsetHeight ? x.offsetHeight : 0
} }
}) })
} catch (error) { } catch (error) {}
}
return Math.floor(yuHeight / itemHeight) return Math.floor(yuHeight / itemHeight)
} }
Vue.prototype.random_string = function (len) { Vue.prototype.random_string = function (len) {
...@@ -114,13 +113,14 @@ export default { ...@@ -114,13 +113,14 @@ export default {
domainUrl = "http://127.0.0.1:8082"; domainUrl = "http://127.0.0.1:8082";
let locationName = window.location.hostname; let locationName = window.location.hostname;
let javaUrldo=""; 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"; 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) { if (locationName.indexOf('testerp.oytour') !== -1) {
domainUrl = "http://testapi.oytour.com"; domainUrl = "http://testapi.oytour.com";
} //domainUrl = "http://reborn.oytour.com";
else if (locationName.indexOf('oytour') !== -1) { //domainUrl = "http://127.0.0.1"
} else if (locationName.indexOf('oytour') !== -1) {
domainUrl = "http://reborn.oytour.com"; domainUrl = "http://reborn.oytour.com";
} }
var obj = { var obj = {
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
//HTTP提交数据 //HTTP提交数据
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) { 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 = { let previousPathInfo = {
path: this.$route.name, path: this.$route.name,
...@@ -253,15 +253,24 @@ export default { ...@@ -253,15 +253,24 @@ export default {
this.$router.push({ this.$router.push({
path: '/signature' 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; } else if (this.$route.path == "/TravelContractConfirm") {
let orderID=this.$route.query.orderID; let ContractId = this.$route.query.ContractId;
this.$router.push({ name: "clientConfirm",query: {TCID:TCID,orderID:orderID}}) 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 { } else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") { if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({ this.$router.push({
...@@ -277,12 +286,12 @@ export default { ...@@ -277,12 +286,12 @@ export default {
} }
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase(); var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`); var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&key=${key}`);
let tempLanguage=0; let tempLanguage = 0;
if(localStorage.language && localStorage.language!=''){ if (localStorage.language && localStorage.language != '') {
if(localStorage.language=="zh-TW"){ if (localStorage.language == "zh-TW") {
tempLanguage=1; tempLanguage = 1;
}else if(localStorage.language=="Japanese"){ } else if (localStorage.language == "Japanese") {
tempLanguage=2; tempLanguage = 2;
} }
} }
var postData = { var postData = {
...@@ -291,7 +300,7 @@ export default { ...@@ -291,7 +300,7 @@ export default {
"timestamp": timestamp, "timestamp": timestamp,
"token": token, "token": token,
"sign": md5Str, "sign": md5Str,
"languageId":tempLanguage "languageId": tempLanguage
} }
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
headers: { headers: {
...@@ -312,6 +321,12 @@ export default { ...@@ -312,6 +321,12 @@ export default {
}, faildCall) }, 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) { Vue.prototype.ApiPost2 = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
...@@ -719,8 +734,8 @@ export default { ...@@ -719,8 +734,8 @@ export default {
bucket: 'vt-im-bucket' bucket: 'vt-im-bucket'
}) })
let that = this; let that = this;
let checkpoint=null; let checkpoint = null;
let percentage=0; let percentage = 0;
co(function* () { co(function* () {
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
let fileName = nameList[index] let fileName = nameList[index]
...@@ -755,7 +770,7 @@ export default { ...@@ -755,7 +770,7 @@ export default {
that.$http.post(uploadUrl, formData, {}) that.$http.post(uploadUrl, formData, {})
.then(res => { .then(res => {
successCall(res); successCall(res);
}).catch(function(reason){ }).catch(function (reason) {
that.$refs['my-upload'].clearFiles(); that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!'); that.$message.error('上传失败!');
that.MsgBus.$emit('UploadSelfFileErr') 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