Git Product home page Git Product logo

jinxiansen / serversideswift Goto Github PK

View Code? Open in Web Editor NEW
593.0 593.0 55.0 4.76 MB

🦄 Swift server open source projects based on the Swift 4.1 and Vapor 3 frameworks. (Swift 服务端开源项目)

Home Page: http://api.jinxiansen.com

License: MIT License

Swift 71.10% CSS 22.06% JavaScript 5.91% Python 0.93%
awesome-vapor perfect server server-side-swift swift-crawler tutorial vapor vapor-example vapor-swift

serversideswift's Introduction

Hey, I'm Jinxiansen. Nice to see you.

serversideswift's People

Contributors

jinxiansen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serversideswift's Issues

无法顺利build

使用vapor build后会出现ERROR试问大神有解决方式吗?

Error (1):
error: multiple products named 'Logging' in: Console, swift-log
error: multiple targets named 'Logging' in: Console, swift-log

執行vapor run時有錯誤

執行vapor run時有錯誤如下

Running VaporServer ...
[INFO] 启动数据库:vaporDebugDB
(/Users/github/SwiftServerSide-Vapor-master/VaporServer/Sources/App/Utility/MySQLConfig.swift:sqlData:58:28)
[ INFO ] Migrating 'mysql' database (MigrationConfig.swift:69)
Fatal error: Error raised at top level: ⚠️ MySQL Error: Full authentication not supported over insecure connections.

  • id: MySQLError.fullAuthRequired

File: /Users/github/SwiftServerSide-Vapor-master/VaporServer/.build/checkouts/mysql.git-1890032512239690518/Sources/MySQL/Connection/MySQLConnectionHandler.swift

  • func: handlePacket(ctx:packet:)
  • line: 52
  • column: 37

Here are some possible causes:

  • Using 'caching_sha2_password' auth plugin (default in MySQL >= 8.0.4) over an insecure (no SSL) connection.

These suggestions could address the issue:

  • Use a secure MySQLTransportConfig option in your MySQLDatabaseConfig.
  • Use a MySQL auth plugin that does not require full authentication (like 'mysql_native_password').
  • Use MySQL < 8.0.4.

Vapor's documentation talks about this:

validation account and password is error

LoginUser.swift

line 37 func validation:

if account.isAccount().0 == false {
return account.isAccount()
}

if password.isPassword().0 == false {
return account.isPassword()
}

The condition on the right should be false

static css file fail

leaf静态文件好像加载不了。
https://v4.bootcss.com/docs/4.0/components/buttons/
这个直接使用可以

<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

使用本地文件不行

<link rel="stylesheet" href="/static/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

如果使用前后端分离、你这个web登录和refreshtoken如何处理?

RefreshToken和Container的作用

请教三个问题:

  1. RefreshToken 结构体用什么作用吗?还是在实际应用中会用到?
    RefreshToken 只比 AccessToken 少一个 expiryTime 字段。

  2. struct xxxxContainer ,这类结构体有什么作用?数据容器或者数据转换?

  3. let digest = try req.make(BCryptDigest.self)。为什么需要用make不自己init?因为有缓存吗?

ps
非常感谢你分享的库,开阔视野,学到很多东西!
期待你的回复。

你的这个例子里终端里的注册请求失败

➜  ~ curl --request POST \ --url http://localhost:8080/users/register \ --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \ --form [email protected] \ --form password=qbter123
curl: (6) Could not resolve host:  --url
{"error":true,"reason":"Request does not have a content type."}curl: (6) Could not resolve host:  --header
curl: (3) Port number ended with ' '
curl: (6) Could not resolve host:  --form
<!DOCTYPE html><html><head><title>Foxmail</title><meta http-equiv="refresh" content="0; url=http://www.foxmail.com/" /></head><body style="background:#292929 url(./images/pc/zh/mainbanner_bg.png) 0 0 repeat;"></body></html>
curl: (6) Could not resolve host:  --form
curl: (6) Could not resolve host: password=qbter123

修改成这个可以用

➜  ~ curl -H "Content-Type: application/json" -X POST -d '{"account":"[email protected]","password":"qbter123"}' http://localhost:8080/users/register
{"status":0,"message":"注册成功","data":{"accessToken":"yjJG_2aWcGfyQDbmopYbSSOIGLH0x0BcLcWrh-hbSJg","userID":"B200F407-7511-4415-9A40-10B48A72B565"}}

你自己测试的是可以直接用吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.