mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
commit message
This commit is contained in:
61
api/connect.js
Normal file
61
api/connect.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 信任登录相关API
|
||||
*/
|
||||
|
||||
import {
|
||||
http,
|
||||
Method
|
||||
} from '@/utils/request.js';
|
||||
const request = http.request;
|
||||
|
||||
|
||||
/**
|
||||
* web 第三方登录
|
||||
* @param {Object} code
|
||||
*/
|
||||
export function webConnect(code) {
|
||||
return http.request({
|
||||
url: `connect/login/web/${code}`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
header: {
|
||||
"clientType": "H5"
|
||||
}
|
||||
});
|
||||
}
|
||||
export function openIdLogin(params, clientType) {
|
||||
return http.request({
|
||||
url: `connect/app/login`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
data: params,
|
||||
header: {
|
||||
"clientType": clientType
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方登录成功 回调接口
|
||||
*/
|
||||
export function loginCallback(state) {
|
||||
return http.request({
|
||||
url: `connect/result?state=${state}`,
|
||||
method: Method.GET,
|
||||
needToken: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 小程序自动登录
|
||||
* @param params
|
||||
*/
|
||||
export function mpAutoLogin(params) {
|
||||
return http.request({
|
||||
url: 'mini-program/auto-login',
|
||||
method: Method.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user