import request from '@/utils/request.js';

export const authApi = {
	verifyAsset(identifier) {
		return request({
			url: '/api/c/v1/auth/verify-asset',
			method: 'POST',
			data: { identifier }
		});
	},

	wechatLogin(asset_token, code) {
		return request({
			url: '/api/c/v1/auth/wechat-login',
			method: 'POST',
			data: { asset_token, code }
		});
	},

	sendCode(phone, scene) {
		return request({
			url: '/api/c/v1/auth/send-code',
			method: 'POST',
			data: { phone, scene }
		});
	},

	bindPhone(phone, code) {
		return request({
			url: '/api/c/v1/auth/bind-phone',
			method: 'POST',
			data: { phone, code }
		});
	},

	changePhone(old_phone, old_code, new_phone, new_code) {
		return request({
			url: '/api/c/v1/auth/change-phone',
			method: 'POST',
			data: { old_phone, old_code, new_phone, new_code }
		});
	},

	logout() {
		return request({
			url: '/api/c/v1/auth/logout',
			method: 'POST'
		});
	}
};