347617796@qq.com 2 年之前
父節點
當前提交
c1f5c39c76
共有 5 個文件被更改,包括 90 次插入49 次删除
  1. 二進制
      src/assets/image/tz.png
  2. 7 5
      src/hint.vue
  3. 21 4
      src/init.vue
  4. 15 2
      src/noAccess.vue
  5. 47 38
      src/views/job/home.vue

二進制
src/assets/image/tz.png


+ 7 - 5
src/hint.vue

@@ -29,9 +29,10 @@ export default {
 		var url = window.location.href;
 		// let url='https://test-ding.g107.com/?purchaseToken=$PURCHASE_TOKEN$&corpId=$CORPID$&appEntityType=PC#/hint';
 		var data = this.GetRequest(url);
-		// console.log(JSON.stringify(data))
+		console.log(JSON.stringify(data))
 		this.corpId = data.corpId;
 		this.token = data.purchaseToken;
+		console.log(this.token)
 		if(data.appEntityType.indexOf('APP')>=0){
 			this.type ='APP';
 		}else{
@@ -60,12 +61,13 @@ export default {
 			// 开发者自行判断调用这个方法的时机
 			openTryoutSku({
 				// corpId可以从应用首页的url上获取到
-				corpId: this.corpId,
+				// corpId: this.corpId,
+				corpId:'ding92ee17791e311bdfa1320dcb25e91351',
 				// 应用的appId
 				appId: 109758,
 				// 从应用首页的url上获取到,url上参数名为 purchaseToken。
 				// purchaseToken如何配置参照下文”配置入口地址“章节。
-				token: this.token,
+				// token: this.token,
 				miniAppId: this.type == 'APP' ? 5000000002664231 : '' // 如果是三方小程序应用,需要设置一下自身的miniAppId。H5微应用可以不设置这个参数
 			}).then(res => {
 				const {
@@ -82,9 +84,9 @@ export default {
 						close({});
 					} else {
 						if(this.IsPC()){
-							window.location.replace('https://app109758.eapps.dingtalkcloud.com?corpId=' + corpId)
+							window.location.replace('https://app109758.eapps.dingtalkcloud.com/pc?corpId=' + corpId)
 						}else{
-							openLink({ url:'https://app109758.eapps.dingtalkcloud.com?corpId=' + corpId }).then(() => close({}));
+							openLink({ url:'https://app109758.eapps.dingtalkcloud.com/pc?corpId=' + corpId }).then(() => close({}));
 						}
 						
 					}

+ 21 - 4
src/init.vue

@@ -17,6 +17,12 @@
 			</div>
 			<div class="fontColorF" style="text-align: center;margin-top: 15px;font-size: 18px;">手机钉钉扫码,付费升级</div>
 		</el-dialog>
+		<el-dialog title="通知" :visible.sync="dialogFormVisible2" width="480px" :show-close="false" :close-on-click-modal="false">
+			<div>
+				<div style="font-size: 18px;">尊敬的用户:</div>
+				<div style="margin: 10px 0;">您未授权进入系统,请联系管理员将你纳入绩效应用</div>
+			</div>
+		</el-dialog>
 	</div>
 </template>
 
@@ -29,7 +35,8 @@ export default {
 			isRefresh: false,
 			disabled: false,
 			showBtnCunt: 0,
-			dialogFormVisible:false
+			dialogFormVisible:false,
+			dialogFormVisible2:false
 		};
 	},
 	mounted() {
@@ -41,7 +48,7 @@ export default {
 		if (corpId) {
 			this.login(corpId);
 		}
-		console.log(JSON.stringify(this.GetRequest(url)))
+		// console.log(JSON.stringify(this.GetRequest(url)))
 		if(this.GetRequest(url).url){
 			this.$setCache("url",this.GetRequest(url).url)
 		}
@@ -93,11 +100,21 @@ export default {
 						var is = false;
 						if (res.data.code == 1) {
 							let user = res.data.data;
-							if (user.is_official==1) {
+							let timestamp = Date.parse(new Date()); //当前时间戳
+							if((user.site.expire_time*1000)<timestamp){ //判断是否过期
+								that.dialogFormVisible=true;
+								return false
+							}
+							if (user.is_official==1&&user.is_scope == 1) {
 								that.$setUserData(user);
 								that.$router.replace({ path: '/index' });
 							}else{
-								that.$router.replace({ path: '/noAccess' });
+								if(user.is_official==0){//未启用
+								   that.$router.replace({ path: '/noAccess' });
+								}
+								if(user.is_scope==0){//未授权
+								   that.$router.replace({ path: '/noAccess',query:{id:1} });
+								}	
 							}
 						}else if(res.data.code==2001){
 							that.dialogFormVisible=true;

+ 15 - 2
src/noAccess.vue

@@ -2,12 +2,25 @@
 	<div class="NoData flex-box flex-center-center">
 		<img  src="@/assets/image/app.png" class="appImg"/>
 		<div>
-			<div>当前用户未授权进入系统,请联系管理员为您【启用绩效管理】,<br/>如需咨询客服,请到您企业专属的功道云服务群咨询</div>
+			<div v-if="!id">当前用户未启用进入系统,请联系管理员为您【启用绩效管理】,<br/>如需咨询客服,请到您企业专属的功道云服务群咨询</div>
+			<div v-else>当前用户未授权进入系统,请联系管理员将你纳入绩效应用</div>
 		</div>
 	</div>
 </template>
-
 <script>
+export default {
+	data() {
+		return {
+			id:''
+		};
+	},
+	created() {
+		this.id=this.$route.query.id
+	},
+	mounted() {
+
+	}
+};
 </script>
 
 <style scoped="scoped">

+ 47 - 38
src/views/job/home.vue

@@ -1,5 +1,10 @@
 <template>
 	<div class="all boxMinHeight">
+		<div class="flex-box ts flex-center-center" v-if="isSubject">
+			<img mode="scaleToFill" src="@/assets/image/tz.png" />
+			<div class="flex-1">你正在使用个人体验版,如需正式使用,请联系管理员</div>
+			<div class="btn" type="primary" @click="openGly">联系管理员</div>
+		</div>
 		<div>
 			<div class="left-main" v-if="$getRole(1)">
 				<div class="flex-box-ce" v-if="entranceList.length > 0">
@@ -189,26 +194,6 @@
 					</el-tab-pane>
 				</el-tabs>
 			</div>
-			<!-- 常见问题 -->
-<!-- 			<div class="wt">
-				<div class="flex-box-ce"><div class="wt-title flex-1">常见问题</div></div>
-				<div class="wts" v-for="(item, index) in issueList" :key="index">
-					<div class="flex-box-ce wt-item">
-						<span class="fontColorF flex-box-ce">
-							<span class="zmBox">Q</span>
-							问题:
-						</span>
-						<span class="flex-1">{{ item.title }}</span>
-					</div>
-					<div class="flex-box wt-item">
-						<span class="fontColorF flex-box">
-							<span class="zmBox" style="background-color: #8E9296;">A</span>
-							回答:
-						</span>
-						<span class="flex-1">{{ item.content }}</span>
-					</div>
-				</div>
-			</div> -->
 		</div>
 		<!-- 跟踪管理 -->
 		<TrackManagement
@@ -227,11 +212,14 @@
 import ECharts from 'echarts';
 import TrackManagement from '@/components/public/TrackManagement';
 import JxSearch from '@/components/public/JxSearch';
+import { contactAdminToUseApp } from 'dingtalk-design-libs';
 export default {
 	name: 'home',
 	components: { JxSearch, TrackManagement },
 	data() {
 		return {
+			isSubject: false, //判断是否是个人版进入
+			mainCorpId: '', //如果是个人版,这个企业ID是登录者所在的企业ID,不是钉钉那边提供的隐藏企业ID
 			day: this.$moment().format('YYYY-MM-DD'),
 			editableTabs: [
 				{ title: '全部待办', name: '0', num: 0 },
@@ -291,15 +279,6 @@ export default {
 		this.getAgency();
 		this.getMessage();
 		this.glIndex == '1' ? this.getManagement() : this.getScorerRecord();
-		// var url = window.location.href;
-		// var rUrl = this.GetRequest(url).url || '';
-		// this.$nextTick(function() {
-		// 	if (rUrl) {
-		// 		setTimeout(() => {
-		// 			this.$router.push({ path: '/' + decodeURIComponent(rUrl) });
-		// 		}, 200);
-		// 	}
-		// });
 	},
 	created() {
 		this.setMenu();
@@ -309,15 +288,11 @@ export default {
 		this.getAgency();
 		this.getMessage();
 		this.assessTree();
-		// var url = window.location.href;
-		// var rUrl = this.GetRequest(url).url || '';
-		// this.$nextTick(function() {
-		// 	if (rUrl) {
-		// 		setTimeout(() => {
-		// 			this.$router.push({ path: '/' + decodeURIComponent(rUrl) });
-		// 		}, 200);
-		// 	}
-		// });
+		// 个人版处理
+		if (this.$getUserData().is_personal == 1) {
+			this.isSubject = true;
+			this.mainCorpId = this.$getUserData().main_corp_id;
+		}
 	},
 	watch: {
 		activeName() {
@@ -336,6 +311,12 @@ export default {
 		}
 	},
 	methods: {
+		openGly() {
+			contactAdminToUseApp({ id: '109758', corpId: this.mainCorpId }).catch(err => {
+				// 入参不正确,或者遇到技术异常时才会进入这个链路
+				console.error(err);
+			});
+		},
 		GetRequest(urlStr) {
 			if (typeof urlStr == 'undefined') {
 				var url = decodeURI(location.search); //获取url中"?"符后的字符串
@@ -679,6 +660,34 @@ export default {
 </script>
 
 <style scoped="scoped">
+	.ts {
+		height: 64px;
+		padding: 8px 16px;
+		font-size: 14px;
+		color: #089fff;
+		background: #e6f3ff;
+		font-weight: 500;
+		box-sizing: border-box;
+		margin-bottom: 10px;
+	}
+	.ts img {
+		width: 24px;
+		height: 24px;
+	}
+	.ts .flex-1 {
+		padding: 0 8px;
+	}
+	.ts .btn {
+		width: 94px;
+		height: 28px;
+		background-color: #089fff;
+		line-height: 28px;
+		font-size: 14px;
+		color: #fff;
+		border-radius: 3px;
+		cursor: pointer;
+		text-align: center;
+	}
 .actionText {
 }
 .zmBox {