|
@@ -190,7 +190,7 @@ import { Component, Vue, Ref, Watch } from 'vue-property-decorator';
|
|
|
import html2canvas from 'html2canvas';
|
|
import html2canvas from 'html2canvas';
|
|
|
import { NavBar, Button, Image, Loading, Empty, Toast, ImagePreview } from 'vant';
|
|
import { NavBar, Button, Image, Loading, Empty, Toast, ImagePreview } from 'vant';
|
|
|
import { diagGetEntity, diagGetReadState, diagUpdateReadState } from "@/api/indexAI";
|
|
import { diagGetEntity, diagGetReadState, diagUpdateReadState } from "@/api/indexAI";
|
|
|
-import { getWecomType, toLBHome } from '@/utils/index';
|
|
|
|
|
|
|
+import { getWecomType, toLBHome,getWxconfig } from '@/utils/index';
|
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
|
declare let wx: any;
|
|
declare let wx: any;
|
|
|
@Component({
|
|
@Component({
|
|
@@ -248,7 +248,7 @@ export default class DiagnosisPage extends Vue {
|
|
|
// }
|
|
// }
|
|
|
// 页面挂载时请求数据
|
|
// 页面挂载时请求数据
|
|
|
created() {
|
|
created() {
|
|
|
- this.getWxconfig();
|
|
|
|
|
|
|
+ getWxconfig();
|
|
|
if (this.$route.query.WecomType) {
|
|
if (this.$route.query.WecomType) {
|
|
|
sessionStorage.setItem("WecomType", this.$route.query.WecomType);
|
|
sessionStorage.setItem("WecomType", this.$route.query.WecomType);
|
|
|
} else {
|
|
} else {
|
|
@@ -433,39 +433,6 @@ export default class DiagnosisPage extends Vue {
|
|
|
imgClick(url) {
|
|
imgClick(url) {
|
|
|
ImagePreview([url]);
|
|
ImagePreview([url]);
|
|
|
}
|
|
}
|
|
|
- // 获取微信API授权信息
|
|
|
|
|
- getWxconfig() {
|
|
|
|
|
- const jsApiList = ['getSetting', 'authorize', 'showModal', 'openSetting', 'downloadFile', 'saveImageToPhotosAlbum', 'closeWindow'];
|
|
|
|
|
- let url = window.location.href.split("#")[0];
|
|
|
|
|
- axios.get(`${process.env.VUE_APP_BASE_API}wx/ticket`, {
|
|
|
|
|
- params: {
|
|
|
|
|
- url: url,
|
|
|
|
|
- agent: 1
|
|
|
|
|
- }
|
|
|
|
|
- }).then(response => {
|
|
|
|
|
- if (response.status == 200) {
|
|
|
|
|
- let qiyeData = response.data.data;
|
|
|
|
|
- wx.agentConfig({
|
|
|
|
|
- debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
|
|
|
- corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
|
|
|
|
|
- agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
|
|
|
|
|
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
|
|
|
|
|
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
|
|
|
|
|
- signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
|
|
|
|
|
- jsApiList: [...jsApiList], //必填,传入需要使用的接口名称
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- console.log('获取签名成功');
|
|
|
|
|
- },
|
|
|
|
|
- fail: function (res) {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- if (res.errMsg.indexOf('function not exist') > -1) {
|
|
|
|
|
- alert('版本过低请升级');
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
GetReadStateFn() {
|
|
GetReadStateFn() {
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|