123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <script>
- import {
- conn
- } from './utils/WebIM';
-
-
-
- export default {
- onLaunch: function() {
-
- setTimeout(() => {
- if (uni.getStorageSync("token")) {
- this.HXlogin()
-
- } else {
-
-
-
-
-
- }
- }, 800)
- },
- onShow: function() {
-
- },
- onHide: function() {
-
- },
- methods: {
- HXlogin() {
- if (uni.getStorageSync('user_no') && uni.getStorageSync('pwd')) {
- var user_no = uni.getStorageSync('user_no')
- var pwd = uni.getStorageSync('pwd')
- conn.open({
- user: user_no,
- pwd: pwd,
- appKey: conn.appkey
- }).then(() => {
- console.log('res');
- }).catch(reason => {
- console.log('失败', reason);
- })
- }
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: #f4f4f4;
- }
- .uni-bar {
- background-color: #f4f4f4;
- }
-
- @import "@/uview-ui/index.scss";
- </style>
|