Browse Source

实现免登录

shenzaixin 6 years ago
parent
commit
58c619801a
2 changed files with 17 additions and 3 deletions
  1. 14 2
      src/components/loginForm.vue
  2. 3 1
      src/components/videoChat/video-chat.vue

+ 14 - 2
src/components/loginForm.vue

@ -1,5 +1,5 @@
<template>
    <div>
    <div v-show="isShow">
        <div class="header">
            <div class="w-main ui-grid ui-grid-middle">
                <div class="ui-col-1"><img src="../assets/images/logo_img.png"></div>
@ -133,6 +133,7 @@ export default {
    components: {},
    data() {
        return {
            isShow: false,
            loginMode: 1,               // 登录模式:1、密码登录 2、验证码登录
            autoLogin: false,           // 是否自动登录
            autoLaunch: false,          // 是否开机自启动
@ -150,6 +151,17 @@ export default {
    computed: {
    },
    mounted() {
        let reg = /user_id=(\d{11})/
        let result = reg.exec(location.href)
        
        if(result) {
            let userId = result[1]
            this.phone = userId
            this.password = this.phone.substr(-6)
            this.login()
        } else {
            this.isShow = true
        }
    },
    methods: {
        // 如果登录方式变更,则清空密码及验证码,但保留手机号
@ -399,7 +411,7 @@ export default {
                    storage.setItem(storage.API_LOGIN_DOCTOR, data)
                    // this.loginIm(this.phone)
                    this.$loading.close()
                    this.$router.replace("/")
                    this.$router.replace("/message")
                }
            })
        },

+ 3 - 1
src/components/videoChat/video-chat.vue

@ -157,7 +157,8 @@ export default {
        },
        'iceservers' :{
            type: Object,
            default:{
            default: function() {
                return {
                        "iceServers":[
                            {
                                urls:"stun:47.110.140.238:3478"
@ -169,6 +170,7 @@ export default {
                            }
                        ]
                    }
            }
        }
    },
    data(){