在我的项目中,我希望将google驱动器文件列表添加到我的项目中.我正在使用ASP.NET Core.
我成功地在Google API控制台中创建了一个项目,并在ASP.NET核心中实现了代码.每次运行程序时都会出现Redirect URI Mismatch错误,即使我正确设置了重定向URL.我没有成功.
我正在使用Google drive API V3.
那是一个错误.错误:redirect_uri_mismatch
请求中的重定向URI(http://127.0.0.1:63354/authorize/)与授权给OAuth客户端的URI 不匹配.
所以我按照以下步骤进行ASP.NET核心项目.(首先我尝试在控制台项目中取得成功) https://dzone.com/articles/authentication-using-google-in-aspnet-core-20
通过这个链接,我可以在谷歌验证,但我无法从谷歌驱动器获取文件列表.我没有收到任何错误,并将文件计为零.
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Drive.v3;
using Google.Apis.Drive.v3.Data;
using Google.Apis.Services;
using Google.Apis.Util.Store;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace WebApplication.Controllers
{
public class TestController : BaseController
{
public IActionResult Authenticate()
{
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "",
ClientSecret = ""
},
new[] { DriveService.Scope.Drive },
"user",
CancellationToken.None).Result;
var …Run Code Online (Sandbox Code Playgroud) 我正在使用带有Prisma和vuejs + apollo客户端的GraphQL订阅
在本地系统中,我在http:// localhost:8080运行vuejs,在http:// localhost:4000运行服务器。
我想在仪表板上显示最近添加和更新的记录。
我已经在本地系统中实现了订阅,并且可以正常工作。
我将所有服务器端和客户端代码推送到服务器,但订阅在那儿无法正常工作。
我正在使用AWS服务器。除订阅外,其他所有内容均正常运行。我设置了websockets,它也可以正常工作。
有时我遇到以下错误:WebSocket与“ wss:// URL:4000 / graphql”的连接失败:WebSocket在建立连接之前已关闭
我在下面遵循文档 https://www.apollographql.com/docs/react/data/subscriptions/
我尝试了不同的方法,但没有成功。连接稳定/断开连接后重新连接。
在服务器端,我添加了用于Web套接字的侦听器,并且该侦听器正在连接。
这是我的vue-apollo.js文件的代码
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { ApolloClient } from 'apollo-client';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
// imports for subscription
import { split } from 'apollo-link';
import { WebSocketLink } from 'apollo-link-ws';
import { getMainDefinition } from 'apollo-utilities';
const uriHttp = process.env.VUE_APP_SERVER_URL;
const uriWs = process.env.VUE_APP_WS_SERVER_URL; …Run Code Online (Sandbox Code Playgroud) 我正在使用Express JS server来执行AWS MWS API. 根据MWS文档,_GET_REMOTE_FULFILLMENT_ELIGIBILITY_返回 Excel 文件对象。
我创建了 API,node js但无法获得正确的 excel。我在下载的 Excel 文件中出现了奇怪的字符。
const getRemoveFulfillmentEligibilityDataCon = async(req,res) => {
const mwsRequestData = {
Version: '2009-01-01',
Action: 'GetReport',
'SellerId': 'MWS_SELLER_ID',
'MWSAuthToken': 'MWS_AUTH_TOKEN',
ReportId: 'XXXXXXXXXXXXXX',
};
try {
const response = await amazonMws.reports.search(mwsRequestData);
/* make the worksheet */
var ws = XLSX.utils.json_to_sheet(response.data);
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws);
XLSX.writeFile(wb, "sheetjs.xlsx");
return response;
} catch (error) {
console.log('error ', error);
return …Run Code Online (Sandbox Code Playgroud) amazon-mws ×1
asp.net ×1
asp.net-core ×1
c# ×1
express ×1
graphql ×1
node-fetch ×1
node.js ×1
prisma ×1
vue.js ×1