123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <script>
- import config from './config'
- import store from '@/store'
- import {
- getToken,
- getSsoToken
- } from '@/utils/auth'
- export default {
- onLaunch: function() {
- this.initApp()
- },
- methods: {
-
- initApp() {
-
- this.initConfig()
-
-
- this.checkLogins()
-
- },
- initConfig() {
- this.globalData.config = config
-
-
-
-
- },
- checkLogin() {
- if (!getToken()) {
- this.$tab.reLaunch('/pages/login')
- }
- },
- checkLogins() {
- if (!getToken()) {
- this.$tab.reLaunch('/pages/work/CleanGov/')
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- },
- getUrlCode() {
-
- var url = location.search
- var theRequest = new Object()
- if (url.indexOf('?') != -1) {
- var str = url.substr(1)
- var strs = str.split('&')
- for (var i = 0; i < strs.length; i++) {
- theRequest[strs[i].split('=')[0]] = strs[i].split('=')[1]
- }
- }
- return theRequest
- },
- getUserInfo() {
- let data = {}
- data.code = this.code
- data.appid = 'wx2cfd24c7380cdc08'
- authorizeLogin(data).then(res => {
- uni.setStorageSync('X-Token', res.data.token)
- console.log(res.data.token)
- }).catch(() => {})
- },
- }
- }
- </script>
- <style lang="scss">
- @import '@/static/scss/index.scss'
- </style>
|