1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <script>
- export default {
- // 此处globalData为了演示其作用,不是uView框架的一部分
- globalData: {
- username: '白居易',
- base_url: '/api'
- },
- onLaunch() {
- console.log(this.$store.state, 'ppp')
- let is_login = this.$store.state.vuex_user
- if (!is_login) {
- uni.reLaunch({
- url: 'pages/login/index'
- })
- } else {
- if (is_login.is_register == 0) {
- uni.switchTab({
- url: 'pages/index/index'
- })
- }
- }
-
- // 1.1.0版本之前关于http拦截器代码,已平滑移动到/common/http.interceptor.js中
- // 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
- // import httpInterceptor from '@/common/http.interceptor.js'
- // Vue.use(httpInterceptor, app)
- // process.env.VUE_APP_PLATFORM 为通过js判断平台名称的方法,结果分别如下:
- /**
- * h5,app-plus(nvue下也为app-plus),mp-weixin,mp-alipay......
- */
- },
- methods: {
-
- }
- }
- </script>
- <style lang="scss">
- @import "uview-ui/index.scss";
- @import "common/demo.scss";
- .empty {
- margin-top: 20px;
- text-align: center;
- image {
- display: inline-block;
- width: 30%;
- }
- .empty-text {
- margin-top: 20px;
- font-size: 14px;
- color: rgba(113, 113, 113, 0.43);
- }
- }
- uni-modal .uni-modal .uni-modal__hd{
- padding: 15px 0 0;
- }
- </style>
|