#!/bin/bash
phone_no=$1

#"请输入用户手机号:" phone_no
        len=`echo $phone_no|awk '{print length($0)}'`
        if [ $len -ne 11 ]
        then
                echo "请输入11位手机号!"
        else
                break
        fi

ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
resp=`curl "http://$ip:7037/app/login?registerFrom=214&phoneNo=$phone_no" 2>/dev/null`
token=`echo $resp | jq ".data.token" | sed "s/\"//g"`
echo $token
echo "http://$ip:7001/app-landing?token=$token&registerFrom=214&channelId=1"
