diff --git a/app_saas/__manifest__.py b/app_saas/__manifest__.py index 3f9e7efd..cf3d07b1 100644 --- a/app_saas/__manifest__.py +++ b/app_saas/__manifest__.py @@ -39,7 +39,7 @@ 'summary': ''' AiSaas云服务,使用Ai通行证,一键实现全社交媒体统一登录SSO。 支持微信、抖音、QQ、淘宝、钉钉、支付宝、企业微信、Facebook、Google、微软Azure等整合登录。 - 在Odoo中获取最新的中文翻译(另行收费),获取当前Odoo模块最新版本更新等。 + 在Odoo中获取最新的中文翻译(会员专属),获取当前Odoo模块最新版本更新等。 支持Odoo中文版在线更新及 www.odooapp.cn 的信息推送等。 安装即代表同意我司云服务用户协议及隐私政策。 https://www.odooapp.cn/conditions ''', @@ -47,7 +47,7 @@ 1. Ai通行证实现全社交媒体登录支持 2. 快速访问Odoo中文应用商店并获取独享Odoo中文通行码,可随时断开云服务连接 3. 一键获取最新Odoo中文应用模块与主题,最新行业服务包 - 4. 一键获取Odoo中文翻译更新(收费) + 4. 一键获取Odoo中文翻译更新(会员专属) 5. 快速获取Odoo服务,Odoo升级评估 6. 系统出错时一键提交,获取技术支持(会员专属) 11.多语言支持,多公司支持 diff --git a/app_saas/models/res_users.py b/app_saas/models/res_users.py index 66099fd7..0eaca243 100644 --- a/app_saas/models/res_users.py +++ b/app_saas/models/res_users.py @@ -34,32 +34,42 @@ class ResUsers(models.Model): _inherit = 'res.users' @api.model - def auth_oauth(self, provider, params): + def get_token_with_code(self, provider, params): + # 通过 code 取 token # 这里原生是没处理code模式,此处将增加使用code取token,不在 controller 中处理 + oauth_provider = self.env['auth.oauth.provider'].sudo().browse(provider) + + # odoo 特殊处理,用code取token + params.update({ + 'scope': oauth_provider.scope or '', + 'client_id': oauth_provider.client_id or '', + }) + if hasattr(oauth_provider, 'client_secret') and oauth_provider.client_secret: + params.update({ + 'client_secret': oauth_provider.client_secret or '', + }) + response = requests.get(oauth_provider.code_endpoint, params=params, timeout=30) + if response.ok: + ret = response.json() + # todo: 客户机首次连接时,取到的 server 端 key 写入 provider 的 client_secret + if ret.get('push_client_secret') and hasattr(oauth_provider, 'client_secret'): + oauth_provider.write({'client_secret': ret.get('push_client_secret')}) + self._cr.commit() + return ret + return {} + + @api.model + def auth_oauth(self, provider, params): code = params.get('code', False) access_token = params.get('access_token') oauth_provider = self.env['auth.oauth.provider'].sudo().browse(provider) - + # 额外code 处理 kw = {} if oauth_provider.code_endpoint and code and not access_token: - # odoo 特殊处理,用code取token - params.update({ - 'scope': oauth_provider.scope or '', - 'client_id': oauth_provider.client_id or '', - }) - if hasattr(oauth_provider, 'client_secret') and oauth_provider.client_secret: - params.update({ - 'client_secret': oauth_provider.client_secret or '', - }) - response = requests.get(oauth_provider.code_endpoint, params=params, timeout=30) - if response.ok: - ret = response.json() - # todo: 客户机首次连接时,取到的 server 端 key 写入 provider 的 client_secret - if ret.get('push_client_secret') and hasattr(oauth_provider, 'client_secret'): - oauth_provider.write({'client_secret': ret.get('push_client_secret')}) - self._cr.commit() + ret = self.get_token_with_code(provider, params) kw = {**ret, **params} kw.pop('code', False) + self = self.with_context(auth_extra=kw) res = super(ResUsers, self).auth_oauth(provider, kw) return res diff --git a/app_saas/static/description/banner.png b/app_saas/static/description/banner.png index e5a82a4d..d24cc22d 100644 Binary files a/app_saas/static/description/banner.png and b/app_saas/static/description/banner.png differ diff --git a/app_saas/static/description/banner1.png b/app_saas/static/description/banner1.png index de86dec9..95692152 100644 Binary files a/app_saas/static/description/banner1.png and b/app_saas/static/description/banner1.png differ diff --git a/app_saas/static/description/banner2.png b/app_saas/static/description/banner2.png new file mode 100644 index 00000000..8557815e Binary files /dev/null and b/app_saas/static/description/banner2.png differ diff --git a/app_saas/static/description/banner3.png b/app_saas/static/description/banner3.png new file mode 100644 index 00000000..de86dec9 Binary files /dev/null and b/app_saas/static/description/banner3.png differ diff --git a/app_saas/static/description/index.html b/app_saas/static/description/index.html index 567dc7af..3d64d99c 100644 --- a/app_saas/static/description/index.html +++ b/app_saas/static/description/index.html @@ -17,12 +17,16 @@
-

1.启用后即可使用 odooapp.cn 提供的社媒整合登录

+

1.启用后即可使用 odooapp.cn 提供的全网社交媒体整合登录

支持微信、抖音、QQ、淘宝、钉钉、支付宝、企业微信、Facebook、Google、微软Azure等整合登录。

未经用户明确同意,本应用不会获取任何用户系统数据.

相关内容,请参考用户协议及我们的隐私政策:

https://www.odooapp.cn/conditions

https://www.odooapp.cn/privacy-policy

+
+ +
+

用户可直接调用SSO一键登录

@@ -32,7 +36,7 @@

2. 快速访问Odoo中文应用商店并获取独享Odoo中文通行码,可随时断开云服务连接

-

启用云服务务后,即可获取最新功能推送,版本比对信息,提供版本升级建议

+

启用云服务后,即可获取最新功能推送,版本比对信息,提供版本升级建议