接口对接
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<image class="login-box-logo" mode="widthFix" src="/static/logo.png"></image>
|
||||
<template v-if="loginType == 'yzm'">
|
||||
<view class="login-box-input mt100">
|
||||
<input class="login-box-input-main" maxlength="11" v-model="yzmForm.phone" placeholder="请输入手机号" />
|
||||
<input class="login-box-input-main" maxlength="11" v-model="yzmForm.phone" placeholder="请输入手机号" />
|
||||
</view>
|
||||
<!-- <view class="login-box-input mt40">
|
||||
<input class="login-box-input-main" v-model="yzmForm.imgCode" placeholder="图形验证码" />
|
||||
@@ -143,7 +143,12 @@ export default {
|
||||
smsCode: this.yzmForm.code,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
uni.setStorageSync('userInfo', res.data)
|
||||
uni.setStorageSync('access_token', res.data.token_type + ' ' + res.data.access_token)
|
||||
uni.setStorageSync('refresh_token', res.data.refresh_token)
|
||||
let strings = res.data.access_token.split('.') //截取token,获取载体
|
||||
var userInfo = JSON.parse(decodeURIComponent(escape(window.atob(strings[1].replace(/-/g, '+').replace(/_/g, '/')))))
|
||||
userInfo.authorities = userInfo.authorities[0]
|
||||
uni.setStorageSync('userInfo', userInfo)
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user