@ -13,6 +13,7 @@ class Oauth::CreateOrFindWechatAccountService < ApplicationService
raise Error, 'Code不能为空' if code.blank?
result = WechatOauth::Service.access_token(code)
result = WechatOauth::Service.user_info(result['access_token'], result['openid'])
# 存在该用户
open_user = OpenUsers::Wechat.find_by(uid: result['unionid'])
@ -8,6 +8,7 @@ Rails.application.routes.draw do
get 'attachments/download/:id/:filename', to: 'attachments#show'
get '/auth/qq/callback', to: 'oauth/qq#create'
get '/auth/wechat/callback', to: 'oauth/wechat#create'
resources :edu_settings
scope '/api' do