jinxiansen / serversideswift Goto Github PK
View Code? Open in Web Editor NEW🦄 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 server open source projects based on the Swift 4.1 and Vapor 3 frameworks. (Swift 服务端开源项目)
Home Page: http://api.jinxiansen.com
License: MIT License
使用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時有錯誤如下
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:
File: /Users/github/SwiftServerSide-Vapor-master/VaporServer/.build/checkouts/mysql.git-1890032512239690518/Sources/MySQL/Connection/MySQLConnectionHandler.swift
Here are some possible causes:
These suggestions could address the issue:
Vapor's documentation talks about this:
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
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如何处理?
vapor 发布4.0有段时间了,求更新 @Jinxiansen
这个是别人的例子。
https://github.com/LiveUI/ApiCore
请教三个问题:
RefreshToken 结构体用什么作用吗?还是在实际应用中会用到?
RefreshToken 只比 AccessToken 少一个 expiryTime 字段。
struct xxxxContainer ,这类结构体有什么作用?数据容器或者数据转换?
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"}}
你自己测试的是可以直接用吗?
import Authentication
No such module 'Authentication'
期待更新到最新版本,谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.