接口对接

This commit is contained in:
仲么了
2023-07-03 20:29:24 +08:00
parent 5f67499e57
commit 77fd768acf
32 changed files with 587 additions and 1319 deletions

View File

@@ -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',
})