123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- const { request } = require('./request')
- /**
- * 获取验证码
- * @param obj
- * @returns {Promise<unknown>}
- */
- export const sendCode = (obj) => request({
- url: '/api/send/code',
- method: 'POST',
- data: {
- 'phone': obj.phone, // 手机号码
- 'type': obj.type // 1注册2登录3修改密码
- },
- showLoading: false
- })
- /**
- * 小程序手机号登录
- * @param obj
- * @returns {Promise<*>}
- */
- export const miniPhoneLogin = (obj) => request({
- url: '/api/user/mini/phone/login',
- method: 'POST',
- data: {
- 'code': obj.wxCode, // 小程序授权code
- 'user_phone': obj.cellphone, // 手机号
- 'user_code': obj.code // 验证码
- },
- showLoading: false
- })
- /**
- * 小程序原生登录
- * @param obj
- * @returns {Promise<*>}
- */
- export const miniLogin = (obj) => request({
- url: '/api/user/mini/login',
- method: 'POST',
- data: {
- 'code': obj.wxCode, // 小程序授权code
- 'encryptedData': obj.encryptedData, // 加密数据
- 'iv': obj.iv // iv
- }
- })
- /**
- * 获取用户信息
- * @returns {Promise<unknown>}
- */
- export const getUserInfo = () => request({
- url: '/api/user/info',
- method: 'POST',
- showLoading: false
- }, false)
- /**
- * 更新用户信息
- * @param obj
- * @returns {Promise<unknown>}
- */
- export const updateUserInfo = (obj) => request({
- url: '/api/user/update/info',
- method: 'POST',
- data: {
- // 'user_nickname': 'sd', // 用户昵称
- // 'user_head_img_url': 'sdsff', // 用户头像
- // 'user_sex': 1, // 性别(1男2女)
- // 'user_address': 'sdsdsdsugddug', // 地址
- ...obj
- },
- showLoading: true
- })
- /**
- * 用户退出登录接口
- * @returns {Promise<unknown>}
- */
- export const userLoginOut = () => request({
- url: '/api/user/login/out',
- method: 'POST',
- showLoading: false
- })
- /**
- * 商品分类
- * @returns {Promise<*>}
- */
- export const getProductCategoryList = () => request({
- url: '/api/shop/product/category/list',
- method: 'POST',
- showLoading: true
- })
- /**
- * 商品品牌
- * @returns {Promise<*>}
- */
- export const getProductBrandList = () => request({
- url: '/api/shop/product/brand/list',
- method: 'POST',
- showLoading: true
- })
- /**
- * 供应商详情
- * @param shopId
- * @returns {Promise<*>}
- */
- export const getShopDetail = (shopId) => request({
- url: '/api/user/home/shop/detail',
- method: 'POST',
- data: {
- shop_id: shopId
- },
- showLoading: true
- })
- /**
- * 系统配置
- * @returns {Promise<*>}
- */
- export const getSystemConfig = () => request({
- url: '/api/system/config',
- method: 'POST',
- showLoading: false
- }, false)
|