Files
tuanwei-uniapp/pages/login/service.js
T
weicw1996 7175fb3070 小程序登录页新增统一身份认证入口
登录方式由两种扩为三种(密码 / 微信授权 / 统一身份认证),
新增 loginByGxmuSso 与 fetchGxmuSsoAvailable 两个接口封装。
2026-09-18 23:31:05 +08:00

41 lines
801 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { DEFAULT_TENANT_ID, get, post } from '../../utils/request'
export function loginByPassword(data) {
return post(
'/login',
{
tenantId: DEFAULT_TENANT_ID,
isMiniApp: 1,
...data
},
{
auth: false
}
)
}
export function loginByMpWxPhone(data) {
return post('/wx-login/loginByMpWxPhone', data, {
auth: false
})
}
// 学校统一身份认证登录:学号 + 统一身份认证密码,由后端调认证平台校验
export function loginByGxmuSso(data) {
return post(
'/sso/login',
{
username: data.username,
password: data.password
},
{
auth: false
}
)
}
// 统一身份认证登录是否已开通(后端未配置 appid/appsecret 时返回 false
export function fetchGxmuSsoAvailable() {
return get('/sso/available', {}, { auth: false })
}