| | |
| | | } from '@/api' |
| | | export default { |
| | | onLaunch: function() { |
| | | window.addEventListener("popstate", (event) => { |
| | | const path = this.$route.fullPath |
| | | // console.log('path', path); |
| | | if (path == '/pages/login/login' || path == '/') { |
| | | window.location.href = app_url |
| | | } |
| | | if (path == '/pages/wdata/home') { |
| | | window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/wdata/home' |
| | | } |
| | | if (path == '/pages/waybill/home') { |
| | | window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/waybill/home' |
| | | } |
| | | }) |
| | | uni.setStorageSync('transportList', []) |
| | | // window.addEventListener("popstate", (event) => { |
| | | // const path = this.$route.fullPath |
| | | // if (path == '/pages/login/login' || path == '/') { |
| | | // window.location.href = app_url |
| | | // } |
| | | // if (path == '/pages/wdata/home') { |
| | | // window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/wdata/home' |
| | | // } |
| | | // if (path == '/pages/waybill/home') { |
| | | // window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/waybill/home' |
| | | // } |
| | | // }) |
| | | // uni.setStorageSync('transportList', []) |
| | | console.log('onLaunch') |
| | | }, |
| | | onShow: function() { |
| | |
| | | "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", |
| | | "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" |
| | | }, |
| | | "dingtalk-jsapi": { |
| | | "version": "3.2.0", |
| | | "resolved": "https://registry.npmmirror.com/dingtalk-jsapi/-/dingtalk-jsapi-3.2.0.tgz", |
| | | "integrity": "sha512-PZhTM1T9ERdaOzjFbyokegVmf/vUVvlg0BKcMiP1bB0e3vBflroPpbW2SjrZEKuvFxFtuFDpvYpk2EhbbKH/6Q==", |
| | | "requires": { |
| | | "promise-polyfill": "^7.1.0" |
| | | } |
| | | }, |
| | | "mutation-observer": { |
| | | "version": "1.0.3", |
| | | "resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz", |
| | | "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==" |
| | | }, |
| | | "promise-polyfill": { |
| | | "version": "7.1.2", |
| | | "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz", |
| | | "integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" |
| | | }, |
| | | "regenerator-runtime": { |
| | | "version": "0.14.1", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", |
| | |
| | | }, |
| | | "dependencies": { |
| | | "dayjs": "^1.11.13", |
| | | "dingtalk-jsapi": "^3.2.0", |
| | | "uniapp-qrcode": "^1.0.2", |
| | | "uview-ui": "^2.0.37", |
| | | "vconsole": "^3.15.1" |
| | |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'MEMBER_IMG', |
| | | isFace: 0 |
| | | // isFace: 0 |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getInfo() |
| | | if (!this.$store.state.openId) { |
| | | // if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | } |
| | | // } |
| | | }, |
| | | methods: { |
| | | initToken() { |
| | |
| | | },
|
| | | onLoad(option) {
|
| | | console.log('onLoad');
|
| | | if (option.ywid) {
|
| | | uni.setStorageSync('ywinfo', {
|
| | | type: option.type,
|
| | | yw: option.yw,
|
| | | ywid: option.ywid
|
| | | })
|
| | | } |
| | | // if (option.ywid) {
|
| | | // uni.setStorageSync('ywinfo', {
|
| | | // type: option.type,
|
| | | // yw: option.yw,
|
| | | // ywid: option.ywid
|
| | | // })
|
| | | // } |
| | | // https://atwl.ahzyssl.com/zhyq_h5/#/pages/login/login?type=2&yw=5&ywid=b3db2072-a453-470d-8c0d-ba3b8b256530
|
| | | },
|
| | | onShow() {
|
| | |
| | | <script> |
| | | let timer |
| | | import { getSystemDictData } from "@/api" |
| | | import { getCode } from "@/utils/getCode.js"; |
| | | export default { |
| | | name: 'Index', |
| | | data() { |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getInfo() |
| | | if (!this.$store.state.openId) { |
| | | getCode(code => { |
| | | console.log('code', code) |
| | | }); |
| | | // if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | } |
| | | // } |
| | | }, |
| | | methods: { |
| | | initToken() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as dd from 'dingtalk-jsapi'; |
| | | export function getCode(callback) { |
| | | let corpId = 'dingb14b7554444efe0a'; |
| | | console.log(dd.env.platform) |
| | | if (dd.env.platform !== "notInDingTalk") { |
| | | dd.ready(() => { |
| | | //使ç¨SDK è·åå
ç»ææç |
| | | dd.runtime.permission.requestAuthCode({ |
| | | corpId: corpId, |
| | | onSuccess: (info) => { |
| | | // æ ¹æ®ééæä¾çapi è·å¾codeå,忬¡è°ç¨è¿ä¸ªcallbackæ¹æ³ |
| | | // ç±äºæ¯ééè·åcodeæ¯å¼æ¥æä½,ä¸ç¥éä»ä¹æ¶åæ§è¡å®æ¯ |
| | | // callback 彿°ä¼ç仿§è¡å®æ¯åå¨èªå·±è°ç¨èªå·± |
| | | callback(info.code) |
| | | }, |
| | | onFail: (err) => { |
| | | alert('fail'); |
| | | alert(JSON.stringify(err)); |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | |
| | | uni.$u.http.interceptors.response.use((response) => { |
| | | uni.hideLoading(); |
| | | // ç»å½è¿æ |
| | | if (response.data.code === 401) { |
| | | uni.navigateTo({ |
| | | url: '/packageA/loginAgain/loginAgain' |
| | | }); |
| | | } |
| | | // if (response.data.code === 401) { |
| | | // uni.navigateTo({ |
| | | // url: '/packageA/loginAgain/loginAgain' |
| | | // }); |
| | | // } |
| | | if (response.data.code !== 200) { |
| | | uni.showToast({ |
| | | title: response.data.message, |
| | |
| | | 'title': 'æå¡å¨å¼å¸¸',icon:'none' |
| | | }) |
| | | } |
| | | if (data.code === 5112) { |
| | | uni.clearStorageSync() |
| | | window.location.href = app_url |
| | | } |
| | | // if (data.code === 5112) { |
| | | // uni.clearStorageSync() |
| | | // window.location.href = app_url |
| | | // } |
| | | return resolve(data) |
| | | } |
| | | resolve(data) |