feat: 登录联调
This commit is contained in:
parent
9740ed4fc3
commit
17822c9113
@ -38,6 +38,7 @@ export const skuInfo = (goodsId, goodsSkuId, param) => {
|
|||||||
return request.get(api.skuInfo, { goodsId, goodsSkuId, ...param })
|
return request.get(api.skuInfo, { goodsId, goodsSkuId, ...param })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取商品列表
|
||||||
export const apiGetCommodityList = (data) => {
|
export const apiGetCommodityList = (data) => {
|
||||||
return httpRequest.post(
|
return httpRequest.post(
|
||||||
`${baseUrl}/app/index/page/list`,
|
`${baseUrl}/app/index/page/list`,
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import {httpRequest} from '@/utils/request/axios'
|
||||||
|
const baseUrl = 'https://api.1024api.com/api-interface'
|
||||||
|
|
||||||
|
|
||||||
// api地址
|
// api地址
|
||||||
const api = {
|
const api = {
|
||||||
login: 'passport/login',
|
login: 'passport/login',
|
||||||
loginMpWx: 'passport/loginMpWx',
|
loginMpWx: 'passport/loginMpWx',
|
||||||
loginMpWxMobile: 'passport/loginMpWxMobile',
|
loginMpWxMobile: 'passport/loginMpWxMobile',
|
||||||
isPersonalMpweixin: 'passport/isPersonalMpweixin',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户登录 (手机号+验证码)
|
// 用户登录 (手机号+验证码)
|
||||||
@ -18,12 +20,15 @@ export function loginMpWx(data, option) {
|
|||||||
return request.post(api.loginMpWx, data, option)
|
return request.post(api.loginMpWx, data, option)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否需要填写昵称头像 (微信小程序端)
|
|
||||||
export function isPersonalMpweixin(data, option) {
|
|
||||||
return request.post(api.isPersonalMpweixin, data, option)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 微信小程序快捷登录 (授权手机号)
|
// 微信小程序快捷登录 (授权手机号)
|
||||||
export function loginMpWxMobile(data, option) {
|
export function loginMpWxMobile(data, option) {
|
||||||
return request.post(api.loginMpWxMobile, data, option)
|
return request.post(api.loginMpWxMobile, data, option)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 微信快捷登录
|
||||||
|
export const quickLogin = (data) => {
|
||||||
|
return httpRequest.post(
|
||||||
|
`${baseUrl}/app/user/login`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
<!-- 登录后需要填写昵称头像 -->
|
||||||
<view v-if="isPersonal === true" class="personal">
|
<view v-if="isPersonal === true" class="personal">
|
||||||
<!-- 页面头部 -->
|
<!-- 页面头部 -->
|
||||||
<view class="header">
|
<view class="header">
|
||||||
@ -35,7 +36,7 @@
|
|||||||
<view v-if="isPersonal === false" class="authorize">
|
<view v-if="isPersonal === false" class="authorize">
|
||||||
<view class="store-info">
|
<view class="store-info">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<image class="image" :src="storeInfo && storeInfo.image_url ? storeInfo.image_url : '/static/default-logo.png'"></image>
|
<image class="image" src="https://heyuimage.ihzhy.com/prd/202511/697446e044869c29.jpg??access_token=e01c8565446ad0448dfb6d9f69f3d562"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="auth-title">申请获取以下权限</view>
|
<view class="auth-title">申请获取以下权限</view>
|
||||||
@ -55,9 +56,7 @@
|
|||||||
import * as LoginApi from '@/api/login'
|
import * as LoginApi from '@/api/login'
|
||||||
import * as UploadApi from '@/api/upload'
|
import * as UploadApi from '@/api/upload'
|
||||||
import AvatarImage from '@/components/avatar-image'
|
import AvatarImage from '@/components/avatar-image'
|
||||||
import { isEmpty } from '@/utils/util'
|
|
||||||
import * as Verify from '@/utils/verify'
|
import * as Verify from '@/utils/verify'
|
||||||
import StoreModel from '@/common/model/Store'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -65,13 +64,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 商城基本信息
|
|
||||||
storeInfo: undefined,
|
|
||||||
// 是否需要填写用户昵称和头像
|
// 是否需要填写用户昵称和头像
|
||||||
isPersonal: undefined,
|
isPersonal: false,
|
||||||
// 微信小程序登录凭证 (code)
|
|
||||||
// 提交到后端,用于换取openid
|
|
||||||
code: '',
|
|
||||||
// 按钮禁用
|
// 按钮禁用
|
||||||
disabled: false,
|
disabled: false,
|
||||||
// 头像路径 (用于显示)
|
// 头像路径 (用于显示)
|
||||||
@ -86,31 +80,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
|
||||||
// 获取商城基本信息
|
|
||||||
this.getStoreInfo()
|
|
||||||
// 请求后端是否需要填写昵称头像 (微信小程序端)
|
|
||||||
this.getIsPersonal()
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
// 一键登录按钮点击事件
|
||||||
// 获取商城基本信息
|
handleLogin() {
|
||||||
getStoreInfo() {
|
this.onAuthSuccess({})
|
||||||
StoreModel.storeInfo().then(storeInfo => this.storeInfo = storeInfo)
|
|
||||||
},
|
},
|
||||||
|
// 授权成功事件
|
||||||
/**
|
// 这里分为两个逻辑:
|
||||||
* 请求后端是否需要填写昵称头像 (微信小程序端)
|
// 1.将code和userInfo提交到后端,如果存在该用户 则实现自动登录,无需再填写手机号
|
||||||
* - 条件1: 后台开启了填写微信头像和昵称
|
// 2.如果不存在该用户, 则显示注册页面, 需填写手机号
|
||||||
* - 条件2: 用户首次注册或者已注册但未填写过信息
|
// 3.如果后端报错了, 则显示错误信息
|
||||||
*/
|
async onAuthSuccess(userInfo) {
|
||||||
async getIsPersonal() {
|
|
||||||
const app = this
|
const app = this
|
||||||
LoginApi.isPersonalMpweixin({ code: await app.getCode() })
|
// 提交到后端
|
||||||
.then(result => app.isPersonal = result.data.isPersonalMpweixin)
|
const code = await app.getCode()
|
||||||
|
store.dispatch('LoginMpWx', { code })
|
||||||
|
.then(result => {
|
||||||
|
// 一键登录成功
|
||||||
|
app.$toast(result.message)
|
||||||
|
// 相应全局事件订阅: 刷新上级页面数据
|
||||||
|
uni.$emit('syncRefresh', true)
|
||||||
|
// 跳转回原页面
|
||||||
|
setTimeout(() => app.onNavigateBack(), 2000)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
const resultData = err.result.data
|
||||||
|
// 判断还需绑定手机号
|
||||||
|
if (resultData.isBindMobile) {
|
||||||
|
app.onEmitSuccess(userInfo)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取code
|
// 获取code
|
||||||
// https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html
|
// https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html
|
||||||
getCode() {
|
getCode() {
|
||||||
@ -118,7 +118,6 @@
|
|||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success({ code }) {
|
success({ code }) {
|
||||||
console.log('code', code)
|
|
||||||
resolve(code)
|
resolve(code)
|
||||||
},
|
},
|
||||||
fail: reject
|
fail: reject
|
||||||
@ -203,44 +202,6 @@
|
|||||||
app.onAuthSuccess({ nickName: app.form.nickName, avatarId: app.form.avatarId })
|
app.onAuthSuccess({ nickName: app.form.nickName, avatarId: app.form.avatarId })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 一键登录按钮点击事件
|
|
||||||
handleLogin() {
|
|
||||||
// this.onAuthSuccess({ nickName: '微信用户', avatarUrl: '' })
|
|
||||||
this.onAuthSuccess({})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 授权成功事件
|
|
||||||
// 这里分为两个逻辑:
|
|
||||||
// 1.将code和userInfo提交到后端,如果存在该用户 则实现自动登录,无需再填写手机号
|
|
||||||
// 2.如果不存在该用户, 则显示注册页面, 需填写手机号
|
|
||||||
// 3.如果后端报错了, 则显示错误信息
|
|
||||||
async onAuthSuccess(userInfo) {
|
|
||||||
const app = this
|
|
||||||
// 提交到后端
|
|
||||||
store.dispatch('LoginMpWx', {
|
|
||||||
partyData: {
|
|
||||||
code: await app.getCode(),
|
|
||||||
oauth: 'MP-WEIXIN',
|
|
||||||
userInfo
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(result => {
|
|
||||||
// 一键登录成功
|
|
||||||
app.$toast(result.message)
|
|
||||||
// 相应全局事件订阅: 刷新上级页面数据
|
|
||||||
uni.$emit('syncRefresh', true)
|
|
||||||
// 跳转回原页面
|
|
||||||
setTimeout(() => app.onNavigateBack(), 2000)
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
const resultData = err.result.data
|
|
||||||
// 判断还需绑定手机号
|
|
||||||
if (resultData.isBindMobile) {
|
|
||||||
app.onEmitSuccess(userInfo)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 将oauth提交给父级
|
// 将oauth提交给父级
|
||||||
// 这里要重新获取code, 因为上一次获取的code不能复用(会报错)
|
// 这里要重新获取code, 因为上一次获取的code不能复用(会报错)
|
||||||
async onEmitSuccess(userInfo) {
|
async onEmitSuccess(userInfo) {
|
||||||
@ -352,9 +313,6 @@
|
|||||||
height: 190rpx;
|
height: 190rpx;
|
||||||
border: 4rpx solid #fff;
|
border: 4rpx solid #fff;
|
||||||
margin: 0 auto 0;
|
margin: 0 auto 0;
|
||||||
border-radius: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 2rpx 0 10rpx rgba(50, 50, 50, 0.3);
|
|
||||||
|
|
||||||
.image {
|
.image {
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@ -8,8 +8,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import Main from './components/main'
|
import Main from './components/main'
|
||||||
import MpWeixin from './components/mp-weixin'
|
import MpWeixin from './components/mp-weixin'
|
||||||
import SettingKeyEnum from '@/common/enum/setting/Key'
|
|
||||||
import SettingModel from '@/common/model/Setting'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -21,8 +19,6 @@
|
|||||||
return {
|
return {
|
||||||
// 数据加载完成 [防止在微信小程序端onLoad和view渲染同步进行]
|
// 数据加载完成 [防止在微信小程序端onLoad和view渲染同步进行]
|
||||||
isLoad: false,
|
isLoad: false,
|
||||||
// 注册设置 (后台设置)
|
|
||||||
setting: {},
|
|
||||||
// 是否显示微信小程序授权登录
|
// 是否显示微信小程序授权登录
|
||||||
isMpWeixinAuth: false,
|
isMpWeixinAuth: false,
|
||||||
// 是否显示微信小程序端 一键授权手机号
|
// 是否显示微信小程序端 一键授权手机号
|
||||||
@ -38,8 +34,6 @@
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
// 获取注册设置
|
|
||||||
await this.getRegisterSetting()
|
|
||||||
// 设置当前是否显示第三方授权登录
|
// 设置当前是否显示第三方授权登录
|
||||||
await this.setShowUserInfo()
|
await this.setShowUserInfo()
|
||||||
// 数据加载完成
|
// 数据加载完成
|
||||||
@ -47,12 +41,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 获取注册设置 [后台-客户端-注册设置]
|
|
||||||
async getRegisterSetting() {
|
|
||||||
this.setting = await SettingModel.item(SettingKeyEnum.REGISTER.value, false)
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置当前是否显示第三方授权登录
|
* 设置当前是否显示第三方授权登录
|
||||||
* - 条件1: 只有对应的客户端显示获取用户信息按钮, 例如微信小程序、微信公众号
|
* - 条件1: 只有对应的客户端显示获取用户信息按钮, 例如微信小程序、微信公众号
|
||||||
@ -63,10 +51,9 @@
|
|||||||
// 判断当前客户端是微信小程序
|
// 判断当前客户端是微信小程序
|
||||||
const isMpWeixin = app.platform === 'MP-WEIXIN'
|
const isMpWeixin = app.platform === 'MP-WEIXIN'
|
||||||
// 判断是否显示第三方授权登录
|
// 判断是否显示第三方授权登录
|
||||||
app.isMpWeixinAuth = isMpWeixin && Boolean(app.setting.isOauthMpweixin)
|
app.isMpWeixinAuth = isMpWeixin
|
||||||
app.isMpWeixinMobile = isMpWeixin && Boolean(app.setting.isOauthMobileMpweixin)
|
app.isMpWeixinMobile = isMpWeixin
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取到用户信息的回调函数
|
// 获取到用户信息的回调函数
|
||||||
onGetUserInfoSuccess(result) {
|
onGetUserInfoSuccess(result) {
|
||||||
// 记录第三方用户信息数据
|
// 记录第三方用户信息数据
|
||||||
|
|||||||
@ -1,17 +1,19 @@
|
|||||||
import { ACCESS_TOKEN, USER_ID } from '@/store/mutation-types'
|
import { ACCESS_TOKEN, USER_ID, FLAG } from '@/store/mutation-types'
|
||||||
import storage from '@/utils/storage'
|
import storage from '@/utils/storage'
|
||||||
import * as LoginApi from '@/api/login'
|
import * as LoginApi from '@/api/login'
|
||||||
|
|
||||||
// 登陆成功后执行
|
// 登陆成功后执行
|
||||||
const loginSuccess = (commit, { token, userId }) => {
|
const loginSuccess = (commit, { token, buyerId, flag }) => {
|
||||||
// 过期时间30天
|
// 过期时间30天
|
||||||
const expiryTime = 30 * 86400
|
const expiryTime = 30 * 86400
|
||||||
// 保存tokne和userId到缓存
|
// 保存tokne和userId到缓存
|
||||||
storage.set(USER_ID, userId, expiryTime)
|
storage.set(USER_ID, buyerId, expiryTime)
|
||||||
storage.set(ACCESS_TOKEN, token, expiryTime)
|
storage.set(ACCESS_TOKEN, token, expiryTime)
|
||||||
|
storage.set(FLAG, flag, expiryTime)
|
||||||
// 记录到store全局变量
|
// 记录到store全局变量
|
||||||
commit('SET_TOKEN', token)
|
commit('SET_TOKEN', token)
|
||||||
commit('SET_USER_ID', userId)
|
commit('SET_USER_ID', buyerId)
|
||||||
|
commit('SET_FLAG', flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
@ -19,7 +21,9 @@ const user = {
|
|||||||
// 用户认证token
|
// 用户认证token
|
||||||
token: '',
|
token: '',
|
||||||
// 用户ID
|
// 用户ID
|
||||||
userId: null
|
userId: null,
|
||||||
|
// 用户标识
|
||||||
|
flag: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
@ -28,6 +32,9 @@ const user = {
|
|||||||
},
|
},
|
||||||
SET_USER_ID: (state, value) => {
|
SET_USER_ID: (state, value) => {
|
||||||
state.userId = value
|
state.userId = value
|
||||||
|
},
|
||||||
|
SET_FLAG: (state, value) => {
|
||||||
|
state.flag = value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -49,10 +56,12 @@ const user = {
|
|||||||
// 微信小程序一键授权登录 (获取用户基本信息)
|
// 微信小程序一键授权登录 (获取用户基本信息)
|
||||||
LoginMpWx({ commit }, data) {
|
LoginMpWx({ commit }, data) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
LoginApi.loginMpWx({ form: data }, { isPrompt: true })
|
// LoginApi.loginMpWx({ form: data }, { isPrompt: true })
|
||||||
|
LoginApi.quickLogin(data)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const result = response.data
|
const result = response.data
|
||||||
loginSuccess(commit, result)
|
uni.setStorageSync('user_info', result.buyer)
|
||||||
|
loginSuccess(commit, result.buyer)
|
||||||
resolve(response)
|
resolve(response)
|
||||||
})
|
})
|
||||||
.catch(reject)
|
.catch(reject)
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
export const ACCESS_TOKEN = 'AccessToken'
|
export const ACCESS_TOKEN = 'AccessToken'
|
||||||
export const USER_ID = 'userId'
|
export const USER_ID = 'userId'
|
||||||
|
export const FLAG = 'flag'
|
||||||
export const PLATFORM = 'platform'
|
export const PLATFORM = 'platform'
|
||||||
export const APP_THEME = 'appTheme'
|
export const APP_THEME = 'appTheme'
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class HttpRequest {
|
|||||||
msg = "服务器开小差了~";
|
msg = "服务器开小差了~";
|
||||||
}
|
}
|
||||||
!requestConfig.noShowMsg &&
|
!requestConfig.noShowMsg &&
|
||||||
wx.showToast({
|
uni.showToast({
|
||||||
title: `${msg},错误码:${statusCode}`,
|
title: `${msg},错误码:${statusCode}`,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
@ -52,7 +52,7 @@ class HttpRequest {
|
|||||||
msg = "请求超时";
|
msg = "请求超时";
|
||||||
}
|
}
|
||||||
!requestConfig.noShowMsg &&
|
!requestConfig.noShowMsg &&
|
||||||
wx.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
@ -62,14 +62,13 @@ class HttpRequest {
|
|||||||
// 服务器接口请求
|
// 服务器接口请求
|
||||||
request(requestConfig) {
|
request(requestConfig) {
|
||||||
const _this = this;
|
const _this = this;
|
||||||
const wxSystemInfo = wx.getSystemInfoSync();
|
const user_info = uni.getStorageSync("user_info") || {};
|
||||||
const user_info = wx.getStorageSync("user_info") || {};
|
|
||||||
const reqData = Object.assign(requestConfig.data, {
|
const reqData = Object.assign(requestConfig.data, {
|
||||||
buyerId: user_info.buyerId,
|
buyerId: user_info.buyerId,
|
||||||
flag: user_info.flag,
|
flag: user_info.flag,
|
||||||
});
|
});
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wx.request({
|
uni.request({
|
||||||
method: requestConfig.method,
|
method: requestConfig.method,
|
||||||
url: `${requestConfig.url}`,
|
url: `${requestConfig.url}`,
|
||||||
data: reqData,
|
data: reqData,
|
||||||
@ -81,20 +80,20 @@ class HttpRequest {
|
|||||||
/** 接口请求成功*/
|
/** 接口请求成功*/
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
if (["1003", "1004", "1005", "1006"].includes(data.code)) {
|
if (["1003", "1004", "1005", "1006"].includes(data.code)) {
|
||||||
wx.showModal({
|
uni.showModal({
|
||||||
content: data.msg,
|
content: data.msg,
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
wx.removeStorageSync("user_info");
|
uni.removeStorageSync("user_info");
|
||||||
wx.navigateTo({ url: "/pages/login/index" });
|
uni.navigateTo({ url: "/pages/login/index" });
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
try {
|
try {
|
||||||
wx.removeStorageSync("user_info");
|
uni.removeStorageSync("user_info");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("登录失效catch:", e);
|
console.log("登录失效catch:", e);
|
||||||
}
|
}
|
||||||
wx.reLaunch({ url: "/pages/index/index" });
|
uni.reLaunch({ url: "/pages/index/index" });
|
||||||
wx.hideLoading();
|
uni.hideLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -104,24 +103,23 @@ class HttpRequest {
|
|||||||
} else if (code === 401) {
|
} else if (code === 401) {
|
||||||
// 未授权
|
// 未授权
|
||||||
!requestConfig.noShowMsg &&
|
!requestConfig.noShowMsg &&
|
||||||
wx
|
uni.showModal({
|
||||||
.showModal({
|
title: "登录失效",
|
||||||
title: "登录失效",
|
content: "登录失效,请重新登录",
|
||||||
content: "登录失效,请重新登录",
|
success: (resModa) => {
|
||||||
})
|
|
||||||
.then((resModa) => {
|
|
||||||
if (resModa.confirm) {
|
if (resModa.confirm) {
|
||||||
wx.removeStorageSync("user_info");
|
uni.removeStorageSync("user_info");
|
||||||
wx.navigateTo({ url: "/pages/login/index" });
|
uni.navigateTo({ url: "/pages/login/index" });
|
||||||
} else if (resModa.cancel) {
|
} else if (resModa.cancel) {
|
||||||
try {
|
try {
|
||||||
wx.removeStorageSync("user_info");
|
uni.removeStorageSync("user_info");
|
||||||
wx.reLaunch({ url: "/pages/index/index" });
|
uni.reLaunch({ url: "/pages/index/index" });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("登录失效catch:", e);
|
console.log("登录失效catch:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
});
|
||||||
reject({ code, msg: "未登录", data: data });
|
reject({ code, msg: "未登录", data: data });
|
||||||
} else {
|
} else {
|
||||||
//非200及401状态码-数据处理
|
//非200及401状态码-数据处理
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user