哥哥玩剑魂呢 3 years ago
parent
commit
a49d1a845b

+ 6 - 2
src/api/auth.js

@@ -1,8 +1,12 @@
 const TokenKey = 'A-Token'
 const UserIdKey = 'userData'
 const TypesKey = 'types'
-
-
+import Vue from 'vue'
+export function openError(data) {
+    if(process.env.NODE_ENV=='production'){
+          Vue.prototype.$axios('post','/api/e',data)
+    }
+}
 export function getUserData () {
     return JSON.parse(localStorage.getItem(UserIdKey)); 
 }

+ 14 - 4
src/api/axios.js

@@ -2,13 +2,14 @@ import axios from 'axios'
 import {Message} from 'element-ui'
 import {
 	getToken,
-	setToken
+	setToken,
+	openError
 } from './auth.js'
 import qs from 'qs'
 const service = axios.create({
 	baseURL: process.env.VUE_APP_BASE_API, 
 	// baseURL:'https://ding.insys.g107.com/',
-	timeout: 20000,
+	timeout: 2000,
 	headers: {
 		'Content-Type': 'application/x-www-form-urlencoded',
 	},
@@ -16,10 +17,12 @@ const service = axios.create({
 		return qs.stringify(data)
 	}]
 })
-var url='';
+let url='';
+let data='';
 service.interceptors.request.use(
 	config => {
 		url=config.url;
+		data=qs.parse(config.data)
 		if (getToken()) {
 			config.headers['A-Token'] = getToken()
 		}
@@ -79,7 +82,14 @@ service.interceptors.response.use(
 			// })
 			console.log('网络异常,请检查网络是否畅通,再重新进入应用')
 			return Promise.reject(error.message)
-		}else if(error.message=='timeout of 20000ms exceeded'){
+		}else if(error.message=='timeout of 2000ms exceeded'){
+			if(url=='/api/integral/review/a/entry'||url=='/api/integral/point/entry'){
+				let sum=0;
+				if(data){
+					sum=data.items.length*data.members.length
+				}
+				openError({sum:sum,message:'钉钉PC'})
+			}
 			Message({
 				message: '请求超时,请稍后再试',
 				type: 'error',

+ 1 - 1
src/components/bonusPointsPopup.vue

@@ -603,7 +603,6 @@ export default {
 		subData(formName) {
 			this.$refs[formName].validate(valid => {
 				if (valid) {
-					this.btn_loading = true;
 					this.save();
 				}
 			});
@@ -688,6 +687,7 @@ export default {
 				this.btn_loading = false;
 				return false;
 			}
+			this.btn_loading = true;
 			this.$axios('post', this.integralType === 1 ? '' : this.integralType === 2 ? '/api/integral/review/a/entry' : '/api/integral/point/entry', data)
 				.then(res => {
 					if (res.data.code == 1) {

+ 18 - 0
src/hint.vue

@@ -45,6 +45,24 @@ export default {
 		}
 	},
 	methods: {
+		getSku() {
+			var that = this;
+			// this.$axios('get', 'api/order/goods/sku', { callback: 'https://test-ding.g107.com/#/index', goods_code: 'DT_GOODS_881607043109331' }).then(res => {});
+			this.$dd.biz.util.openSlidePanel({
+			    url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC969F1A50AEF2E5E320588012470F1AB045&token=d37751d45abad15178adf60f936d7c28&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7', //打开侧边栏的url
+			    title: 'title', //侧边栏顶部标题
+			    onSuccess : function(result) {
+			       /*
+			            调用biz.navigation.quit接口进入onSuccess, result为调用biz.navigation.quit传入的数值
+			        */
+			    },
+			    onFail : function() {
+			        /*
+			            tips:点击右上角上角关闭按钮会进入onFail
+			         */
+			    }
+			})
+		},
 		IsPC() {
 		    var userAgentInfo = navigator.userAgent;
 		    var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];

+ 0 - 14
src/index.vue

@@ -134,11 +134,6 @@ export default {
 	created() {
 		this.initRouter();
 		this.getEmployee()//缓存人员列表
-		// this.$store.dispatch('export_filter',false).then((res)=>{
-		// 	console.log(res)
-		// }).catch((err)=>{
-		// 	console.log(err)
-		// })
 	},
 	mounted() {
 		this.getTypes();
@@ -160,11 +155,6 @@ export default {
 					localStorage.setItem('wn_show', 'true');
 				}
 			}
-			// if (rUrl) {
-			// 	setTimeout(() => {
-			// 		this.$router.push({ path: '/' + rUrl });
-			// 	}, 200);
-			// }
 		});
 	},
 	methods: {
@@ -216,10 +206,6 @@ export default {
 				this.corpMessage = res.data.data;
 			});
 		},
-		getSku() {
-			var that = this;
-			this.$axios('get', 'api/order/goods/sku', { callback: 'https://test-ding.g107.com/#/index', goods_code: 'DD_GOODS-610003' }).then(res => {});
-		},
 		//当刷新页面是控制左边导航栏的选中
 		activeRouter(index, indexPath) {
 			localStorage.setItem('path', indexPath[1] ? indexPath[1] : indexPath[0]);

+ 1 - 1
src/main.js

@@ -21,7 +21,7 @@ import userImage from '@/components/UserImage'
 Vue.component('userImage', userImage)
 Vue.use(ElementUI);
 if (process.env.NODE_ENV === 'development') {
-  new VConsole()
+  // new VConsole()
 }
 
 Vue.prototype.$echarts = echarts

+ 1 - 1
src/views/abPoint/award_punish.vue

@@ -219,7 +219,7 @@
 		</el-drawer>
 
 		<bonusPointsPopup :title="popuTitle" :visible.sync="popupVisible" :ruleOnoff="ruleOnoff" :refresh.sync="refreshData" :integralType.sync="integralType">
-			<div style="text-align: center;position: relative;top: -10px;" class="yellow">最多只能选择10人</div>
+			<div style="position: relative;top: -20px;left: 80px;" class="yellow">最多只能选择10人</div>
 		</bonusPointsPopup>
 	</div>
 </template>

+ 1 - 1
src/views/set/jurisdiction.vue

@@ -579,7 +579,7 @@
 							<div slot="content" style="width: 300px;">
 								对奖分和扣分的比例作任务要求
 								<br />
-								举例说明:奖扣比例任务10:1,实际执行奖扣比例11:1(管理者当老好人,不敢执行扣分,导致扣分占比过低),则视为未完成,该执行人员将被扣对应分值。反之比例于10:1,任务为达标,不对执行人员实行扣分
+								举例说明:奖扣比例任务10:1,实际执行奖扣比例11:1(管理者当老好人,不敢执行扣分,导致扣分占比过低),则视为未完成,该执行人员将被扣对应分值。反之比例小于等于10:1,任务为达标,不对执行人员实行扣分
 							</div>
 							<span class="tips">?</span>
 						</el-tooltip>