1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <template>
- <view class="mainBox">
- <view class="container">
- <image src="../../static/images/login_bg.png"></image>
- <button
- class="myBtn"
- open-type="getPhoneNumber"
- @getphonenumber="getPhoneNumber"
- >
- 获取手机号
- </button>
- </view>
- </view>
- </template>
- <script>
- import httpAjax from '@/utils/https.js';
- /**
- * @description 待签收
- **/
- export default {
- name: 'login',
- data() {
- return {};
- },
- mounted() {
- const a = uni.getStorageSync('userInfo');
- if (a) {
- uni.navigateTo({
- url: '/pages/main/index',
- });
- }
- },
- methods: {
- getPhoneNumber(e) {
- if (e.detail.code) {
- let params = {
- code: e.detail.code,
- };
- uni
- .request({
- url: 'https://zlzd.zrzyt.zj.gov.cn/ysybz/api/app/xc/getXcryByMobile',
- // url: 'http://10.10.9.71:7089/ysgzybz/app/xc/getXcryByMobile',
- method: 'GET',
- data: params,
- })
- .then((result) => {
- console.log(result);
- if (result[1].data.data) {
- uni.setStorageSync('userInfo', result[1].data.data);
- uni.navigateTo({
- url: '/pages/main/index',
- });
- } else {
- uni.showToast({
- title: '该用户无权访问此系统',
- icon: 'none',
- duration: 4000,
- });
- }
- });
- } else {
- }
- },
- },
- };
- </script>
- <style lang="scss">
- @import './index.scss';
- </style>
|